mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 16:18:16 +00:00
schro: fix for base video updates
This commit is contained in:
parent
8dddd8e633
commit
69a5d3c067
3 changed files with 20 additions and 27 deletions
|
@ -93,9 +93,8 @@ static GstFlowReturn gst_schro_dec_parse_data (GstBaseVideoDecoder *
|
||||||
static int gst_schro_dec_scan_for_sync (GstBaseVideoDecoder *
|
static int gst_schro_dec_scan_for_sync (GstBaseVideoDecoder *
|
||||||
base_video_decoder, gboolean at_eos, int offset, int n);
|
base_video_decoder, gboolean at_eos, int offset, int n);
|
||||||
static GstFlowReturn gst_schro_dec_handle_frame (GstBaseVideoDecoder * decoder,
|
static GstFlowReturn gst_schro_dec_handle_frame (GstBaseVideoDecoder * decoder,
|
||||||
GstVideoFrame * frame);
|
GstVideoFrame * frame, GstClockTimeDiff deadline);
|
||||||
static GstFlowReturn gst_schro_dec_finish (GstBaseVideoDecoder *
|
static gboolean gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder);
|
||||||
base_video_decoder, GstVideoFrame * frame);
|
|
||||||
static void gst_schrodec_send_tags (GstSchroDec * schro_dec);
|
static void gst_schrodec_send_tags (GstSchroDec * schro_dec);
|
||||||
|
|
||||||
static GstStaticPadTemplate gst_schro_dec_sink_template =
|
static GstStaticPadTemplate gst_schro_dec_sink_template =
|
||||||
|
@ -269,9 +268,6 @@ error:
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_schro_dec_start (GstBaseVideoDecoder * dec)
|
gst_schro_dec_start (GstBaseVideoDecoder * dec)
|
||||||
{
|
{
|
||||||
if (dec->codec_data) {
|
|
||||||
GST_DEBUG_OBJECT (dec, "codec data!");
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -470,6 +466,7 @@ gst_schro_dec_parse_data (GstBaseVideoDecoder * base_video_decoder,
|
||||||
|
|
||||||
gst_base_video_decoder_set_sync_point (base_video_decoder);
|
gst_base_video_decoder_set_sync_point (base_video_decoder);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->last_sink_timestamp)) {
|
if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->last_sink_timestamp)) {
|
||||||
base_video_decoder->current_frame->presentation_timestamp =
|
base_video_decoder->current_frame->presentation_timestamp =
|
||||||
base_video_decoder->last_sink_timestamp;
|
base_video_decoder->last_sink_timestamp;
|
||||||
|
@ -500,9 +497,7 @@ gst_schro_dec_parse_data (GstBaseVideoDecoder * base_video_decoder,
|
||||||
GST_DEBUG ("gp pt %lld dist %d delay %d dt %lld", pt, dist, delay, dt);
|
GST_DEBUG ("gp pt %lld dist %d delay %d dt %lld", pt, dist, delay, dt);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
state =
|
state = gst_base_video_decoder_get_state (base_video_decoder);
|
||||||
gst_base_video_decoder_get_state (GST_BASE_VIDEO_DECODER
|
|
||||||
(schro_decoder));
|
|
||||||
base_video_decoder->current_frame->presentation_timestamp =
|
base_video_decoder->current_frame->presentation_timestamp =
|
||||||
gst_util_uint64_scale (granulepos_to_frame
|
gst_util_uint64_scale (granulepos_to_frame
|
||||||
(base_video_decoder->last_sink_offset_end), state->fps_d * GST_SECOND,
|
(base_video_decoder->last_sink_offset_end), state->fps_d * GST_SECOND,
|
||||||
|
@ -510,6 +505,7 @@ gst_schro_dec_parse_data (GstBaseVideoDecoder * base_video_decoder,
|
||||||
} else {
|
} else {
|
||||||
base_video_decoder->current_frame->presentation_timestamp = -1;
|
base_video_decoder->current_frame->presentation_timestamp = -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
|
@ -685,7 +681,7 @@ gst_schro_dec_process (GstSchroDec * schro_dec, gboolean eos)
|
||||||
|
|
||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
gst_schro_dec_handle_frame (GstBaseVideoDecoder * base_video_decoder,
|
gst_schro_dec_handle_frame (GstBaseVideoDecoder * base_video_decoder,
|
||||||
GstVideoFrame * frame)
|
GstVideoFrame * frame, GstClockTimeDiff deadline)
|
||||||
{
|
{
|
||||||
GstSchroDec *schro_dec;
|
GstSchroDec *schro_dec;
|
||||||
int schro_ret;
|
int schro_ret;
|
||||||
|
@ -710,9 +706,8 @@ gst_schro_dec_handle_frame (GstBaseVideoDecoder * base_video_decoder,
|
||||||
return gst_schro_dec_process (schro_dec, FALSE);
|
return gst_schro_dec_process (schro_dec, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GstFlowReturn
|
gboolean
|
||||||
gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder,
|
gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder)
|
||||||
GstVideoFrame * frame)
|
|
||||||
{
|
{
|
||||||
GstSchroDec *schro_dec;
|
GstSchroDec *schro_dec;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,6 @@ struct _GstSchroEnc
|
||||||
/* state */
|
/* state */
|
||||||
SchroEncoder *encoder;
|
SchroEncoder *encoder;
|
||||||
SchroVideoFormat *video_format;
|
SchroVideoFormat *video_format;
|
||||||
GstVideoFrame *eos_frame;
|
|
||||||
GstBuffer *seq_header_buffer;
|
GstBuffer *seq_header_buffer;
|
||||||
|
|
||||||
guint64 last_granulepos;
|
guint64 last_granulepos;
|
||||||
|
@ -108,8 +107,7 @@ static gboolean gst_schro_enc_set_format (GstBaseVideoEncoder *
|
||||||
base_video_encoder, GstVideoState * state);
|
base_video_encoder, GstVideoState * state);
|
||||||
static gboolean gst_schro_enc_start (GstBaseVideoEncoder * base_video_encoder);
|
static gboolean gst_schro_enc_start (GstBaseVideoEncoder * base_video_encoder);
|
||||||
static gboolean gst_schro_enc_stop (GstBaseVideoEncoder * base_video_encoder);
|
static gboolean gst_schro_enc_stop (GstBaseVideoEncoder * base_video_encoder);
|
||||||
static gboolean gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder,
|
static gboolean gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder);
|
||||||
GstVideoFrame * frame);
|
|
||||||
static GstFlowReturn gst_schro_enc_handle_frame (GstBaseVideoEncoder *
|
static GstFlowReturn gst_schro_enc_handle_frame (GstBaseVideoEncoder *
|
||||||
base_video_encoder, GstVideoFrame * frame);
|
base_video_encoder, GstVideoFrame * frame);
|
||||||
static GstFlowReturn gst_schro_enc_shape_output (GstBaseVideoEncoder *
|
static GstFlowReturn gst_schro_enc_shape_output (GstBaseVideoEncoder *
|
||||||
|
@ -438,15 +436,12 @@ gst_schro_enc_stop (GstBaseVideoEncoder * base_video_encoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder,
|
gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder)
|
||||||
GstVideoFrame * frame)
|
|
||||||
{
|
{
|
||||||
GstSchroEnc *schro_enc = GST_SCHRO_ENC (base_video_encoder);
|
GstSchroEnc *schro_enc = GST_SCHRO_ENC (base_video_encoder);
|
||||||
|
|
||||||
GST_DEBUG ("finish");
|
GST_DEBUG ("finish");
|
||||||
|
|
||||||
schro_enc->eos_frame = frame;
|
|
||||||
|
|
||||||
schro_encoder_end_of_stream (schro_enc->encoder);
|
schro_encoder_end_of_stream (schro_enc->encoder);
|
||||||
gst_schro_enc_process (schro_enc);
|
gst_schro_enc_process (schro_enc);
|
||||||
|
|
||||||
|
@ -661,11 +656,12 @@ gst_schro_enc_shape_output_quicktime (GstBaseVideoEncoder * base_video_encoder,
|
||||||
state = gst_base_video_encoder_get_state (base_video_encoder);
|
state = gst_base_video_encoder_get_state (base_video_encoder);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_TIMESTAMP (buf) = gst_video_state_get_timestamp (state,
|
||||||
frame->presentation_frame_number);
|
&base_video_encoder->segment, frame->presentation_frame_number);
|
||||||
GST_BUFFER_DURATION (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_DURATION (buf) = gst_video_state_get_timestamp (state,
|
||||||
|
&base_video_encoder->segment,
|
||||||
frame->presentation_frame_number + 1) - GST_BUFFER_TIMESTAMP (buf);
|
frame->presentation_frame_number + 1) - GST_BUFFER_TIMESTAMP (buf);
|
||||||
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
||||||
frame->system_frame_number);
|
&base_video_encoder->segment, frame->system_frame_number);
|
||||||
GST_BUFFER_OFFSET (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_OFFSET (buf) = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
if (frame->is_sync_point &&
|
if (frame->is_sync_point &&
|
||||||
|
@ -690,15 +686,16 @@ gst_schro_enc_shape_output_mp4 (GstBaseVideoEncoder * base_video_encoder,
|
||||||
state = gst_base_video_encoder_get_state (base_video_encoder);
|
state = gst_base_video_encoder_get_state (base_video_encoder);
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_TIMESTAMP (buf) = gst_video_state_get_timestamp (state,
|
||||||
frame->presentation_frame_number);
|
&base_video_encoder->segment, frame->presentation_frame_number);
|
||||||
GST_BUFFER_DURATION (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_DURATION (buf) = gst_video_state_get_timestamp (state,
|
||||||
|
&base_video_encoder->segment,
|
||||||
frame->presentation_frame_number + 1) - GST_BUFFER_TIMESTAMP (buf);
|
frame->presentation_frame_number + 1) - GST_BUFFER_TIMESTAMP (buf);
|
||||||
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
||||||
frame->decode_frame_number);
|
&base_video_encoder->segment, frame->decode_frame_number);
|
||||||
GST_BUFFER_OFFSET (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_OFFSET (buf) = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
||||||
frame->system_frame_number);
|
&base_video_encoder->segment, frame->system_frame_number);
|
||||||
|
|
||||||
if (frame->is_sync_point &&
|
if (frame->is_sync_point &&
|
||||||
frame->presentation_frame_number == frame->system_frame_number) {
|
frame->presentation_frame_number == frame->system_frame_number) {
|
||||||
|
@ -782,7 +779,8 @@ gst_schro_enc_process (GstSchroEnc * schro_enc)
|
||||||
|
|
||||||
if (voidptr == NULL) {
|
if (voidptr == NULL) {
|
||||||
GST_DEBUG ("got eos");
|
GST_DEBUG ("got eos");
|
||||||
frame = schro_enc->eos_frame;
|
//frame = schro_enc->eos_frame;
|
||||||
|
frame = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SCHRO_PARSE_CODE_IS_SEQ_HEADER (encoded_buffer->data[4])) {
|
if (SCHRO_PARSE_CODE_IS_SEQ_HEADER (encoded_buffer->data[4])) {
|
||||||
|
|
|
@ -472,7 +472,7 @@ gst_schro_parse_shape_output_quicktime (GstBaseVideoParse * base_video_parse,
|
||||||
state = gst_base_video_parse_get_state (base_video_parse);
|
state = gst_base_video_parse_get_state (base_video_parse);
|
||||||
|
|
||||||
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
GST_BUFFER_OFFSET_END (buf) = gst_video_state_get_timestamp (state,
|
||||||
frame->system_frame_number);
|
&base_video_parse->segment, frame->system_frame_number);
|
||||||
|
|
||||||
if (frame->is_sync_point &&
|
if (frame->is_sync_point &&
|
||||||
frame->presentation_frame_number == frame->system_frame_number) {
|
frame->presentation_frame_number == frame->system_frame_number) {
|
||||||
|
|
Loading…
Reference in a new issue