Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
6146d360
Commit
6146d360
authored
Sep 30, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB/XVideo: enumerate adaptors
parent
45ab9b93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+77
-0
No files found.
modules/video_output/xcb/xvideo.c
View file @
6146d360
...
...
@@ -52,6 +52,7 @@
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
int
EnumAdaptors
(
vlc_object_t
*
,
const
char
*
,
int64_t
**
,
char
***
);
/*
* Module descriptor
...
...
@@ -66,6 +67,7 @@ vlc_module_begin ()
add_integer
(
"xvideo-adaptor"
,
-
1
,
ADAPTOR_TEXT
,
ADAPTOR_LONGTEXT
,
true
)
change_integer_cb
(
EnumAdaptors
)
add_integer
(
"xvideo-format-id"
,
0
,
FORMAT_TEXT
,
FORMAT_LONGTEXT
,
true
)
add_obsolete_bool
(
"xvideo-shm"
)
/* removed in 2.0.0 */
...
...
@@ -847,3 +849,78 @@ static void Manage (vout_display_t *vd)
ManageEvent
(
vd
,
p_sys
->
conn
,
&
p_sys
->
visible
);
}
static
int
EnumAdaptors
(
vlc_object_t
*
obj
,
const
char
*
var
,
int64_t
**
vp
,
char
***
tp
)
{
size_t
n
=
0
;
/* Connect to X */
char
*
display
=
var_InheritString
(
obj
,
"x11-display"
);
xcb_connection_t
*
conn
;
int
snum
;
conn
=
xcb_connect
(
display
,
&
snum
);
free
(
display
);
if
(
xcb_connection_has_error
(
conn
)
/*== NULL*/
)
goto
error
;
/* Find configured screen */
const
xcb_setup_t
*
setup
=
xcb_get_setup
(
conn
);
const
xcb_screen_t
*
scr
=
NULL
;
for
(
xcb_screen_iterator_t
i
=
xcb_setup_roots_iterator
(
setup
);
i
.
rem
>
0
;
xcb_screen_next
(
&
i
))
{
if
(
snum
==
0
)
{
scr
=
i
.
data
;
break
;
}
snum
--
;
}
if
(
scr
==
NULL
)
goto
error
;
xcb_xv_query_adaptors_reply_t
*
adaptors
=
xcb_xv_query_adaptors_reply
(
conn
,
xcb_xv_query_adaptors
(
conn
,
scr
->
root
),
NULL
);
if
(
adaptors
==
NULL
)
goto
error
;
xcb_xv_adaptor_info_iterator_t
it
;
for
(
it
=
xcb_xv_query_adaptors_info_iterator
(
adaptors
);
it
.
rem
>
0
;
xcb_xv_adaptor_info_next
(
&
it
))
n
++
;
int64_t
*
values
=
xmalloc
((
n
+
1
)
*
sizeof
(
*
values
));
char
**
texts
=
xmalloc
((
n
+
1
)
*
sizeof
(
*
texts
));
*
vp
=
values
;
*
tp
=
texts
;
n
=
0
;
*
(
values
++
)
=
-
1
;
*
(
texts
++
)
=
strdup
(
N_
(
"Auto"
));
n
++
;
for
(
it
=
xcb_xv_query_adaptors_info_iterator
(
adaptors
);
it
.
rem
>
0
;
xcb_xv_adaptor_info_next
(
&
it
))
{
const
xcb_xv_adaptor_info_t
*
a
=
it
.
data
;
n
++
;
if
(
!
(
a
->
type
&
XCB_XV_TYPE_INPUT_MASK
)
||
!
(
a
->
type
&
XCB_XV_TYPE_IMAGE_MASK
))
continue
;
*
(
values
++
)
=
n
-
2
;
*
(
texts
++
)
=
strndup
(
xcb_xv_adaptor_info_name
(
a
),
a
->
name_size
);
}
free
(
adaptors
);
error:
xcb_disconnect
(
conn
);
(
void
)
obj
;
(
void
)
var
;
return
n
;
}
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