Fix upscaling in foreign window (Totem).
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Tue, 18 May 2010 11:22:54 +0000 (11:22 +0000)
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Mon, 20 Sep 2010 10:55:47 +0000 (12:55 +0200)
gst/vaapisink/gstvaapisink.c
gst/vaapisink/gstvaapisink.h

index b944ee6..088999a 100644 (file)
@@ -136,6 +136,7 @@ gst_vaapisink_xoverlay_set_xid(GstXOverlay *overlay, XID xid)
        window. It's pretty much useless */
     sink->use_glx = FALSE;
 
+    sink->foreign_window = TRUE;
     gst_vaapisink_ensure_window_xid(sink, xid);
 }
 
@@ -303,7 +304,7 @@ gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
     display_ratio = (gdouble)display_rect->width / display_rect->height;
     GST_DEBUG("scaling to %ux%u", display_rect->width, display_rect->height);
 
-    if (sink->fullscreen ||
+    if (sink->fullscreen || sink->foreign_window ||
         display_rect->width > width || display_rect->height > height) {
         if (sink->video_width > sink->video_height) {
             display_rect->width  = width;
@@ -883,6 +884,7 @@ gst_vaapisink_init(GstVaapiSink *sink, GstVaapiSinkClass *klass)
     sink->video_height   = 0;
     sink->video_par_n    = 1;
     sink->video_par_d    = 1;
+    sink->foreign_window = FALSE;
     sink->fullscreen     = FALSE;
     sink->synchronous    = FALSE;
     sink->use_glx        = USE_VAAPISINK_GLX;
index 848c148..1a9014b 100644 (file)
@@ -77,6 +77,7 @@ struct _GstVaapiSink {
     gint                video_par_n;
     gint                video_par_d;
     GstVaapiRectangle   display_rect;
+    guint               foreign_window  : 1;
     guint               fullscreen      : 1;
     guint               synchronous     : 1;
     guint               use_glx         : 1;