diff options
author | Jan Schmidt <jan@centricular.com> | 2015-05-10 18:55:16 +1000 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2015-05-30 01:33:49 +1000 |
commit | 37298354ff8ebf5e4f78ae2f324aee763ba5289d (patch) | |
tree | ca0b509f4e8b367085767fcd04b860210ac9b8cb /gst-libs/gst | |
parent | 6dabd46a2d8ec341113cb3b257bd6548442a1ea5 (diff) | |
download | gstreamer-plugins-bad-37298354ff8ebf5e4f78ae2f324aee763ba5289d.tar.gz |
videoaggregator: Add class property to disable caps scaling
Add preserve_update_caps_result boolean on the class to allow
sub-classes to disable videoaggregator removing sizes and framerate
from the update_caps() return result.
Diffstat (limited to 'gst-libs/gst')
-rw-r--r-- | gst-libs/gst/video/gstvideoaggregator.c | 16 | ||||
-rw-r--r-- | gst-libs/gst/video/gstvideoaggregator.h | 8 |
2 files changed, 17 insertions, 7 deletions
diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index 2f720f382..6c154bdfc 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 2be7eb6dc..b3c5c53e7 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]; }; |