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
5174ad04
Commit
5174ad04
authored
Jul 31, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated xcb vout module to the new API.
parent
40e17c0f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
20 deletions
+62
-20
modules/video_output/xcb/common.c
modules/video_output/xcb/common.c
+11
-4
modules/video_output/xcb/window.c
modules/video_output/xcb/window.c
+13
-10
modules/video_output/xcb/x11.c
modules/video_output/xcb/x11.c
+18
-3
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+20
-3
No files found.
modules/video_output/xcb/common.c
View file @
5174ad04
...
...
@@ -35,7 +35,7 @@
#include <vlc_common.h>
#include <vlc_vout.h>
#include <vlc_window.h>
#include <vlc_
vout_
window.h>
#include "xcb_vlc.h"
...
...
@@ -69,8 +69,15 @@ vout_window_t *GetWindow (vout_thread_t *obj,
{
/* Get window */
xcb_window_t
root
;
vout_window_t
*
wnd
=
vout_RequestXWindow
(
obj
,
&
(
int
){
0
},
&
(
int
){
0
},
&
(
unsigned
){
0
},
&
(
unsigned
){
0
});
vout_window_cfg_t
wnd_cfg
;
memset
(
&
wnd_cfg
,
0
,
sizeof
(
wnd_cfg
)
);
wnd_cfg
.
type
=
VOUT_WINDOW_TYPE_XWINDOW
;
wnd_cfg
.
width
=
obj
->
i_window_width
;
wnd_cfg
.
height
=
obj
->
i_window_height
;
vout_window_t
*
wnd
=
vout_window_New
(
VLC_OBJECT
(
obj
),
NULL
,
&
wnd_cfg
);
if
(
wnd
==
NULL
)
{
msg_Err
(
obj
,
"parent window not available"
);
...
...
@@ -137,7 +144,7 @@ vout_window_t *GetWindow (vout_thread_t *obj,
return
wnd
;
error:
vout_
ReleaseWindow
(
wnd
);
vout_
window_Delete
(
wnd
);
return
NULL
;
}
...
...
modules/video_output/xcb/window.c
View file @
5174ad04
...
...
@@ -36,7 +36,7 @@ typedef xcb_atom_t Atom;
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_window.h>
#include <vlc_
vout_
window.h>
#include "xcb_vlc.h"
...
...
@@ -56,7 +56,7 @@ vlc_module_begin ()
set_description
(
N_
(
"(Experimental) XCB video window"
))
set_category
(
CAT_VIDEO
)
set_subcategory
(
SUBCAT_VIDEO_VOUT
)
set_capability
(
"
x
window"
,
10
)
set_capability
(
"
vout
window"
,
10
)
set_callbacks
(
Open
,
Close
)
add_string
(
"x11-display"
,
NULL
,
NULL
,
...
...
@@ -141,10 +141,13 @@ xcb_atom_t get_atom (xcb_connection_t *conn, xcb_intern_atom_cookie_t ck)
static
int
Open
(
vlc_object_t
*
obj
)
{
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
vout_window_sys_t
*
p_sys
=
malloc
(
sizeof
(
*
p_sys
));
xcb_generic_error_t
*
err
;
xcb_void_cookie_t
ck
;
if
(
wnd
->
cfg
->
type
!=
VOUT_WINDOW_TYPE_XWINDOW
)
return
VLC_EGENERIC
;
vout_window_sys_t
*
p_sys
=
malloc
(
sizeof
(
*
p_sys
));
if
(
p_sys
==
NULL
)
return
VLC_ENOMEM
;
...
...
@@ -187,7 +190,7 @@ static int Open (vlc_object_t *obj)
xcb_window_t
window
=
xcb_generate_id
(
conn
);
ck
=
xcb_create_window_checked
(
conn
,
scr
->
root_depth
,
window
,
scr
->
root
,
0
,
0
,
wnd
->
width
,
wnd
->
height
,
0
,
0
,
0
,
wnd
->
cfg
->
width
,
wnd
->
cfg
->
height
,
0
,
XCB_WINDOW_CLASS_INPUT_OUTPUT
,
scr
->
root_visual
,
mask
,
values
);
err
=
xcb_request_check
(
conn
,
ck
);
...
...
@@ -198,8 +201,8 @@ static int Open (vlc_object_t *obj)
}
wnd
->
handle
.
xid
=
window
;
wnd
->
p_sys
=
p_sys
;
wnd
->
control
=
Control
;
wnd
->
sys
=
p_sys
;
p_sys
->
conn
=
conn
;
p_sys
->
keys
=
CreateKeyHandler
(
obj
,
conn
);
...
...
@@ -273,7 +276,7 @@ error:
static
void
Close
(
vlc_object_t
*
obj
)
{
vout_window_t
*
wnd
=
(
vout_window_t
*
)
obj
;
vout_window_sys_t
*
p_sys
=
wnd
->
p_
sys
;
vout_window_sys_t
*
p_sys
=
wnd
->
sys
;
xcb_connection_t
*
conn
=
p_sys
->
conn
;
xcb_window_t
window
=
wnd
->
handle
.
xid
;
...
...
@@ -293,7 +296,7 @@ static void Close (vlc_object_t *obj)
static
void
*
Thread
(
void
*
data
)
{
vout_window_t
*
wnd
=
data
;
vout_window_sys_t
*
p_sys
=
wnd
->
p_
sys
;
vout_window_sys_t
*
p_sys
=
wnd
->
sys
;
xcb_connection_t
*
conn
=
p_sys
->
conn
;
int
fd
=
xcb_get_file_descriptor
(
conn
);
...
...
@@ -330,12 +333,12 @@ static void *Thread (void *data)
static
int
Control
(
vout_window_t
*
wnd
,
int
cmd
,
va_list
ap
)
{
vout_window_sys_t
*
p_sys
=
wnd
->
p_
sys
;
vout_window_sys_t
*
p_sys
=
wnd
->
sys
;
xcb_connection_t
*
conn
=
p_sys
->
conn
;
switch
(
cmd
)
{
case
VOUT_SET_SIZE
:
case
VOUT_
WINDOW_
SET_SIZE
:
{
unsigned
width
=
va_arg
(
ap
,
unsigned
);
unsigned
height
=
va_arg
(
ap
,
unsigned
);
...
...
@@ -348,7 +351,7 @@ static int Control (vout_window_t *wnd, int cmd, va_list ap)
break
;
}
case
VOUT_
SET_STAY
_ON_TOP
:
case
VOUT_
WINDOW_SET
_ON_TOP
:
{
/* From EWMH "_WM_STATE" */
xcb_client_message_event_t
ev
=
{
.
response_type
=
XCB_CLIENT_MESSAGE
,
...
...
modules/video_output/xcb/x11.c
View file @
5174ad04
...
...
@@ -33,7 +33,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_window.h>
#include <vlc_
vout_
window.h>
#include "xcb_vlc.h"
...
...
@@ -296,7 +296,7 @@ static void Close (vlc_object_t *obj)
vout_thread_t
*
vout
=
(
vout_thread_t
*
)
obj
;
vout_sys_t
*
p_sys
=
vout
->
p_sys
;
vout_
ReleaseWindow
(
p_sys
->
embed
);
vout_
window_Delete
(
p_sys
->
embed
);
/* colormap and window are garbage-collected by X */
xcb_disconnect
(
p_sys
->
conn
);
free
(
p_sys
);
...
...
@@ -447,5 +447,20 @@ HandleParentStructure (vout_thread_t *vout, xcb_connection_t *conn,
static
int
Control
(
vout_thread_t
*
vout
,
int
query
,
va_list
ap
)
{
return
vout_ControlWindow
(
vout
->
p_sys
->
embed
,
query
,
ap
);
switch
(
query
)
{
case
VOUT_SET_SIZE
:
{
const
unsigned
width
=
va_arg
(
ap
,
unsigned
);
const
unsigned
height
=
va_arg
(
ap
,
unsigned
);
return
vout_window_SetSize
(
vout
->
p_sys
->
embed
,
width
,
height
);
}
case
VOUT_SET_STAY_ON_TOP
:
{
const
bool
is_on_top
=
va_arg
(
ap
,
int
);
return
vout_window_SetOnTop
(
vout
->
p_sys
->
embed
,
is_on_top
);
}
default:
return
VLC_EGENERIC
;
}
}
modules/video_output/xcb/xvideo.c
View file @
5174ad04
...
...
@@ -34,7 +34,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_window.h>
#include <vlc_
vout_
window.h>
#include "xcb_vlc.h"
...
...
@@ -233,7 +233,7 @@ static void Close (vlc_object_t *obj)
vout_sys_t
*
p_sys
=
vout
->
p_sys
;
free
(
p_sys
->
adaptors
);
vout_
ReleaseWindow
(
p_sys
->
embed
);
vout_
window_Delete
(
p_sys
->
embed
);
xcb_disconnect
(
p_sys
->
conn
);
free
(
p_sys
);
}
...
...
@@ -611,5 +611,22 @@ HandleParentStructure (vout_thread_t *vout, xcb_connection_t *conn,
static
int
Control
(
vout_thread_t
*
vout
,
int
query
,
va_list
ap
)
{
return
vout_ControlWindow
(
vout
->
p_sys
->
embed
,
query
,
ap
);
/* FIXME it can be shared between x11 and xvideo */
switch
(
query
)
{
case
VOUT_SET_SIZE
:
{
const
unsigned
width
=
va_arg
(
ap
,
unsigned
);
const
unsigned
height
=
va_arg
(
ap
,
unsigned
);
return
vout_window_SetSize
(
vout
->
p_sys
->
embed
,
width
,
height
);
}
case
VOUT_SET_STAY_ON_TOP
:
{
const
bool
is_on_top
=
va_arg
(
ap
,
int
);
return
vout_window_SetOnTop
(
vout
->
p_sys
->
embed
,
is_on_top
);
}
default:
return
VLC_EGENERIC
;
}
}
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