Checking return value of gst_pad_try_set_caps on software scaling so if this fails we are not awaiting a different vi...

Original commit message from CVS:
Checking return value of gst_pad_try_set_caps on software scaling so if this fails we are not awaiting a different video size.
This commit is contained in:
Julien Moutte 2003-11-15 11:48:55 +00:00
parent 8b21766672
commit 9860ad3d10

View file

@ -246,12 +246,11 @@ gst_ximagesink_ximage_put (GstXImageSink *ximagesink, GstXImage *ximage)
g_return_if_fail (ximagesink != NULL);
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
g_mutex_lock (ximagesink->x_lock);
/* We center the image in the window */
x = MAX (0, (ximagesink->xwindow->width - ximage->width) / 2);
y = MAX (0, (ximagesink->xwindow->height- ximage->height) / 2);
g_mutex_lock (ximagesink->x_lock);
#ifdef HAVE_XSHM
if (ximagesink->xcontext->use_xshm)
{
@ -387,10 +386,11 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad)
if ( (ximagesink->xwindow->width != e.xconfigure.width) ||
(ximagesink->xwindow->height != e.xconfigure.height) )
{
GstPadLinkReturn r;
ximagesink->xwindow->width = e.xconfigure.width;
ximagesink->xwindow->height = e.xconfigure.height;
gst_pad_try_set_caps (ximagesink->sinkpad,
r = gst_pad_try_set_caps (ximagesink->sinkpad,
GST_CAPS_NEW ("ximagesink_ximage_caps", "video/x-raw-rgb",
"bpp", GST_PROPS_INT (ximagesink->xcontext->bpp),
"depth", GST_PROPS_INT (ximagesink->xcontext->depth),
@ -402,7 +402,8 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad)
"height", GST_PROPS_INT (e.xconfigure.height),
"framerate", GST_PROPS_FLOAT (ximagesink->framerate)));
/* We should check for _try_set_caps result */
if ( (r == GST_PAD_LINK_OK) || (r == GST_PAD_LINK_DONE) )
{
ximagesink->width = e.xconfigure.width;
ximagesink->height = e.xconfigure.height;
@ -420,6 +421,7 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad)
ximagesink->height);
}
}
}
break;
case MotionNotify:
/* Mouse pointer moved over our window. We send upstream