videoparsers: use ACCEPT_INTERSECT

We can also accept caps with missing fields.
This commit is contained in:
Wim Taymans 2013-12-04 09:13:31 +01:00
parent e9dd2df3f4
commit 9ac2cee2db
7 changed files with 13 additions and 42 deletions

View file

@ -136,6 +136,7 @@ gst_dirac_parse_init (GstDiracParse * diracparse)
{ {
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (diracparse), 13); gst_base_parse_set_min_frame_size (GST_BASE_PARSE (diracparse), 13);
gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (diracparse), FALSE); gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (diracparse), FALSE);
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (diracparse));
} }
void void
@ -423,13 +424,7 @@ gst_dirac_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter)
res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
res = gst_caps_make_writable (res); gst_caps_unref (templ);
/* Append the template caps because we still want to accept
* caps without any fields in the case upstream does not
* know anything.
*/
gst_caps_append (res, templ);
} else { } else {
res = templ; res = templ;
} }

View file

@ -91,6 +91,7 @@ gst_h263_parse_class_init (GstH263ParseClass * klass)
static void static void
gst_h263_parse_init (GstH263Parse * h263parse) gst_h263_parse_init (GstH263Parse * h263parse)
{ {
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h263parse));
} }
static gboolean static gboolean
@ -397,13 +398,7 @@ gst_h263_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter)
res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
res = gst_caps_make_writable (res); gst_caps_unref (templ);
/* Append the template caps because we still want to accept
* caps without any fields in the case upstream does not
* know anything.
*/
gst_caps_append (res, templ);
} else { } else {
res = templ; res = templ;
} }

View file

@ -147,6 +147,7 @@ gst_h264_parse_init (GstH264Parse * h264parse)
{ {
h264parse->frame_out = gst_adapter_new (); h264parse->frame_out = gst_adapter_new ();
gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), FALSE); gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), FALSE);
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h264parse));
} }
@ -1931,13 +1932,7 @@ gst_h264_parse_get_caps (GstBaseParse * parse, GstCaps * filter)
res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
res = gst_caps_make_writable (res); gst_caps_unref (templ);
/* Append the template caps because we still want to accept
* caps without any fields in the case upstream does not
* know anything.
*/
gst_caps_append (res, templ);
} else { } else {
res = templ; res = templ;
} }

View file

@ -142,6 +142,7 @@ gst_h265_parse_init (GstH265Parse * h265parse)
{ {
h265parse->frame_out = gst_adapter_new (); h265parse->frame_out = gst_adapter_new ();
gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h265parse), FALSE); gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h265parse), FALSE);
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h265parse));
} }
@ -1869,13 +1870,7 @@ gst_h265_parse_get_caps (GstBaseParse * parse, GstCaps * filter)
res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
res = gst_caps_make_writable (res); gst_caps_unref (templ);
/* Append the template caps because we still want to accept
* caps without any fields in the case upstream does not
* know anything.
*/
gst_caps_append (res, templ);
} else { } else {
res = templ; res = templ;
} }

View file

@ -187,6 +187,7 @@ gst_mpeg4vparse_init (GstMpeg4VParse * parse)
parse->last_report = GST_CLOCK_TIME_NONE; parse->last_report = GST_CLOCK_TIME_NONE;
gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE); gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE);
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (parse));
} }
static void static void
@ -867,13 +868,7 @@ gst_mpeg4vparse_get_caps (GstBaseParse * parse, GstCaps * filter)
res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
res = gst_caps_make_writable (res); gst_caps_unref (templ);
/* Append the template caps because we still want to accept
* caps without any fields in the case upstream does not
* know anything.
*/
gst_caps_append (res, templ);
} else { } else {
res = templ; res = templ;
} }

View file

@ -176,6 +176,7 @@ gst_mpegv_parse_init (GstMpegvParse * parse)
parse->config_flags = FLAG_NONE; parse->config_flags = FLAG_NONE;
gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE); gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE);
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (parse));
} }
static void static void
@ -1059,13 +1060,7 @@ gst_mpegv_parse_get_caps (GstBaseParse * parse, GstCaps * filter)
res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
res = gst_caps_make_writable (res); gst_caps_unref (templ);
/* Append the template caps because we still want to accept
* caps without any fields in the case upstream does not
* know anything.
*/
gst_caps_append (res, templ);
} else { } else {
res = templ; res = templ;
} }

View file

@ -234,6 +234,7 @@ gst_vc1_parse_init (GstVC1Parse * vc1parse)
gst_base_parse_set_has_timing_info (GST_BASE_PARSE (vc1parse), FALSE); gst_base_parse_set_has_timing_info (GST_BASE_PARSE (vc1parse), FALSE);
gst_vc1_parse_reset (vc1parse); gst_vc1_parse_reset (vc1parse);
GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (vc1parse));
} }
static void static void