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
76da073c
Commit
76da073c
authored
Dec 12, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB: move GLX-relevant helper to non-SHM-dependent file
parent
215d5035
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
54 deletions
+54
-54
modules/video_output/xcb/common.c
modules/video_output/xcb/common.c
+0
-54
modules/video_output/xcb/events.c
modules/video_output/xcb/events.c
+54
-0
No files found.
modules/video_output/xcb/common.c
View file @
76da073c
...
...
@@ -38,24 +38,6 @@
#include "xcb_vlc.h"
/**
* Check for an error
*/
int
CheckError
(
vout_display_t
*
vd
,
xcb_connection_t
*
conn
,
const
char
*
str
,
xcb_void_cookie_t
ck
)
{
xcb_generic_error_t
*
err
;
err
=
xcb_request_check
(
conn
,
ck
);
if
(
err
)
{
msg_Err
(
vd
,
"%s: X11 error %d"
,
str
,
err
->
error_code
);
free
(
err
);
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
/**
* Connect to the X server.
*/
...
...
@@ -174,24 +156,6 @@ error:
return
NULL
;
}
/**
* Gets the size of an X window.
*/
int
GetWindowSize
(
struct
vout_window_t
*
wnd
,
xcb_connection_t
*
conn
,
unsigned
*
restrict
width
,
unsigned
*
restrict
height
)
{
xcb_get_geometry_cookie_t
ck
=
xcb_get_geometry
(
conn
,
wnd
->
xid
);
xcb_get_geometry_reply_t
*
geo
=
xcb_get_geometry_reply
(
conn
,
ck
,
NULL
);
if
(
!
geo
)
return
-
1
;
*
width
=
geo
->
width
;
*
height
=
geo
->
height
;
free
(
geo
);
return
0
;
}
/** Check MIT-SHM shared memory support */
void
CheckSHM
(
vlc_object_t
*
obj
,
xcb_connection_t
*
conn
,
bool
*
restrict
pshm
)
{
...
...
@@ -214,24 +178,6 @@ void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm)
*
pshm
=
shm
;
}
/**
* Create a blank cursor.
* Note that the pixmaps are leaked (until the X disconnection). Hence, this
* function should be called no more than once per X connection.
* @param conn XCB connection
* @param scr target XCB screen
*/
xcb_cursor_t
CreateBlankCursor
(
xcb_connection_t
*
conn
,
const
xcb_screen_t
*
scr
)
{
xcb_cursor_t
cur
=
xcb_generate_id
(
conn
);
xcb_pixmap_t
pix
=
xcb_generate_id
(
conn
);
xcb_create_pixmap
(
conn
,
1
,
pix
,
scr
->
root
,
1
,
1
);
xcb_create_cursor
(
conn
,
cur
,
pix
,
pix
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
);
return
cur
;
}
/**
* Initialize a picture buffer as shared memory, according to the video output
* format. If a attach is true, the segment is attached to
...
...
modules/video_output/xcb/events.c
View file @
76da073c
...
...
@@ -37,6 +37,60 @@
#include "xcb_vlc.h"
/**
* Check for an error
*/
int
CheckError
(
vout_display_t
*
vd
,
xcb_connection_t
*
conn
,
const
char
*
str
,
xcb_void_cookie_t
ck
)
{
xcb_generic_error_t
*
err
;
err
=
xcb_request_check
(
conn
,
ck
);
if
(
err
)
{
msg_Err
(
vd
,
"%s: X11 error %d"
,
str
,
err
->
error_code
);
free
(
err
);
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
/**
* Gets the size of an X window.
*/
int
GetWindowSize
(
struct
vout_window_t
*
wnd
,
xcb_connection_t
*
conn
,
unsigned
*
restrict
width
,
unsigned
*
restrict
height
)
{
xcb_get_geometry_cookie_t
ck
=
xcb_get_geometry
(
conn
,
wnd
->
xid
);
xcb_get_geometry_reply_t
*
geo
=
xcb_get_geometry_reply
(
conn
,
ck
,
NULL
);
if
(
!
geo
)
return
-
1
;
*
width
=
geo
->
width
;
*
height
=
geo
->
height
;
free
(
geo
);
return
0
;
}
/**
* Create a blank cursor.
* Note that the pixmaps are leaked (until the X disconnection). Hence, this
* function should be called no more than once per X connection.
* @param conn XCB connection
* @param scr target XCB screen
*/
xcb_cursor_t
CreateBlankCursor
(
xcb_connection_t
*
conn
,
const
xcb_screen_t
*
scr
)
{
xcb_cursor_t
cur
=
xcb_generate_id
(
conn
);
xcb_pixmap_t
pix
=
xcb_generate_id
(
conn
);
xcb_create_pixmap
(
conn
,
1
,
pix
,
scr
->
root
,
1
,
1
);
xcb_create_cursor
(
conn
,
cur
,
pix
,
pix
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
);
return
cur
;
}
/* NOTE: we assume no other thread will be _setting_ our video output events
* variables. Afterall, only this plugin is supposed to know when these occur.
* Otherwise, we'd var_OrInteger() and var_NandInteger() functions...
...
...
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