mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 02:58:24 +00:00
playsink: Set add-borders=true on the videoscale instances
This makes sure that we always keep the display aspect ratio and add black borders if necessary, which is usually something you want for viewing a video.
This commit is contained in:
parent
6fb91f7711
commit
c199a560a9
2 changed files with 5 additions and 0 deletions
|
@ -1266,6 +1266,8 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async,
|
|||
(_("Missing element '%s' - check your GStreamer installation."),
|
||||
"videoscale"), ("possibly a liboil version mismatch?"));
|
||||
} else {
|
||||
/* Add black borders if necessary to keep the DAR */
|
||||
g_object_set (chain->scale, "add-borders", TRUE, NULL);
|
||||
gst_bin_add (bin, chain->scale);
|
||||
if (prev) {
|
||||
if (!gst_element_link_pads (prev, "src", chain->scale, "sink"))
|
||||
|
|
|
@ -103,6 +103,9 @@ gst_play_frame_conv_convert (GstBuffer * buf, GstCaps * to_caps)
|
|||
if (pipeline == NULL)
|
||||
goto no_pipeline;
|
||||
|
||||
/* Add black borders if necessary to keep the DAR */
|
||||
g_object_set (vscale, "add-borders", TRUE, NULL);
|
||||
|
||||
GST_DEBUG ("adding elements");
|
||||
gst_bin_add_many (GST_BIN (pipeline), src, csp, vscale, sink, NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue