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
38c54d65
Commit
38c54d65
authored
Nov 15, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB-XV: get visual and depth from XV adaptor rather than root window
parent
1ea1c3f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
25 deletions
+40
-25
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+40
-25
No files found.
modules/video_output/xcb/xvideo.c
View file @
38c54d65
...
...
@@ -320,6 +320,7 @@ static int Open (vlc_object_t *obj)
/* */
p_sys
->
att
=
NULL
;
p_sys
->
pool
=
NULL
;
p_sys
->
window
=
xcb_generate_id
(
conn
);
/* Cache adaptors infos */
xcb_xv_query_adaptors_reply_t
*
adaptors
=
...
...
@@ -418,14 +419,13 @@ static int Open (vlc_object_t *obj)
if
(
result
==
0
)
{
p_sys
->
port
=
port
;
found_adaptor
=
true
;
break
;
goto
grabbed_port
;
}
msg_Dbg
(
vd
,
"cannot grab port %"
PRIu32
,
port
);
}
if
(
!
found_adaptor
)
continue
;
continue
;
/* No usable port */
grabbed_port:
/* Found port - initialize selected format */
name
=
strndup
(
xcb_xv_adaptor_info_name
(
a
),
a
->
name_size
);
if
(
name
!=
NULL
)
...
...
@@ -435,6 +435,35 @@ static int Open (vlc_object_t *obj)
}
msg_Dbg
(
vd
,
"using port %"
PRIu32
,
p_sys
->
port
);
msg_Dbg
(
vd
,
"using image format 0x%"
PRIx32
,
p_sys
->
id
);
/* Look for an X11 visual, create a window */
xcb_xv_format_t
*
f
=
xcb_xv_adaptor_info_formats
(
a
);
for
(
uint_fast16_t
i
=
a
->
num_formats
;
i
>
0
;
i
--
,
f
++
)
{
const
uint32_t
mask
=
/* XCB_CW_EVENT_MASK */
XCB_EVENT_MASK_VISIBILITY_CHANGE
;
xcb_void_cookie_t
c
;
c
=
xcb_create_window_checked
(
conn
,
f
->
depth
,
p_sys
->
window
,
p_sys
->
embed
->
handle
.
xid
,
0
,
0
,
1
,
1
,
0
,
XCB_WINDOW_CLASS_INPUT_OUTPUT
,
f
->
visual
,
XCB_CW_EVENT_MASK
,
&
mask
);
if
(
!
CheckError
(
vd
,
conn
,
"cannot create X11 window"
,
c
))
{
msg_Dbg
(
vd
,
"using X11 visual ID 0x%"
PRIx32
" (depth: %"
PRIu8
")"
,
f
->
visual
,
f
->
depth
);
msg_Dbg
(
vd
,
"using X11 window 0x%08"
PRIx32
,
p_sys
->
window
);
goto
created_window
;
}
}
xcb_xv_ungrab_port
(
conn
,
p_sys
->
port
,
XCB_CURRENT_TIME
);
continue
;
/* No workable XVideo format (visual/depth) */
created_window:
found_adaptor
=
true
;
break
;
}
free
(
adaptors
);
if
(
!
found_adaptor
)
...
...
@@ -442,25 +471,9 @@ static int Open (vlc_object_t *obj)
msg_Err
(
vd
,
"no available XVideo adaptor"
);
goto
error
;
}
/* Create window */
else
{
const
uint32_t
mask
=
/* XCB_CW_EVENT_MASK */
XCB_EVENT_MASK_VISIBILITY_CHANGE
;
xcb_void_cookie_t
c
;
xcb_window_t
window
=
xcb_generate_id
(
conn
);
c
=
xcb_create_window_checked
(
conn
,
screen
->
root_depth
,
window
,
p_sys
->
embed
->
handle
.
xid
,
0
,
0
,
1
,
1
,
0
,
XCB_WINDOW_CLASS_INPUT_OUTPUT
,
screen
->
root_visual
,
XCB_CW_EVENT_MASK
,
&
mask
);
if
(
CheckError
(
vd
,
conn
,
"cannot create X11 window"
,
c
))
goto
error
;
p_sys
->
window
=
window
;
msg_Dbg
(
vd
,
"using X11 window 0x%08"
PRIx32
,
window
);
xcb_map_window
(
conn
,
window
);
xcb_map_window
(
conn
,
p_sys
->
window
);
vout_display_place_t
place
;
...
...
@@ -469,10 +482,12 @@ static int Open (vlc_object_t *obj)
p_sys
->
height
=
place
.
height
;
/* */
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
place
.
width
,
place
.
height
};
xcb_configure_window
(
conn
,
window
,
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
place
.
width
,
place
.
height
};
xcb_configure_window
(
conn
,
p_sys
->
window
,
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
);
}
p_sys
->
visible
=
false
;
...
...
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