From 430cbd3a9e7de1cd3f311255f9698ff246ae3d87 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 11 Nov 2003 05:32:09 +0000 Subject: [PATCH] recreate ximage after try_set_caps suceeds Original commit message from CVS: recreate ximage after try_set_caps suceeds --- sys/ximage/ximagesink.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 9408bd7..c5b4c2b 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -396,6 +396,17 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad) "width", GST_PROPS_INT (e.xconfigure.width), "height", GST_PROPS_INT (e.xconfigure.height), "framerate", GST_PROPS_FLOAT (30))); + ximagesink->width = e.xconfigure.width; + ximagesink->height = e.xconfigure.height; + if ( (ximagesink->ximage) && + ( (ximagesink->width != ximagesink->ximage->width) || + (ximagesink->height != ximagesink->ximage->height) ) ) { + /* We renew our ximage only if size changed */ + gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage); + + ximagesink->ximage = gst_ximagesink_ximage_new (ximagesink, + ximagesink->width, ximagesink->height); + } break; case MotionNotify: /* Mouse pointer moved over our window. We send upstream -- 2.7.4