summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2017-06-29 12:49:24 +0900
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-07-03 13:59:49 +0200
commit152bbb85d57af52f08ae4c6c20da9a9f02fb0760 (patch)
treed70227c36137a124b8abd938353180d640e4e3dc
parentd0054566c029286afda49f705c4554fe9a68799a (diff)
vaapipostproc: set multivew-mode flags to src caps
vaapipostproc didn't negotiate the proper multiview caps losing downstream information. This patch enables the playing of MVC encoded stream by setting the proper multiview mode/flags and views to src caps, according to sink caps. https://bugzilla.gnome.org/show_bug.cgi?id=784320
-rw-r--r--gst/vaapi/gstvaapipostprocutil.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapipostprocutil.c b/gst/vaapi/gstvaapipostprocutil.c
index 0fa474eb..4bfc169c 100644
--- a/gst/vaapi/gstvaapipostprocutil.c
+++ b/gst/vaapi/gstvaapipostprocutil.c
@@ -552,6 +552,30 @@ overflow_error:
}
static gboolean
+_set_multiview_mode (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
+ GstStructure * outs)
+{
+ const gchar *caps_str;
+
+ caps_str =
+ gst_video_multiview_mode_to_caps_string (GST_VIDEO_INFO_MULTIVIEW_MODE
+ (vinfo));
+ if (!caps_str)
+ return TRUE;
+
+ gst_structure_set (outs, "multiview-mode", G_TYPE_STRING, caps_str,
+ "multiview-flags", GST_TYPE_VIDEO_MULTIVIEW_FLAGSET,
+ GST_VIDEO_INFO_MULTIVIEW_FLAGS (vinfo), GST_FLAG_SET_MASK_EXACT, NULL);
+
+ if (GST_VIDEO_INFO_VIEWS (vinfo) > 1) {
+ gst_structure_set (outs, "views", G_TYPE_INT, GST_VIDEO_INFO_VIEWS (vinfo),
+ NULL);
+ }
+
+ return TRUE;
+}
+
+static gboolean
_set_colorimetry (GstVaapiPostproc * postproc, GstVideoFormat format,
GstStructure * outs)
{
@@ -670,6 +694,7 @@ _get_preferred_caps (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
goto fixate_failed;
if (!_fixate_frame_rate (postproc, vinfo, structure))
goto fixate_failed;
+ _set_multiview_mode (postproc, vinfo, structure);
if (f == GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY)
_set_colorimetry (postproc, format, structure);