mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
videoparsers: chain up to parent event handler
Chain up to the parent event handler to get the default behaviour instead of returning FALSE.
This commit is contained in:
parent
eff7037447
commit
f9c99b4713
5 changed files with 77 additions and 101 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
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_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");
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
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_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);
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
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 (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);
|
||||
|
||||
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 (!all_headers)
|
||||
break;
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue