summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-06-15 16:33:26 +1000
committerJan Schmidt <jan@centricular.com>2015-06-19 02:04:38 +1000
commitc72abcf7823bf5d66faec8df29aa2bb508d7c4a1 (patch)
tree1099feff389d105e965a3c54b243c3e760b7ecb5
parent6f44d6710e3145946a3e1e6bf383c48add4a3b7d (diff)
asfdemux: Use gst_video_multiview_guess_half_aspect() function
Use gst_video_multiview_guess_half_aspect() to guess if frame-packed stereoscopic video is full-frame per view or not.
-rwxr-xr-xgst/asfdemux/gstasfdemux.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 61cd0c42..1205a6fe 100755
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -2501,6 +2501,7 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux,
gchar *codec_name = NULL;
gint size_left = video->size - 40;
GstBuffer *streamheader = NULL;
+ guint par_w = 1, par_h = 1;
/* Create the video pad */
name = g_strdup_printf ("video_%u", demux->num_video_streams);
@@ -2530,9 +2531,10 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux,
s = gst_asf_demux_get_metadata_for_stream (demux, id);
if (gst_structure_get_int (s, "AspectRatioX", &ax) &&
gst_structure_get_int (s, "AspectRatioY", &ay) && (ax > 0 && ay > 0)) {
+ par_w = ax;
+ par_h = ay;
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
ax, ay, NULL);
-
} else {
guint ax, ay;
/* retry with the global metadata */
@@ -2542,9 +2544,12 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux,
if (gst_structure_get_uint (s, "AspectRatioX", &ax) &&
gst_structure_get_uint (s, "AspectRatioY", &ay)) {
GST_DEBUG ("ax:%d, ay:%d", ax, ay);
- if (ax > 0 && ay > 0)
+ if (ax > 0 && ay > 0) {
+ par_w = ax;
+ par_h = ay;
gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
ax, ay, NULL);
+ }
}
}
s = gst_caps_get_structure (caps, 0);
@@ -2645,6 +2650,10 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux,
mview_mode_str = gst_video_multiview_mode_to_caps_string (mv_mode);
if (mview_mode_str != NULL) {
+ if (gst_video_multiview_guess_half_aspect (mv_mode, video->width,
+ video->height, par_w, par_h))
+ mv_flags |= GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT;
+
gst_caps_set_simple (caps,
"multiview-mode", G_TYPE_STRING, mview_mode_str,
"multiview-flags", GST_TYPE_VIDEO_MULTIVIEW_FLAGSET, mv_flags,