From 993a705188074ee292ae5e4c0b461e94a04b4010 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 4 Aug 2005 17:32:22 +0000 Subject: [PATCH] sys/ximage/ximagesink.c: Do not set new window sizes yet if we prepare a new buffer size for upstream renegotiation (... 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 | 11 +++++++++++ sys/ximage/ximagesink.c | 15 +++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 089ecc4a91..019c89eecb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-08-04 Ronald S. Bultje + + * 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 * sys/ximage/ximagesink.c (gst_ximagesink_renegotiate_size): diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 6303bd5314..d5d00c537e 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -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);