Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
439eed0f
Commit
439eed0f
authored
Dec 12, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB/GLX: resize
parent
267a4bdb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
11 deletions
+56
-11
modules/video_output/xcb/glx.c
modules/video_output/xcb/glx.c
+56
-11
No files found.
modules/video_output/xcb/glx.c
View file @
439eed0f
...
...
@@ -66,6 +66,8 @@ struct vout_display_sys_t
xcb_cursor_t
cursor
;
/* blank cursor */
xcb_window_t
window
;
/* drawable X window */
xcb_window_t
glwin
;
/* GLX window */
uint16_t
width
;
/* render pixel width */
uint16_t
height
;
/* render pixel height */
bool
visible
;
/* whether to draw */
bool
v1_3
;
/* whether GLX >= 1.3 is available */
...
...
@@ -100,7 +102,8 @@ static vout_window_t *MakeWindow (vout_display_t *vd)
static
const
xcb_screen_t
*
FindWindow
(
vout_display_t
*
vd
,
xcb_connection_t
*
conn
,
unsigned
*
restrict
pnum
,
uint8_t
*
restrict
pdepth
)
unsigned
*
restrict
pnum
,
uint8_t
*
restrict
pdepth
,
uint16_t
*
restrict
pwidth
,
uint16_t
*
restrict
pheight
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
...
...
@@ -115,6 +118,8 @@ FindWindow (vout_display_t *vd, xcb_connection_t *conn,
xcb_window_t
root
=
geo
->
root
;
*
pdepth
=
geo
->
depth
;
*
pwidth
=
geo
->
width
;
*
pheight
=
geo
->
height
;
free
(
geo
);
/* Find the selected screen */
...
...
@@ -170,11 +175,6 @@ static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
uint_fast8_t
depth
,
xcb_visualid_t
vid
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
unsigned
width
,
height
;
if
(
GetWindowSize
(
sys
->
embed
,
conn
,
&
width
,
&
height
))
return
VLC_EGENERIC
;
const
uint32_t
mask
=
XCB_CW_EVENT_MASK
;
const
uint32_t
values
[]
=
{
/* XCB_CW_EVENT_MASK */
...
...
@@ -183,7 +183,8 @@ static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
xcb_void_cookie_t
cc
,
cm
;
cc
=
xcb_create_window_checked
(
conn
,
depth
,
sys
->
window
,
sys
->
embed
->
xid
,
0
,
0
,
width
,
height
,
0
,
sys
->
embed
->
xid
,
0
,
0
,
sys
->
width
,
sys
->
height
,
0
,
XCB_WINDOW_CLASS_INPUT_OUTPUT
,
vid
,
mask
,
values
);
cm
=
xcb_map_window_checked
(
conn
,
sys
->
window
);
...
...
@@ -240,7 +241,8 @@ static int Open (vlc_object_t *obj)
/* Find window parameters */
unsigned
snum
;
uint8_t
depth
;
const
xcb_screen_t
*
scr
=
FindWindow
(
vd
,
conn
,
&
snum
,
&
depth
);
const
xcb_screen_t
*
scr
=
FindWindow
(
vd
,
conn
,
&
snum
,
&
depth
,
&
sys
->
width
,
&
sys
->
height
);
if
(
scr
==
NULL
)
goto
error
;
...
...
@@ -353,7 +355,7 @@ static int Open (vlc_object_t *obj)
/* */
vout_display_SendEventFullscreen
(
vd
,
false
);
//vout_display_SendEventDisplaySize (vd, width,
height, false);
vout_display_SendEventDisplaySize
(
vd
,
sys
->
width
,
sys
->
height
,
false
);
return
VLC_SUCCESS
;
...
...
@@ -395,6 +397,7 @@ static void SwapBuffers (vout_opengl_t *gl)
{
vout_display_sys_t
*
sys
=
gl
->
sys
;
glViewport
(
0
,
0
,
sys
->
width
,
sys
->
height
);
glXSwapBuffers
(
sys
->
display
,
sys
->
glwin
);
}
...
...
@@ -452,9 +455,51 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case
VOUT_DISPLAY_CHANGE_ZOOM
:
case
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
:
case
VOUT_DISPLAY_CHANGE_SOURCE_CROP
:
msg_Err
(
vd
,
"unimplemented control request"
);
{
xcb_connection_t
*
conn
=
XGetXCBConnection
(
sys
->
display
);
const
vout_display_cfg_t
*
cfg
;
const
video_format_t
*
source
;
bool
is_forced
=
false
;
if
(
query
==
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
||
query
==
VOUT_DISPLAY_CHANGE_SOURCE_CROP
)
{
source
=
(
const
video_format_t
*
)
va_arg
(
ap
,
const
video_format_t
*
);
cfg
=
vd
->
cfg
;
}
else
{
source
=
&
vd
->
source
;
cfg
=
(
const
vout_display_cfg_t
*
)
va_arg
(
ap
,
const
vout_display_cfg_t
*
);
if
(
query
==
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
)
is_forced
=
(
bool
)
va_arg
(
ap
,
int
);
}
/* */
if
(
query
==
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
&&
is_forced
&&
(
cfg
->
display
.
width
!=
vd
->
cfg
->
display
.
width
||
cfg
->
display
.
height
!=
vd
->
cfg
->
display
.
height
)
&&
vout_window_SetSize
(
sys
->
embed
,
cfg
->
display
.
width
,
cfg
->
display
.
height
))
return
VLC_EGENERIC
;
vout_display_place_t
place
;
vout_display_PlacePicture
(
&
place
,
source
,
cfg
,
false
);
sys
->
width
=
place
.
width
;
sys
->
height
=
place
.
height
;
/* Move the picture within the window */
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
place
.
width
,
place
.
height
,
};
xcb_configure_window
(
conn
,
sys
->
window
,
XCB_CONFIG_WINDOW_X
|
XCB_CONFIG_WINDOW_Y
|
XCB_CONFIG_WINDOW_WIDTH
|
XCB_CONFIG_WINDOW_HEIGHT
,
values
);
xcb_flush
(
conn
);
return
VLC_SUCCESS
;
}
/* Hide the mouse. It will be send when
* vout_display_t::info.b_hide_mouse is false */
case
VOUT_DISPLAY_HIDE_MOUSE
:
...
...
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