Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
89fa2b56
Commit
89fa2b56
authored
Sep 11, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11grab: Check for XFixes availability at runtime
parent
68211c70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
x11grab.c
libavdevice/x11grab.c
+19
-0
No files found.
libavdevice/x11grab.c
View file @
89fa2b56
...
...
@@ -168,6 +168,19 @@ static int setup_shm(AVFormatContext *s, Display *dpy, XImage **image)
return
0
;
}
static
int
setup_mouse
(
Display
*
dpy
,
int
screen
)
{
int
ev_ret
,
ev_err
;
if
(
XFixesQueryExtension
(
dpy
,
&
ev_ret
,
&
ev_err
))
{
Window
root
=
RootWindow
(
dpy
,
screen
);
XFixesSelectCursorInput
(
dpy
,
root
,
XFixesDisplayCursorNotifyMask
);
return
0
;
}
return
AVERROR
(
ENOSYS
);
}
static
int
pixfmt_from_image
(
AVFormatContext
*
s
,
XImage
*
image
,
int
*
pix_fmt
)
{
av_log
(
s
,
AV_LOG_DEBUG
,
...
...
@@ -318,6 +331,12 @@ static int x11grab_read_header(AVFormatContext *s1)
AllPlanes
,
ZPixmap
);
}
if
(
x11grab
->
draw_mouse
&&
setup_mouse
(
dpy
,
screen
)
<
0
)
{
av_log
(
s1
,
AV_LOG_WARNING
,
"XFixes not available, cannot draw the mouse cursor
\n
"
);
x11grab
->
draw_mouse
=
0
;
}
x11grab
->
frame_size
=
x11grab
->
width
*
x11grab
->
height
*
image
->
bits_per_pixel
/
8
;
x11grab
->
dpy
=
dpy
;
x11grab
->
time_base
=
(
AVRational
)
{
framerate
.
den
,
framerate
.
num
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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