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
This commit is contained in:
Jan Schmidt 2017-03-24 11:43:06 +11:00
parent cc281e80d6
commit 2980e96a50

View file

@ -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);