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
b8bec8eb
Commit
b8bec8eb
authored
Feb 06, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLX: cache XCB connection pointer (no functional changes)
parent
a8ad08b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
modules/video_output/xcb/glx.c
modules/video_output/xcb/glx.c
+11
-16
No files found.
modules/video_output/xcb/glx.c
View file @
b8bec8eb
...
@@ -62,6 +62,7 @@ vlc_module_end ()
...
@@ -62,6 +62,7 @@ vlc_module_end ()
struct
vout_display_sys_t
struct
vout_display_sys_t
{
{
Display
*
display
;
/* Xlib instance */
Display
*
display
;
/* Xlib instance */
xcb_connection_t
*
conn
;
/**< XCB connection */
vout_window_t
*
embed
;
/* VLC window (when windowed) */
vout_window_t
*
embed
;
/* VLC window (when windowed) */
xcb_cursor_t
cursor
;
/* blank cursor */
xcb_cursor_t
cursor
;
/* blank cursor */
...
@@ -241,7 +242,8 @@ static int Open (vlc_object_t *obj)
...
@@ -241,7 +242,8 @@ static int Open (vlc_object_t *obj)
goto
error
;
goto
error
;
xcb_connection_t
*
conn
=
XGetXCBConnection
(
dpy
);
xcb_connection_t
*
conn
=
XGetXCBConnection
(
dpy
);
assert
(
conn
);
assert
(
conn
!=
NULL
);
sys
->
conn
=
conn
;
RegisterMouseEvents
(
obj
,
conn
,
sys
->
embed
->
handle
.
xid
);
RegisterMouseEvents
(
obj
,
conn
,
sys
->
embed
->
handle
.
xid
);
/* Find window parameters */
/* Find window parameters */
...
@@ -450,10 +452,9 @@ static void Close (vlc_object_t *obj)
...
@@ -450,10 +452,9 @@ static void Close (vlc_object_t *obj)
}
}
/* show the default cursor */
/* show the default cursor */
xcb_change_window_attributes
(
XGetXCBConnection
(
sys
->
display
),
xcb_change_window_attributes
(
sys
->
conn
,
sys
->
embed
->
handle
.
xid
,
sys
->
embed
->
handle
.
xid
,
XCB_CW_CURSOR
,
XCB_CW_CURSOR
,
&
(
uint32_t
)
{
XCB_CURSOR_NONE
});
&
(
uint32_t
)
{
XCB_CURSOR_NONE
});
xcb_flush
(
sys
->
conn
);
xcb_flush
(
XGetXCBConnection
(
sys
->
display
));
XCloseDisplay
(
dpy
);
XCloseDisplay
(
dpy
);
vout_display_DeleteWindow
(
vd
,
sys
->
embed
);
vout_display_DeleteWindow
(
vd
,
sys
->
embed
);
...
@@ -530,7 +531,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
...
@@ -530,7 +531,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
:
case
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
:
case
VOUT_DISPLAY_CHANGE_SOURCE_CROP
:
case
VOUT_DISPLAY_CHANGE_SOURCE_CROP
:
{
{
xcb_connection_t
*
conn
=
XGetXCBConnection
(
sys
->
display
);
const
vout_display_cfg_t
*
cfg
;
const
vout_display_cfg_t
*
cfg
;
const
video_format_t
*
source
;
const
video_format_t
*
source
;
bool
is_forced
=
false
;
bool
is_forced
=
false
;
...
@@ -565,11 +565,11 @@ static int Control (vout_display_t *vd, int query, va_list ap)
...
@@ -565,11 +565,11 @@ static int Control (vout_display_t *vd, int query, va_list ap)
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
place
.
width
,
place
.
height
,
};
place
.
width
,
place
.
height
,
};
xcb_void_cookie_t
ck
=
xcb_void_cookie_t
ck
=
xcb_configure_window_checked
(
conn
,
sys
->
window
,
xcb_configure_window_checked
(
sys
->
conn
,
sys
->
window
,
XCB_CONFIG_WINDOW_X
|
XCB_CONFIG_WINDOW_Y
XCB_CONFIG_WINDOW_X
|
XCB_CONFIG_WINDOW_Y
|
XCB_CONFIG_WINDOW_WIDTH
|
XCB_CONFIG_WINDOW_HEIGHT
,
|
XCB_CONFIG_WINDOW_WIDTH
|
XCB_CONFIG_WINDOW_HEIGHT
,
values
);
values
);
if
(
CheckError
(
vd
,
conn
,
"cannot resize X11 window"
,
ck
))
if
(
CheckError
(
vd
,
sys
->
conn
,
"cannot resize X11 window"
,
ck
))
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
glViewport
(
0
,
0
,
place
.
width
,
place
.
height
);
glViewport
(
0
,
0
,
place
.
width
,
place
.
height
);
...
@@ -579,14 +579,10 @@ static int Control (vout_display_t *vd, int query, va_list ap)
...
@@ -579,14 +579,10 @@ static int Control (vout_display_t *vd, int query, va_list ap)
/* Hide the mouse. It will be send when
/* Hide the mouse. It will be send when
* vout_display_t::info.b_hide_mouse is false */
* vout_display_t::info.b_hide_mouse is false */
case
VOUT_DISPLAY_HIDE_MOUSE
:
case
VOUT_DISPLAY_HIDE_MOUSE
:
{
xcb_change_window_attributes
(
sys
->
conn
,
sys
->
embed
->
handle
.
xid
,
xcb_connection_t
*
conn
=
XGetXCBConnection
(
sys
->
display
);
xcb_change_window_attributes
(
conn
,
sys
->
embed
->
handle
.
xid
,
XCB_CW_CURSOR
,
&
(
uint32_t
){
sys
->
cursor
});
XCB_CW_CURSOR
,
&
(
uint32_t
){
sys
->
cursor
});
xcb_flush
(
conn
);
xcb_flush
(
sys
->
conn
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
case
VOUT_DISPLAY_GET_OPENGL
:
case
VOUT_DISPLAY_GET_OPENGL
:
{
{
...
@@ -606,7 +602,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
...
@@ -606,7 +602,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
static
void
Manage
(
vout_display_t
*
vd
)
static
void
Manage
(
vout_display_t
*
vd
)
{
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
xcb_connection_t
*
conn
=
XGetXCBConnection
(
sys
->
display
);
ManageEvent
(
vd
,
conn
,
&
sys
->
visible
);
ManageEvent
(
vd
,
sys
->
conn
,
&
sys
->
visible
);
}
}
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