Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
249986fc
Commit
249986fc
authored
Dec 07, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB outputs: use X11 display specified by the window provider
parent
93870103
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
40 deletions
+29
-40
modules/video_output/xcb/common.c
modules/video_output/xcb/common.c
+15
-7
modules/video_output/xcb/x11.c
modules/video_output/xcb/x11.c
+3
-12
modules/video_output/xcb/xcb_vlc.h
modules/video_output/xcb/xcb_vlc.h
+1
-2
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+10
-19
No files found.
modules/video_output/xcb/common.c
View file @
249986fc
...
...
@@ -59,15 +59,13 @@ int CheckError (vout_display_t *vd, xcb_connection_t *conn,
/**
* Connect to the X server.
*/
xcb_connection_t
*
Connect
(
vlc_object_t
*
obj
)
static
xcb_connection_t
*
Connect
(
vlc_object_t
*
obj
,
const
char
*
display
)
{
char
*
display
=
var_CreateGetNonEmptyString
(
obj
,
"x11-display"
);
xcb_connection_t
*
conn
=
xcb_connect
(
display
,
NULL
);
free
(
display
);
if
(
xcb_connection_has_error
(
conn
)
/*== NULL*/
)
{
msg_Err
(
obj
,
"cannot connect to X server"
);
msg_Err
(
obj
,
"cannot connect to X server (%s)"
,
display
?
display
:
"default"
);
xcb_disconnect
(
conn
);
return
NULL
;
}
...
...
@@ -87,11 +85,12 @@ xcb_connection_t *Connect (vlc_object_t *obj)
/**
* Create a VLC video X window object, find the corresponding X server screen,
* 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.
*/
vout_window_t
*
GetWindow
(
vout_display_t
*
vd
,
xcb_connection_t
*
conn
,
xcb_connection_t
*
*
restrict
p
conn
,
const
xcb_screen_t
**
restrict
pscreen
,
uint8_t
*
restrict
pdepth
,
bool
*
restrict
pshm
)
...
...
@@ -111,6 +110,13 @@ vout_window_t *GetWindow (vout_display_t *vd,
msg_Err
(
vd
,
"parent window not available"
);
return
NULL
;
}
xcb_connection_t
*
conn
=
Connect
(
VLC_OBJECT
(
vd
),
wnd
->
x11_display
);
if
(
conn
==
NULL
)
{
vout_display_DeleteWindow
(
vd
,
wnd
);
return
NULL
;
}
else
{
xcb_get_geometry_reply_t
*
geo
;
...
...
@@ -178,11 +184,13 @@ vout_window_t *GetWindow (vout_display_t *vd,
free
(
r
);
}
*
pconn
=
conn
;
*
pscreen
=
screen
;
*
pshm
=
shm
;
return
wnd
;
error:
xcb_disconnect
(
conn
);
vout_display_DeleteWindow
(
vd
,
wnd
);
return
NULL
;
}
...
...
modules/video_output/xcb/x11.c
View file @
249986fc
...
...
@@ -110,21 +110,12 @@ static int Open (vlc_object_t *obj)
vd
->
sys
=
p_sys
;
p_sys
->
pool
=
NULL
;
/* Connect to X */
p_sys
->
conn
=
Connect
(
obj
);
if
(
p_sys
->
conn
==
NULL
)
{
free
(
p_sys
);
return
VLC_EGENERIC
;
}
/* Get window */
/* 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
->
embed
=
GetWindow
(
vd
,
&
p_sys
->
conn
,
&
scr
,
&
p_sys
->
depth
,
&
p_sys
->
shm
);
if
(
p_sys
->
embed
==
NULL
)
{
xcb_disconnect
(
p_sys
->
conn
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -323,9 +314,9 @@ static void Close (vlc_object_t *obj)
vout_display_sys_t
*
p_sys
=
vd
->
sys
;
ResetPictures
(
vd
);
vout_display_DeleteWindow
(
vd
,
p_sys
->
embed
);
/* colormap, window and context are garbage-collected by X */
xcb_disconnect
(
p_sys
->
conn
);
vout_display_DeleteWindow
(
vd
,
p_sys
->
embed
);
free
(
p_sys
);
}
...
...
modules/video_output/xcb/xcb_vlc.h
View file @
249986fc
...
...
@@ -38,9 +38,8 @@ void DestroyKeyHandler (key_handler_t *);
int
ProcessKeyEvent
(
key_handler_t
*
,
xcb_generic_event_t
*
);
/* common.c */
xcb_connection_t
*
Connect
(
vlc_object_t
*
obj
);
struct
vout_window_t
*
GetWindow
(
vout_display_t
*
obj
,
xcb_connection_t
*
pconn
,
xcb_connection_t
*
*
restrict
pconn
,
const
xcb_screen_t
**
restrict
pscreen
,
uint8_t
*
restrict
pdepth
,
bool
*
restrict
pshm
);
...
...
modules/video_output/xcb/xvideo.c
View file @
249986fc
...
...
@@ -306,35 +306,26 @@ static int Open (vlc_object_t *obj)
vd
->
sys
=
p_sys
;
/* Connect to X */
xcb_connection_t
*
conn
=
Connect
(
obj
);
if
(
conn
==
NULL
)
xcb_connection_t
*
conn
;
const
xcb_screen_t
*
screen
;
uint8_t
depth
;
p_sys
->
embed
=
GetWindow
(
vd
,
&
conn
,
&
screen
,
&
depth
,
&
p_sys
->
shm
);
if
(
p_sys
->
embed
==
NULL
)
{
free
(
p_sys
);
return
VLC_EGENERIC
;
}
p_sys
->
conn
=
conn
;
p_sys
->
att
=
NULL
;
p_sys
->
pool
=
NULL
;
if
(
!
CheckXVideo
(
vd
,
conn
))
{
msg_Warn
(
vd
,
"Please enable XVideo 2.2 for faster video display"
);
xcb_disconnect
(
conn
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
const
xcb_screen_t
*
screen
;
uint8_t
depth
;
p_sys
->
embed
=
GetWindow
(
vd
,
conn
,
&
screen
,
&
depth
,
&
p_sys
->
shm
);
if
(
p_sys
->
embed
==
NULL
)
{
xcb_disconnect
(
conn
);
free
(
p_sys
);
return
VLC_EGENERIC
;
goto
error
;
}
/* */
p_sys
->
att
=
NULL
;
p_sys
->
pool
=
NULL
;
p_sys
->
window
=
xcb_generate_id
(
conn
);
/* Cache adaptors infos */
...
...
@@ -571,8 +562,8 @@ static void Close (vlc_object_t *obj)
}
free
(
p_sys
->
att
);
vout_display_DeleteWindow
(
vd
,
p_sys
->
embed
);
xcb_disconnect
(
p_sys
->
conn
);
vout_display_DeleteWindow
(
vd
,
p_sys
->
embed
);
free
(
p_sys
);
}
...
...
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