Commit 15f13a56 authored by Holger Kaelberer's avatar Holger Kaelberer Committed by Gwenole Beauchesne

vaapisink: recalculate render rect only if caps are negotiated.

Fix gst_vaapisink_xoverlay_set_window_handle() when it is called before
caps got negotiated. Besides, when a foreign window is provided by the
user, so should the render rect.
Signed-off-by: default avatarGwenole Beauchesne <gwenole.beauchesne@intel.com>
parent 6bca1bc6
gst-vaapi NEWS -- summary of changes. 2012-02-07
gst-vaapi NEWS -- summary of changes. 2012-04-DD
Copyright (C) 2010-2011 Splitted-Desktop Systems
Copyright (C) 2011-2012 Intel Corporation
Version 0.2.12 - DD.Apr.2012
* Recalculate render rect only if caps are negotiated (Holger Kaelberer)
Version 0.2.11 - 07.Feb.2012
* Fix build with newer GLib versions
* Fix GstPadTemplate leaks in plug-ins
......
......@@ -244,6 +244,8 @@ gst_vaapisink_destroy(GstVaapiSink *sink)
g_free(sink->display_name);
sink->display_name = NULL;
}
gst_caps_replace(&sink->caps, NULL);
}
/* Checks whether a ConfigureNotify event is in the queue */
......@@ -321,6 +323,10 @@ gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
guint num, den, display_par_n, display_par_d;
gboolean success;
/* Return success if caps are not set yet */
if (!sink->caps)
return TRUE;
GST_DEBUG("ensure render rect within %ux%u bounds", width, height);
gst_vaapi_display_get_pixel_aspect_ratio(
......@@ -482,6 +488,8 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
sink->video_par_d = video_par_d;
GST_DEBUG("video pixel-aspect-ratio %d/%d", video_par_n, video_par_d);
gst_caps_replace(&sink->caps, caps);
gst_vaapi_display_get_size(sink->display, &display_width, &display_height);
if (sink->fullscreen ||
video_width > display_width || video_height > display_height) {
......@@ -915,6 +923,7 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
static void
gst_vaapisink_init(GstVaapiSink *sink, GstVaapiSinkClass *klass)
{
sink->caps = NULL;
sink->display_name = NULL;
sink->display = NULL;
sink->window = NULL;
......
......@@ -68,6 +68,7 @@ struct _GstVaapiSink {
/*< private >*/
GstVideoSink parent_instance;
GstCaps *caps;
gchar *display_name;
GstVaapiDisplay *display;
GstVaapiWindow *window;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment