sys/ximage/ximagesink.c: Do not set new window sizes yet if we prepare a new buffer...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 4 Aug 2005 17:32:22 +0000 (17:32 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 4 Aug 2005 17:32:22 +0000 (17:32 +0000)
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
(gst_ximagesink_renegotiate_size):
Do not set new window sizes yet if we prepare a new buffer size
for upstream renegotiation (software scaling) at some point in the
future, because this new size waqs not actually accepted yet. Once
accepted, renegotiation later on will set the new sizes just fine.
Fixes a videotestsrc ! queue ! videoscale ! ximagesink xoverlay
embedding testcase.

ChangeLog
sys/ximage/ximagesink.c

index 089ecc4..019c89e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-08-04  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put),
+       (gst_ximagesink_renegotiate_size):
+         Do not set new window sizes yet if we prepare a new buffer size
+         for upstream renegotiation (software scaling) at some point in the
+         future, because this new size waqs not actually accepted yet. Once
+         accepted, renegotiation later on will set the new sizes just fine.
+         Fixes a videotestsrc ! queue ! videoscale ! ximagesink xoverlay
+         embedding testcase.
+
 2005-08-03  Andy Wingo  <wingo@pobox.com>
 
        * sys/ximage/ximagesink.c (gst_ximagesink_renegotiate_size):
index 6303bd5..d5d00c5 100644 (file)
@@ -431,8 +431,9 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
 #ifdef HAVE_XSHM
   if (ximagesink->xcontext->use_xshm) {
     GST_LOG_OBJECT (ximagesink,
-        "XShmPutImage, src: %d, %d - dest: %d, %d, dim: %dx%d",
-        0, 0, x, y, w, h);
+        "XShmPutImage, src: %d, %d - dest: %d, %d, dim: %dx%d, win %dx%d",
+        0, 0, x, y, w, h, ximagesink->xwindow->width,
+        ximagesink->xwindow->height);
     XShmPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
         ximagesink->xwindow->gc, ximage->ximage, 0, 0, x, y, w, h, FALSE);
   } else
@@ -654,18 +655,8 @@ gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink)
 
     if (gst_pad_peer_accept_caps (GST_VIDEO_SINK_PAD (ximagesink), caps)) {
       g_mutex_lock (ximagesink->pool_lock);
-
       gst_caps_replace (&ximagesink->desired_caps, caps);
-      GST_VIDEO_SINK_WIDTH (ximagesink) = ximagesink->xwindow->width;
-      GST_VIDEO_SINK_HEIGHT (ximagesink) = ximagesink->xwindow->height;
-
       g_mutex_unlock (ximagesink->pool_lock);
-
-      if (ximagesink->ximage) {
-        GST_DEBUG_OBJECT (ximagesink, "destroying and recreating our ximage");
-        gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
-        ximagesink->ximage = NULL;
-      }
     } else {
       ximagesink->sw_scaling_failed = TRUE;
       gst_caps_unref (caps);