Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
7716358d
Commit
7716358d
authored
May 26, 2011
by
Sebastian Dröge
Browse files
xvimagesink: Fallback to non-XShm mode if allocating the XShm image failed
Fixes bug #630442.
parent
34ae7920
Changes
1
Hide whitespace changes
Inline
Side-by-side
sys/xvimage/xvimagesink.c
View file @
7716358d
...
...
@@ -562,16 +562,23 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps)
xvimage
->
width
,
xvimage
->
height
,
&
xvimage
->
SHMInfo
);
if
(
!
xvimage
->
xvimage
||
error_caught
)
{
g_mutex_unlock
(
xvimagesink
->
x_lock
);
/* Reset error handler */
/* Reset error flag */
error_caught
=
FALSE
;
XSetErrorHandler
(
handler
);
/* Push a
n error
*/
GST_ELEMENT_
ERROR
(
xvimagesink
,
RESOURCE
,
WRITE
,
/* Push a
warning
*/
GST_ELEMENT_
WARNING
(
xvimagesink
,
RESOURCE
,
WRITE
,
(
"Failed to create output image buffer of %dx%d pixels"
,
xvimage
->
width
,
xvimage
->
height
),
(
"could not XvShmCreateImage a %dx%d image"
,
xvimage
->
width
,
xvimage
->
height
));
goto
beach_unlocked
;
/* Retry without XShm */
xvimagesink
->
xcontext
->
use_xshm
=
FALSE
;
/* Hold X mutex again to try without XShm */
g_mutex_lock
(
xvimagesink
->
x_lock
);
goto
no_xshm
;
}
/* we have to use the returned data_size for our shm size */
...
...
@@ -680,6 +687,7 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps)
GST_DEBUG_OBJECT
(
xvimagesink
,
"XServer ShmAttached to 0x%x, id 0x%lx"
,
xvimage
->
SHMInfo
.
shmid
,
xvimage
->
SHMInfo
.
shmseg
);
}
else
no_xshm:
#endif
/* HAVE_XSHM */
{
xvimage
->
xvimage
=
XvCreateImage
(
xvimagesink
->
xcontext
->
disp
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment