diff options
-rw-r--r-- | gst/videoparsers/dirac_parse.c | 3 | ||||
-rw-r--r-- | gst/videoparsers/gstdiracparse.c | 21 | ||||
-rw-r--r-- | gst/videoparsers/gsth263parse.c | 4 | ||||
-rw-r--r-- | gst/videoparsers/gsth264parse.c | 79 | ||||
-rw-r--r-- | gst/videoparsers/gstmpeg4videoparse.c | 73 |
5 files changed, 78 insertions, 102 deletions
diff --git a/gst/videoparsers/dirac_parse.c b/gst/videoparsers/dirac_parse.c index 5b367c36c..c5dadb211 100644 --- a/gst/videoparsers/dirac_parse.c +++ b/gst/videoparsers/dirac_parse.c @@ -32,9 +32,6 @@ void schro_video_format_set_std_signal_range (DiracSequenceHeader * format, void schro_video_format_set_std_colour_spec (DiracSequenceHeader * format, int index); - - - int dirac_sequence_header_parse (DiracSequenceHeader * header, unsigned char *data, int n_bytes) diff --git a/gst/videoparsers/gstdiracparse.c b/gst/videoparsers/gstdiracparse.c index 332770061..13b874fcd 100644 --- a/gst/videoparsers/gstdiracparse.c +++ b/gst/videoparsers/gstdiracparse.c @@ -61,9 +61,6 @@ static GstFlowReturn gst_dirac_parse_handle_frame (GstBaseParse * parse, static gboolean gst_dirac_parse_convert (GstBaseParse * parse, GstFormat src_format, gint64 src_value, GstFormat dest_format, gint64 * dest_value); -static gboolean gst_dirac_parse_event (GstBaseParse * parse, GstEvent * event); -static gboolean gst_dirac_parse_src_event (GstBaseParse * parse, - GstEvent * event); static GstFlowReturn gst_dirac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame); @@ -128,8 +125,6 @@ gst_dirac_parse_class_init (GstDiracParseClass * klass) base_parse_class->handle_frame = GST_DEBUG_FUNCPTR (gst_dirac_parse_handle_frame); base_parse_class->convert = GST_DEBUG_FUNCPTR (gst_dirac_parse_convert); - base_parse_class->event = GST_DEBUG_FUNCPTR (gst_dirac_parse_event); - base_parse_class->src_event = GST_DEBUG_FUNCPTR (gst_dirac_parse_src_event); base_parse_class->pre_push_frame = GST_DEBUG_FUNCPTR (gst_dirac_parse_pre_push_frame); @@ -346,22 +341,6 @@ gst_dirac_parse_convert (GstBaseParse * parse, GstFormat src_format, return FALSE; } -static gboolean -gst_dirac_parse_event (GstBaseParse * parse, GstEvent * event) -{ - /* Sink pad event handler */ - - return FALSE; -} - -static gboolean -gst_dirac_parse_src_event (GstBaseParse * parse, GstEvent * event) -{ - /* Src pad event handler */ - - return FALSE; -} - static GstFlowReturn gst_dirac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) { diff --git a/gst/videoparsers/gsth263parse.c b/gst/videoparsers/gsth263parse.c index 3d749b2e4..a0ecb21b4 100644 --- a/gst/videoparsers/gsth263parse.c +++ b/gst/videoparsers/gsth263parse.c @@ -122,7 +122,6 @@ static gboolean gst_h263_parse_sink_event (GstBaseParse * parse, GstEvent * event) { GstH263Parse *h263parse; - gboolean res = FALSE; h263parse = GST_H263_PARSE (parse); @@ -138,12 +137,11 @@ gst_h263_parse_sink_event (GstBaseParse * parse, GstEvent * event) break; } - default: break; } - return res; + return GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); } static guint diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index c4a0ece5b..7519e97c0 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1781,7 +1781,7 @@ gst_h264_parse_get_caps (GstBaseParse * parse, GstCaps * filter) static gboolean gst_h264_parse_event (GstBaseParse * parse, GstEvent * event) { - gboolean handled = FALSE; + gboolean res; GstH264Parse *h264parse = GST_H264_PARSE (parse); switch (GST_EVENT_TYPE (event)) { @@ -1791,31 +1791,33 @@ gst_h264_parse_event (GstBaseParse * parse, GstEvent * event) gboolean all_headers; guint count; - if (!gst_video_event_is_force_key_unit (event)) - break; - - gst_video_event_parse_downstream_force_key_unit (event, - ×tamp, &stream_time, &running_time, &all_headers, &count); - - GST_INFO_OBJECT (h264parse, "received downstream force key unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT " all_headers %d count %d", - gst_event_get_seqnum (event), GST_TIME_ARGS (running_time), - all_headers, count); - handled = TRUE; - - if (h264parse->force_key_unit_event) { - GST_INFO_OBJECT (h264parse, "ignoring force key unit event " - "as one is already queued"); + if (gst_video_event_is_force_key_unit (event)) { + gst_video_event_parse_downstream_force_key_unit (event, + ×tamp, &stream_time, &running_time, &all_headers, &count); + + GST_INFO_OBJECT (h264parse, "received downstream force key unit event, " + "seqnum %d running_time %" GST_TIME_FORMAT + " all_headers %d count %d", gst_event_get_seqnum (event), + GST_TIME_ARGS (running_time), all_headers, count); + if (h264parse->force_key_unit_event) { + GST_INFO_OBJECT (h264parse, "ignoring force key unit event " + "as one is already queued"); + } else { + h264parse->pending_key_unit_ts = running_time; + gst_event_replace (&h264parse->force_key_unit_event, event); + } + res = TRUE; + } else { + res = GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); break; } - - h264parse->pending_key_unit_ts = running_time; - gst_event_replace (&h264parse->force_key_unit_event, event); break; } case GST_EVENT_FLUSH_STOP: h264parse->dts = GST_CLOCK_TIME_NONE; h264parse->ts_trn_nb = GST_CLOCK_TIME_NONE; + + res = GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); break; case GST_EVENT_SEGMENT: { @@ -1827,19 +1829,21 @@ gst_h264_parse_event (GstBaseParse * parse, GstEvent * event) (segment->start != 0 || segment->rate != 1.0 || segment->applied_rate != 1.0)) h264parse->do_ts = FALSE; + + res = GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); break; } default: + res = GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); break; } - - return handled; + return res; } static gboolean gst_h264_parse_src_event (GstBaseParse * parse, GstEvent * event) { - gboolean handled = FALSE; + gboolean res; GstH264Parse *h264parse = GST_H264_PARSE (parse); switch (GST_EVENT_TYPE (event)) { @@ -1849,30 +1853,29 @@ gst_h264_parse_src_event (GstBaseParse * parse, GstEvent * event) gboolean all_headers; guint count; - if (!gst_video_event_is_force_key_unit (event)) - break; + if (gst_video_event_is_force_key_unit (event)) { + gst_video_event_parse_upstream_force_key_unit (event, + &running_time, &all_headers, &count); - gst_video_event_parse_upstream_force_key_unit (event, - &running_time, &all_headers, &count); + GST_INFO_OBJECT (h264parse, "received upstream force-key-unit event, " + "seqnum %d running_time %" GST_TIME_FORMAT + " all_headers %d count %d", gst_event_get_seqnum (event), + GST_TIME_ARGS (running_time), all_headers, count); - GST_INFO_OBJECT (h264parse, "received upstream force-key-unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT " all_headers %d count %d", - gst_event_get_seqnum (event), GST_TIME_ARGS (running_time), - all_headers, count); - - if (!all_headers) - break; - - h264parse->pending_key_unit_ts = running_time; - gst_event_replace (&h264parse->force_key_unit_event, event); - /* leave handled = FALSE so that the event gets propagated upstream */ + if (all_headers) { + h264parse->pending_key_unit_ts = running_time; + gst_event_replace (&h264parse->force_key_unit_event, event); + } + } + res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); break; } default: + res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); break; } - return handled; + return res; } static GstFlowReturn diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c index 72bf9e65e..5f9bb027b 100644 --- a/gst/videoparsers/gstmpeg4videoparse.c +++ b/gst/videoparsers/gstmpeg4videoparse.c @@ -811,7 +811,7 @@ gst_mpeg4vparse_get_caps (GstBaseParse * parse, GstCaps * filter) static gboolean gst_mpeg4vparse_event (GstBaseParse * parse, GstEvent * event) { - gboolean handled = FALSE; + gboolean res; GstMpeg4VParse *mp4vparse = GST_MPEG4VIDEO_PARSE (parse); switch (GST_EVENT_TYPE (event)) { @@ -821,39 +821,39 @@ gst_mpeg4vparse_event (GstBaseParse * parse, GstEvent * event) gboolean all_headers; guint count; - if (!gst_video_event_is_force_key_unit (event)) - break; - - gst_video_event_parse_downstream_force_key_unit (event, - ×tamp, &stream_time, &running_time, &all_headers, &count); + if (gst_video_event_is_force_key_unit (event)) { + gst_video_event_parse_downstream_force_key_unit (event, + ×tamp, &stream_time, &running_time, &all_headers, &count); - GST_INFO_OBJECT (mp4vparse, "received downstream force key unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT " all_headers %d count %d", - gst_event_get_seqnum (event), GST_TIME_ARGS (running_time), - all_headers, count); - handled = TRUE; + GST_INFO_OBJECT (mp4vparse, "received downstream force key unit event, " + "seqnum %d running_time %" GST_TIME_FORMAT + " all_headers %d count %d", gst_event_get_seqnum (event), + GST_TIME_ARGS (running_time), all_headers, count); - if (mp4vparse->force_key_unit_event) { - GST_INFO_OBJECT (mp4vparse, "ignoring force key unit event " - "as one is already queued"); - break; + if (mp4vparse->force_key_unit_event) { + GST_INFO_OBJECT (mp4vparse, "ignoring force key unit event " + "as one is already queued"); + } else { + mp4vparse->pending_key_unit_ts = running_time; + gst_event_replace (&mp4vparse->force_key_unit_event, event); + } + res = TRUE; + } else { + res = GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); } - - mp4vparse->pending_key_unit_ts = running_time; - gst_event_replace (&mp4vparse->force_key_unit_event, event); break; } default: + res = GST_BASE_PARSE_CLASS (parent_class)->event (parse, event); break; } - - return handled; + return res; } static gboolean gst_mpeg4vparse_src_event (GstBaseParse * parse, GstEvent * event) { - gboolean handled = FALSE; + gboolean res; GstMpeg4VParse *mp4vparse = GST_MPEG4VIDEO_PARSE (parse); switch (GST_EVENT_TYPE (event)) { @@ -863,28 +863,27 @@ gst_mpeg4vparse_src_event (GstBaseParse * parse, GstEvent * event) gboolean all_headers; guint count; - if (!gst_video_event_is_force_key_unit (event)) - break; - - gst_video_event_parse_upstream_force_key_unit (event, - &running_time, &all_headers, &count); - - GST_INFO_OBJECT (mp4vparse, "received upstream force-key-unit event, " - "seqnum %d running_time %" GST_TIME_FORMAT " all_headers %d count %d", - gst_event_get_seqnum (event), GST_TIME_ARGS (running_time), - all_headers, count); + if (gst_video_event_is_force_key_unit (event)) { + gst_video_event_parse_upstream_force_key_unit (event, + &running_time, &all_headers, &count); - if (!all_headers) - break; + GST_INFO_OBJECT (mp4vparse, "received upstream force-key-unit event, " + "seqnum %d running_time %" GST_TIME_FORMAT + " all_headers %d count %d", gst_event_get_seqnum (event), + GST_TIME_ARGS (running_time), all_headers, count); - mp4vparse->pending_key_unit_ts = running_time; - gst_event_replace (&mp4vparse->force_key_unit_event, event); - /* leave handled = FALSE so that the event gets propagated upstream */ + if (all_headers) { + mp4vparse->pending_key_unit_ts = running_time; + gst_event_replace (&mp4vparse->force_key_unit_event, event); + } + } + res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); break; } default: + res = GST_BASE_PARSE_CLASS (parent_class)->src_event (parse, event); break; } - return handled; + return res; } |