From 2980e96a502886d28962f89f927f479578f6b07a Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 24 Mar 2017 11:43:06 +1100 Subject: [PATCH] videodecoder: Output mono multiview caps if none specified Always put multiview-caps onto the output caps, assuming mono if we've got no other information. It's still easy for downstream elements to override using a capssetter or event probe if desired. https://bugzilla.gnome.org/show_bug.cgi?id=776172 --- gst-libs/gst/video/gstvideodecoder.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index b91a32e79f..f748587693 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -657,6 +657,10 @@ _new_output_state (GstVideoFormat fmt, guint width, guint height, GST_VIDEO_INFO_MULTIVIEW_MODE (tgt) = GST_VIDEO_INFO_MULTIVIEW_MODE (ref); GST_VIDEO_INFO_MULTIVIEW_FLAGS (tgt) = GST_VIDEO_INFO_MULTIVIEW_FLAGS (ref); + } else { + /* Default to MONO, overridden as needed by sub-classes */ + GST_VIDEO_INFO_MULTIVIEW_MODE (tgt) = GST_VIDEO_MULTIVIEW_MODE_MONO; + GST_VIDEO_INFO_MULTIVIEW_FLAGS (tgt) = GST_VIDEO_MULTIVIEW_FLAGS_NONE; } } @@ -3786,6 +3790,16 @@ gst_video_decoder_negotiate_default (GstVideoDecoder * decoder) g_return_val_if_fail (GST_VIDEO_INFO_WIDTH (&state->info) != 0, FALSE); g_return_val_if_fail (GST_VIDEO_INFO_HEIGHT (&state->info) != 0, FALSE); + /* If the base class didn't set any multiview params, assume mono + * now */ + if (GST_VIDEO_INFO_MULTIVIEW_MODE (&state->info) == + GST_VIDEO_MULTIVIEW_MODE_NONE) { + GST_VIDEO_INFO_MULTIVIEW_MODE (&state->info) = + GST_VIDEO_MULTIVIEW_MODE_MONO; + GST_VIDEO_INFO_MULTIVIEW_FLAGS (&state->info) = + GST_VIDEO_MULTIVIEW_FLAGS_NONE; + } + GST_DEBUG_OBJECT (decoder, "output_state par %d/%d fps %d/%d", state->info.par_n, state->info.par_d, state->info.fps_n, state->info.fps_d);