Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
ffe7e8d1
Commit
ffe7e8d1
authored
Dec 10, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split MIT-SHM check out of GetWindow
parent
719ee562
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
29 deletions
+31
-29
modules/video_output/xcb/common.c
modules/video_output/xcb/common.c
+24
-23
modules/video_output/xcb/x11.c
modules/video_output/xcb/x11.c
+3
-2
modules/video_output/xcb/xcb_vlc.h
modules/video_output/xcb/xcb_vlc.h
+2
-2
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+2
-2
No files found.
modules/video_output/xcb/common.c
View file @
ffe7e8d1
...
...
@@ -86,14 +86,12 @@ static xcb_connection_t *Connect (vlc_object_t *obj, const char *display)
/**
* Create a VLC video X window object, connect to the corresponding X server,
* find the corresponding X server screen,
* and probe the MIT-SHM extension.
* find the corresponding X server screen.
*/
vout_window_t
*
GetWindow
(
vout_display_t
*
vd
,
xcb_connection_t
**
restrict
pconn
,
const
xcb_screen_t
**
restrict
pscreen
,
uint8_t
*
restrict
pdepth
,
bool
*
restrict
pshm
)
uint8_t
*
restrict
pdepth
)
{
/* Get window */
xcb_window_t
root
;
...
...
@@ -166,27 +164,8 @@ vout_window_t *GetWindow (vout_display_t *vd,
}
msg_Dbg
(
vd
,
"using screen 0x%"
PRIx32
,
root
);
/* Check MIT-SHM shared memory support */
bool
shm
=
var_CreateGetBool
(
vd
,
"x11-shm"
)
>
0
;
if
(
shm
)
{
xcb_shm_query_version_cookie_t
ck
;
xcb_shm_query_version_reply_t
*
r
;
ck
=
xcb_shm_query_version
(
conn
);
r
=
xcb_shm_query_version_reply
(
conn
,
ck
,
NULL
);
if
(
!
r
)
{
msg_Err
(
vd
,
"shared memory (MIT-SHM) not available"
);
msg_Warn
(
vd
,
"display will be slow"
);
shm
=
false
;
}
free
(
r
);
}
*
pconn
=
conn
;
*
pscreen
=
screen
;
*
pshm
=
shm
;
return
wnd
;
error:
...
...
@@ -213,6 +192,28 @@ int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
return
0
;
}
/** Check MIT-SHM shared memory support */
void
CheckSHM
(
vlc_object_t
*
obj
,
xcb_connection_t
*
conn
,
bool
*
restrict
pshm
)
{
bool
shm
=
var_CreateGetBool
(
obj
,
"x11-shm"
)
>
0
;
if
(
shm
)
{
xcb_shm_query_version_cookie_t
ck
;
xcb_shm_query_version_reply_t
*
r
;
ck
=
xcb_shm_query_version
(
conn
);
r
=
xcb_shm_query_version_reply
(
conn
,
ck
,
NULL
);
if
(
!
r
)
{
msg_Err
(
obj
,
"shared memory (MIT-SHM) not available"
);
msg_Warn
(
obj
,
"display will be slow"
);
shm
=
false
;
}
free
(
r
);
}
*
pshm
=
shm
;
}
/**
* Create a blank cursor.
* Note that the pixmaps are leaked (until the X disconnection). Hence, this
...
...
modules/video_output/xcb/x11.c
View file @
ffe7e8d1
...
...
@@ -105,8 +105,7 @@ static int Open (vlc_object_t *obj)
/* Get window, connect to X server */
const
xcb_screen_t
*
scr
;
p_sys
->
embed
=
GetWindow
(
vd
,
&
p_sys
->
conn
,
&
scr
,
&
p_sys
->
depth
,
&
p_sys
->
shm
);
p_sys
->
embed
=
GetWindow
(
vd
,
&
p_sys
->
conn
,
&
scr
,
&
p_sys
->
depth
);
if
(
p_sys
->
embed
==
NULL
)
{
free
(
p_sys
);
...
...
@@ -272,6 +271,8 @@ static int Open (vlc_object_t *obj)
p_sys
->
visible
=
false
;
CheckSHM
(
obj
,
p_sys
->
conn
,
&
p_sys
->
shm
);
/* */
vout_display_info_t
info
=
vd
->
info
;
info
.
has_pictures_invalid
=
true
;
...
...
modules/video_output/xcb/xcb_vlc.h
View file @
ffe7e8d1
...
...
@@ -41,10 +41,10 @@ int ProcessKeyEvent (key_handler_t *, xcb_generic_event_t *);
struct
vout_window_t
*
GetWindow
(
vout_display_t
*
obj
,
xcb_connection_t
**
restrict
pconn
,
const
xcb_screen_t
**
restrict
pscreen
,
uint8_t
*
restrict
pdepth
,
bool
*
restrict
pshm
);
uint8_t
*
restrict
pdepth
);
int
GetWindowSize
(
struct
vout_window_t
*
wnd
,
xcb_connection_t
*
conn
,
unsigned
*
restrict
width
,
unsigned
*
restrict
height
);
void
CheckSHM
(
vlc_object_t
*
obj
,
xcb_connection_t
*
conn
,
bool
*
restrict
pshm
);
xcb_cursor_t
CreateBlankCursor
(
xcb_connection_t
*
,
const
xcb_screen_t
*
);
int
CheckError
(
vout_display_t
*
,
xcb_connection_t
*
conn
,
...
...
modules/video_output/xcb/xvideo.c
View file @
ffe7e8d1
...
...
@@ -301,7 +301,7 @@ static int Open (vlc_object_t *obj)
xcb_connection_t
*
conn
;
const
xcb_screen_t
*
screen
;
uint8_t
depth
;
p_sys
->
embed
=
GetWindow
(
vd
,
&
conn
,
&
screen
,
&
depth
,
&
p_sys
->
shm
);
p_sys
->
embed
=
GetWindow
(
vd
,
&
conn
,
&
screen
,
&
depth
);
if
(
p_sys
->
embed
==
NULL
)
{
free
(
p_sys
);
...
...
@@ -501,7 +501,7 @@ static int Open (vlc_object_t *obj)
/* Create cursor */
p_sys
->
cursor
=
CreateBlankCursor
(
conn
,
screen
);
/* */
CheckSHM
(
obj
,
conn
,
&
p_sys
->
shm
);
/* */
vout_display_info_t
info
=
vd
->
info
;
...
...
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