mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
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:
parent
8b21766672
commit
9860ad3d10
1 changed files with 26 additions and 24 deletions
|
@ -246,12 +246,11 @@ gst_ximagesink_ximage_put (GstXImageSink *ximagesink, GstXImage *ximage)
|
||||||
g_return_if_fail (ximagesink != NULL);
|
g_return_if_fail (ximagesink != NULL);
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
||||||
|
|
||||||
g_mutex_lock (ximagesink->x_lock);
|
|
||||||
|
|
||||||
/* We center the image in the window */
|
/* We center the image in the window */
|
||||||
x = MAX (0, (ximagesink->xwindow->width - ximage->width) / 2);
|
x = MAX (0, (ximagesink->xwindow->width - ximage->width) / 2);
|
||||||
y = MAX (0, (ximagesink->xwindow->height- ximage->height) / 2);
|
y = MAX (0, (ximagesink->xwindow->height- ximage->height) / 2);
|
||||||
|
|
||||||
|
g_mutex_lock (ximagesink->x_lock);
|
||||||
#ifdef HAVE_XSHM
|
#ifdef HAVE_XSHM
|
||||||
if (ximagesink->xcontext->use_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) ||
|
if ( (ximagesink->xwindow->width != e.xconfigure.width) ||
|
||||||
(ximagesink->xwindow->height != e.xconfigure.height) )
|
(ximagesink->xwindow->height != e.xconfigure.height) )
|
||||||
{
|
{
|
||||||
|
GstPadLinkReturn r;
|
||||||
ximagesink->xwindow->width = e.xconfigure.width;
|
ximagesink->xwindow->width = e.xconfigure.width;
|
||||||
ximagesink->xwindow->height = e.xconfigure.height;
|
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",
|
GST_CAPS_NEW ("ximagesink_ximage_caps", "video/x-raw-rgb",
|
||||||
"bpp", GST_PROPS_INT (ximagesink->xcontext->bpp),
|
"bpp", GST_PROPS_INT (ximagesink->xcontext->bpp),
|
||||||
"depth", GST_PROPS_INT (ximagesink->xcontext->depth),
|
"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),
|
"height", GST_PROPS_INT (e.xconfigure.height),
|
||||||
"framerate", GST_PROPS_FLOAT (ximagesink->framerate)));
|
"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->width = e.xconfigure.width;
|
||||||
ximagesink->height = e.xconfigure.height;
|
ximagesink->height = e.xconfigure.height;
|
||||||
|
|
||||||
|
@ -420,6 +421,7 @@ gst_ximagesink_handle_xevents (GstXImageSink *ximagesink, GstPad *pad)
|
||||||
ximagesink->height);
|
ximagesink->height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
/* Mouse pointer moved over our window. We send upstream
|
/* Mouse pointer moved over our window. We send upstream
|
||||||
|
|
Loading…
Reference in a new issue