From 97001a886a433f369747be08df00de83f210f612 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 16 Mar 2017 11:27:47 +1100 Subject: [PATCH] videotestsrc: Publish multiview-mode info in the caps Don't allow downstream to accidentally pretend that the output is anything than a mono or single-eye left/right view. https://bugzilla.gnome.org/show_bug.cgi?id=776172 --- gst/videotestsrc/gstvideotestsrc.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index c6b520af84..af03efb2e2 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -86,11 +86,14 @@ enum }; -#define VTS_VIDEO_CAPS GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ";" \ +#define VTS_VIDEO_CAPS GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) "," \ + "multiview-mode = { mono, left, right }" \ + ";" \ "video/x-bayer, format=(string) { bggr, rggb, grbg, gbrg }, " \ "width = " GST_VIDEO_SIZE_RANGE ", " \ "height = " GST_VIDEO_SIZE_RANGE ", " \ - "framerate = " GST_VIDEO_FPS_RANGE + "framerate = " GST_VIDEO_FPS_RANGE ", " \ + "multiview-mode = { mono, left, right }" static GstStaticPadTemplate gst_video_test_src_template = @@ -491,6 +494,15 @@ gst_video_test_src_src_fixate (GstBaseSrc * bsrc, GstCaps * caps) gst_structure_set (structure, "interlace-mode", G_TYPE_STRING, "progressive", NULL); + if (gst_structure_has_field (structure, "multiview-mode")) + gst_structure_fixate_field_string (structure, "multiview-mode", + gst_video_multiview_mode_to_caps_string + (GST_VIDEO_MULTIVIEW_MODE_MONO)); + else + gst_structure_set (structure, "multiview-mode", G_TYPE_STRING, + gst_video_multiview_mode_to_caps_string (GST_VIDEO_MULTIVIEW_MODE_MONO), + NULL); + caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps); return caps;