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.
This commit is contained in:
Ronald S. Bultje 2005-08-04 17:32:22 +00:00
parent 306ae5611c
commit 993a705188
2 changed files with 14 additions and 12 deletions

View file

@ -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):

View 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);