diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index 2f720f382e..6c154bdfc6 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -28,7 +28,7 @@ * biggest incoming video stream and the framerate of the fastest incoming one. * * VideoAggregator will do colorspace conversion. - * + * * Zorder for each input stream can be configured on the * #GstVideoAggregatorPad. * @@ -674,6 +674,7 @@ gst_videoaggregator_update_src_caps (GstVideoAggregator * vagg) GstCaps *caps, *peercaps, *info_caps; GstStructure *s; GstVideoInfo info; + int i; if (GST_VIDEO_INFO_FPS_N (&vagg->info) != best_fps_n || GST_VIDEO_INFO_FPS_D (&vagg->info) != best_fps_d) { @@ -711,11 +712,8 @@ gst_videoaggregator_update_src_caps (GstVideoAggregator * vagg) caps = info_caps; } - peercaps = gst_pad_peer_query_caps (agg->srcpad, NULL); - if (peercaps) { - GstCaps *tmp; - int i; - + /* If the sub-class allows it, allow size/framerate changes */ + if (!vagg_klass->preserve_update_caps_result) { s = gst_caps_get_structure (caps, 0); gst_structure_get (s, "width", G_TYPE_INT, &best_width, "height", G_TYPE_INT, &best_height, NULL); @@ -726,6 +724,12 @@ gst_videoaggregator_update_src_caps (GstVideoAggregator * vagg) "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); } + } + + peercaps = gst_pad_peer_query_caps (agg->srcpad, caps); + if (peercaps) { + GstCaps *tmp; + tmp = gst_caps_intersect (caps, peercaps); GST_DEBUG_OBJECT (vagg, "intersecting %" GST_PTR_FORMAT diff --git a/gst-libs/gst/video/gstvideoaggregator.h b/gst-libs/gst/video/gstvideoaggregator.h index 2be7eb6dc0..b3c5c53e78 100644 --- a/gst-libs/gst/video/gstvideoaggregator.h +++ b/gst-libs/gst/video/gstvideoaggregator.h @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ - + #ifndef __GST_VIDEO_AGGREGATOR_H__ #define __GST_VIDEO_AGGREGATOR_H__ @@ -86,6 +86,9 @@ struct _GstVideoAggregator * Notifies subclasses what caps format has been negotiated * @find_best_format: Optional. * Lets subclasses decide of the best common format to use. + * @preserve_update_caps_result: Sub-classes should set this to true if the return result + * of the update_caps() method should not be further modified + * by GstVideoAggregator by removing fields. **/ struct _GstVideoAggregatorClass { @@ -105,6 +108,9 @@ struct _GstVideoAggregatorClass GstCaps * downstream_caps, GstVideoInfo * best_info, gboolean * at_least_one_alpha); + + gboolean preserve_update_caps_result; + /* < private > */ gpointer _gst_reserved[GST_PADDING_LARGE]; };