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
2dc30918
Commit
2dc30918
authored
Jun 10, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port panoramix to X RandR with XCB (incomplete)
parent
6cd2ef8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
10 deletions
+85
-10
configure.ac
configure.ac
+6
-4
modules/video_filter/panoramix.c
modules/video_filter/panoramix.c
+79
-6
No files found.
configure.ac
View file @
2dc30918
...
...
@@ -3915,10 +3915,6 @@ CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
AS_IF([test "${enable_x11}" != "no"], [
AC_CHECK_HEADERS(X11/Xlib.h, [
VLC_ADD_PLUGIN([panoramix])
VLC_ADD_LIBS([panoramix],[${X_LIBS} ${X_PRE_LIBS} -lX11])
VLC_ADD_CPPFLAGS([panoramix],[${X_CFLAGS}])
VLC_ADD_PLUGIN([x11])
VLC_ADD_LIBS([x11],[${X_LIBS} ${X_PRE_LIBS} -lX11])
VLC_ADD_CPPFLAGS([x11],[${X_CFLAGS}])
...
...
@@ -4098,6 +4094,12 @@ AS_IF([test "${enable_xcb}" != "no"], [
])
])
PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr], [
VLC_ADD_PLUGIN([panoramix])
VLC_ADD_LIBS([panoramix],[${XCB_RANDR_LIBS} ${XCB_LIBS}])
VLC_ADD_CFLAGS([panoramix],[${XCB_RANDR_CFLAGS} ${XCB_CFLAGS}])
], [true])
dnl xcb-utils
PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms])
...
...
modules/video_filter/panoramix.c
View file @
2dc30918
...
...
@@ -46,7 +46,8 @@
# ifdef WIN32
# include <windows.h>
# else
# include <X11/Xlib.h>
# include <xcb/xcb.h>
# include <xcb/randr.h>
# endif
#endif
...
...
@@ -336,6 +337,71 @@ static const panoramix_chroma_t p_chroma_array[] = {
{
0
,
{
0
,
},
{
0
,
},
{
0
,
0
,
0
},
false
}
};
#ifndef WIN32
/* Get the number of outputs */
static
unsigned
CountMonitors
(
vlc_object_t
*
obj
)
{
char
*
psz_display
=
var_CreateGetNonEmptyString
(
obj
,
"x11-display"
);
int
snum
;
xcb_connection_t
*
conn
=
xcb_connect
(
psz_display
,
&
snum
);
if
(
xcb_connection_has_error
(
conn
)
)
return
0
;
const
xcb_setup_t
*
setup
=
xcb_get_setup
(
conn
);
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
--
;
}
unsigned
n
=
0
;
if
(
scr
==
NULL
)
goto
error
;
xcb_randr_query_version_reply_t
*
v
=
xcb_randr_query_version_reply
(
conn
,
xcb_randr_query_version
(
conn
,
1
,
2
),
NULL
);
if
(
v
==
NULL
)
goto
error
;
msg_Dbg
(
obj
,
"using X RandR extension v%"
PRIu32
".%"
PRIu32
,
v
->
major_version
,
v
->
minor_version
);
free
(
v
);
xcb_randr_get_screen_resources_reply_t
*
r
=
xcb_randr_get_screen_resources_reply
(
conn
,
xcb_randr_get_screen_resources
(
conn
,
scr
->
root
),
NULL
);
if
(
r
==
NULL
)
goto
error
;
const
xcb_randr_output_t
*
outputs
=
xcb_randr_get_screen_resources_outputs
(
r
);
for
(
unsigned
i
=
0
;
i
<
r
->
num_outputs
;
i
++
)
{
xcb_randr_get_output_info_reply_t
*
output
=
xcb_randr_get_output_info_reply
(
conn
,
xcb_randr_get_output_info
(
conn
,
outputs
[
i
],
0
),
NULL
);
if
(
output
==
NULL
)
continue
;
/* FIXME: do not count cloned outputs multiple times */
/* XXX: what to do with UNKNOWN state connections? */
n
+=
output
->
connection
==
XCB_RANDR_CONNECTION_CONNECTED
;
free
(
output
);
}
free
(
r
);
msg_Dbg
(
obj
,
"X randr has %u outputs"
,
n
);
error:
xcb_disconnect
(
conn
);
return
n
;
}
#endif
/*****************************************************************************
* Open: allocates Wall video thread output method
*****************************************************************************
...
...
@@ -394,14 +460,21 @@ static int Open( vlc_object_t *p_this )
}
}
#else
/* TODO linux */
const
unsigned
i_monitors
=
CountMonitors
(
p_this
);
if
(
i_monitors
>
1
)
/* Find closest to square */
for
(
unsigned
w
=
1
;
(
i_monitors
/
w
)
>=
w
;
w
++
)
{
if
(
i_monitors
%
w
)
continue
;
p_sys
->
i_row
=
w
;
p_sys
->
i_col
=
i_monitors
/
w
;
}
#endif
/* By default do 2x1 */
if
(
p_sys
->
i_col
<
0
||
p_sys
->
i_row
<
0
)
{
p_sys
->
i_col
=
2
;
if
(
p_sys
->
i_row
<
0
)
p_sys
->
i_row
=
1
;
}
if
(
p_sys
->
i_col
<
0
)
p_sys
->
i_col
=
2
;
var_SetInteger
(
p_splitter
,
CFG_PREFIX
"cols"
,
p_sys
->
i_col
);
var_SetInteger
(
p_splitter
,
CFG_PREFIX
"rows"
,
p_sys
->
i_row
);
}
...
...
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