summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Kaelberer <holger.k@elberer.de>2012-02-07 15:21:05 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-04-02 13:45:41 +0200
commit15f13a561eb22f29e7b3ce6d8db57d2b9e071242 (patch)
tree28f87436b4f12235afd85c7deee1f32ea5c4b27e
parent6bca1bc6def78de3977ccbc269d28fabae6d7ad0 (diff)
downloadgst-vaapi-15f13a561eb22f29e7b3ce6d8db57d2b9e071242.tar.gz
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: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--NEWS5
-rw-r--r--gst/vaapi/gstvaapisink.c9
-rw-r--r--gst/vaapi/gstvaapisink.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index dc333938..41251b64 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,10 @@
-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
diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c
index 6d5b57b4..7ce1ff5f 100644
--- a/gst/vaapi/gstvaapisink.c
+++ b/gst/vaapi/gstvaapisink.c
@@ -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;
diff --git a/gst/vaapi/gstvaapisink.h b/gst/vaapi/gstvaapisink.h
index 40fb3c2f..7b8217e5 100644
--- a/gst/vaapi/gstvaapisink.h
+++ b/gst/vaapi/gstvaapisink.h
@@ -68,6 +68,7 @@ struct _GstVaapiSink {
/*< private >*/
GstVideoSink parent_instance;
+ GstCaps *caps;
gchar *display_name;
GstVaapiDisplay *display;
GstVaapiWindow *window;