diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c index 29ca5d7a53..95cc352a15 100644 --- a/ext/schroedinger/gstschrodec.c +++ b/ext/schroedinger/gstschrodec.c @@ -93,9 +93,8 @@ static GstFlowReturn gst_schro_dec_parse_data (GstBaseVideoDecoder * static int gst_schro_dec_scan_for_sync (GstBaseVideoDecoder * base_video_decoder, gboolean at_eos, int offset, int n); static GstFlowReturn gst_schro_dec_handle_frame (GstBaseVideoDecoder * decoder, - GstVideoFrame * frame); -static GstFlowReturn gst_schro_dec_finish (GstBaseVideoDecoder * - base_video_decoder, GstVideoFrame * frame); + GstVideoFrame * frame, GstClockTimeDiff deadline); +static gboolean gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder); static void gst_schrodec_send_tags (GstSchroDec * schro_dec); static GstStaticPadTemplate gst_schro_dec_sink_template = @@ -269,9 +268,6 @@ error: static gboolean gst_schro_dec_start (GstBaseVideoDecoder * dec) { - if (dec->codec_data) { - GST_DEBUG_OBJECT (dec, "codec data!"); - } 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); +#if 0 if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->last_sink_timestamp)) { base_video_decoder->current_frame->presentation_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); } #endif - state = - gst_base_video_decoder_get_state (GST_BASE_VIDEO_DECODER - (schro_decoder)); + state = gst_base_video_decoder_get_state (base_video_decoder); base_video_decoder->current_frame->presentation_timestamp = gst_util_uint64_scale (granulepos_to_frame (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 { base_video_decoder->current_frame->presentation_timestamp = -1; } +#endif g_free (data); } @@ -685,7 +681,7 @@ gst_schro_dec_process (GstSchroDec * schro_dec, gboolean eos) GstFlowReturn gst_schro_dec_handle_frame (GstBaseVideoDecoder * base_video_decoder, - GstVideoFrame * frame) + GstVideoFrame * frame, GstClockTimeDiff deadline) { GstSchroDec *schro_dec; int schro_ret; @@ -710,9 +706,8 @@ gst_schro_dec_handle_frame (GstBaseVideoDecoder * base_video_decoder, return gst_schro_dec_process (schro_dec, FALSE); } -GstFlowReturn -gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder, - GstVideoFrame * frame) +gboolean +gst_schro_dec_finish (GstBaseVideoDecoder * base_video_decoder) { GstSchroDec *schro_dec; diff --git a/ext/schroedinger/gstschroenc.c b/ext/schroedinger/gstschroenc.c index c87375bcbf..f9b021584d 100644 --- a/ext/schroedinger/gstschroenc.c +++ b/ext/schroedinger/gstschroenc.c @@ -71,7 +71,6 @@ struct _GstSchroEnc /* state */ SchroEncoder *encoder; SchroVideoFormat *video_format; - GstVideoFrame *eos_frame; GstBuffer *seq_header_buffer; guint64 last_granulepos; @@ -108,8 +107,7 @@ static gboolean gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder, GstVideoState * state); 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_finish (GstBaseVideoEncoder * base_video_encoder, - GstVideoFrame * frame); +static gboolean gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder); static GstFlowReturn gst_schro_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder, GstVideoFrame * frame); static GstFlowReturn gst_schro_enc_shape_output (GstBaseVideoEncoder * @@ -438,15 +436,12 @@ gst_schro_enc_stop (GstBaseVideoEncoder * base_video_encoder) } static gboolean -gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder, - GstVideoFrame * frame) +gst_schro_enc_finish (GstBaseVideoEncoder * base_video_encoder) { GstSchroEnc *schro_enc = GST_SCHRO_ENC (base_video_encoder); GST_DEBUG ("finish"); - schro_enc->eos_frame = frame; - schro_encoder_end_of_stream (schro_enc->encoder); 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); 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, + &base_video_encoder->segment, frame->presentation_frame_number + 1) - GST_BUFFER_TIMESTAMP (buf); 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; 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); 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, + &base_video_encoder->segment, frame->presentation_frame_number + 1) - GST_BUFFER_TIMESTAMP (buf); 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_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 && frame->presentation_frame_number == frame->system_frame_number) { @@ -782,7 +779,8 @@ gst_schro_enc_process (GstSchroEnc * schro_enc) if (voidptr == NULL) { 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])) { diff --git a/ext/schroedinger/gstschroparse.c b/ext/schroedinger/gstschroparse.c index 717bb0dc00..8c51e3b20a 100644 --- a/ext/schroedinger/gstschroparse.c +++ b/ext/schroedinger/gstschroparse.c @@ -472,7 +472,7 @@ gst_schro_parse_shape_output_quicktime (GstBaseVideoParse * base_video_parse, state = gst_base_video_parse_get_state (base_video_parse); 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 && frame->presentation_frame_number == frame->system_frame_number) {