mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
vaapisink: cap window size to the maximum display size.
This commit is contained in:
parent
b963ccb929
commit
990fe81fe2
1 changed files with 7 additions and 3 deletions
|
@ -442,7 +442,7 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
{
|
||||
GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
|
||||
GstStructure * const structure = gst_caps_get_structure(caps, 0);
|
||||
guint win_width, win_height;
|
||||
guint win_width, win_height, display_width, display_height;
|
||||
gint video_width, video_height, video_par_n = 1, video_par_d = 1;
|
||||
|
||||
if (!structure)
|
||||
|
@ -462,8 +462,12 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
if (!gst_vaapi_ensure_display(sink, &sink->display))
|
||||
return FALSE;
|
||||
|
||||
if (sink->fullscreen)
|
||||
gst_vaapi_display_get_size(sink->display, &win_width, &win_height);
|
||||
gst_vaapi_display_get_size(sink->display, &display_width, &display_height);
|
||||
if (sink->fullscreen ||
|
||||
video_width > display_width || video_height > display_height) {
|
||||
win_width = display_width;
|
||||
win_height = display_height;
|
||||
}
|
||||
else {
|
||||
win_width = video_width;
|
||||
win_height = video_height;
|
||||
|
|
Loading…
Reference in a new issue