From c199a560a92964091f9a9c696f5c1272f78fb201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 19 Jul 2010 15:58:20 +0200 Subject: [PATCH] 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. --- gst/playback/gstplaysink.c | 2 ++ gst/playback/gstscreenshot.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index a908c9d579..c7a90aa275 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -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")) diff --git a/gst/playback/gstscreenshot.c b/gst/playback/gstscreenshot.c index b6647becde..d3270513a2 100644 --- a/gst/playback/gstscreenshot.c +++ b/gst/playback/gstscreenshot.c @@ -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);