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
7fe5527d
Commit
7fe5527d
authored
Dec 12, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLX: udpate view port after the X server resized the window
parent
038b3b08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
modules/video_output/xcb/glx.c
modules/video_output/xcb/glx.c
+16
-15
No files found.
modules/video_output/xcb/glx.c
View file @
7fe5527d
...
@@ -66,8 +66,6 @@ struct vout_display_sys_t
...
@@ -66,8 +66,6 @@ struct vout_display_sys_t
xcb_cursor_t
cursor
;
/* blank cursor */
xcb_cursor_t
cursor
;
/* blank cursor */
xcb_window_t
window
;
/* drawable X window */
xcb_window_t
window
;
/* drawable X window */
xcb_window_t
glwin
;
/* GLX 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
visible
;
/* whether to draw */
bool
v1_3
;
/* whether GLX >= 1.3 is available */
bool
v1_3
;
/* whether GLX >= 1.3 is available */
...
@@ -172,7 +170,8 @@ static bool CheckGLX (vout_display_t *vd, Display *dpy, bool *restrict pv13)
...
@@ -172,7 +170,8 @@ static bool CheckGLX (vout_display_t *vd, Display *dpy, bool *restrict pv13)
}
}
static
int
CreateWindow
(
vout_display_t
*
vd
,
xcb_connection_t
*
conn
,
static
int
CreateWindow
(
vout_display_t
*
vd
,
xcb_connection_t
*
conn
,
uint_fast8_t
depth
,
xcb_visualid_t
vid
)
uint_fast8_t
depth
,
xcb_visualid_t
vid
,
uint_fast16_t
width
,
uint_fast16_t
height
)
{
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
vout_display_sys_t
*
sys
=
vd
->
sys
;
const
uint32_t
mask
=
XCB_CW_EVENT_MASK
;
const
uint32_t
mask
=
XCB_CW_EVENT_MASK
;
...
@@ -184,7 +183,7 @@ static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
...
@@ -184,7 +183,7 @@ static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
cc
=
xcb_create_window_checked
(
conn
,
depth
,
sys
->
window
,
cc
=
xcb_create_window_checked
(
conn
,
depth
,
sys
->
window
,
sys
->
embed
->
xid
,
0
,
0
,
sys
->
embed
->
xid
,
0
,
0
,
sys
->
width
,
sys
->
height
,
0
,
width
,
height
,
0
,
XCB_WINDOW_CLASS_INPUT_OUTPUT
,
XCB_WINDOW_CLASS_INPUT_OUTPUT
,
vid
,
mask
,
values
);
vid
,
mask
,
values
);
cm
=
xcb_map_window_checked
(
conn
,
sys
->
window
);
cm
=
xcb_map_window_checked
(
conn
,
sys
->
window
);
...
@@ -241,8 +240,9 @@ static int Open (vlc_object_t *obj)
...
@@ -241,8 +240,9 @@ static int Open (vlc_object_t *obj)
/* Find window parameters */
/* Find window parameters */
unsigned
snum
;
unsigned
snum
;
uint8_t
depth
;
uint8_t
depth
;
uint16_t
width
,
height
;
const
xcb_screen_t
*
scr
=
FindWindow
(
vd
,
conn
,
&
snum
,
&
depth
,
const
xcb_screen_t
*
scr
=
FindWindow
(
vd
,
conn
,
&
snum
,
&
depth
,
&
sys
->
width
,
&
sys
->
height
);
&
width
,
&
height
);
if
(
scr
==
NULL
)
if
(
scr
==
NULL
)
goto
error
;
goto
error
;
...
@@ -269,7 +269,7 @@ static int Open (vlc_object_t *obj)
...
@@ -269,7 +269,7 @@ static int Open (vlc_object_t *obj)
}
}
/*XVisualInfo *vi = glXGetVisualFromFBConfig (dpy, confs[0]);*/
/*XVisualInfo *vi = glXGetVisualFromFBConfig (dpy, confs[0]);*/
CreateWindow
(
vd
,
conn
,
depth
,
0
/* ??? */
);
CreateWindow
(
vd
,
conn
,
depth
,
0
/* ??? */
,
width
,
height
);
/*XFree (vi);*/
/*XFree (vi);*/
sys
->
glwin
=
glXCreateWindow
(
dpy
,
confs
[
0
],
sys
->
window
,
NULL
);
sys
->
glwin
=
glXCreateWindow
(
dpy
,
confs
[
0
],
sys
->
window
,
NULL
);
...
@@ -311,7 +311,7 @@ static int Open (vlc_object_t *obj)
...
@@ -311,7 +311,7 @@ static int Open (vlc_object_t *obj)
}
}
msg_Dbg
(
vd
,
"using GLX visual ID 0x%"
PRIx32
,
(
uint32_t
)
vi
->
visualid
);
msg_Dbg
(
vd
,
"using GLX visual ID 0x%"
PRIx32
,
(
uint32_t
)
vi
->
visualid
);
if
(
CreateWindow
(
vd
,
conn
,
depth
,
0
/* ??? */
)
==
0
)
if
(
CreateWindow
(
vd
,
conn
,
depth
,
0
/* ??? */
,
width
,
height
)
==
0
)
sys
->
ctx
=
glXCreateContext
(
dpy
,
vi
,
0
,
True
);
sys
->
ctx
=
glXCreateContext
(
dpy
,
vi
,
0
,
True
);
XFree
(
vi
);
XFree
(
vi
);
if
(
sys
->
ctx
==
NULL
)
if
(
sys
->
ctx
==
NULL
)
...
@@ -355,7 +355,7 @@ static int Open (vlc_object_t *obj)
...
@@ -355,7 +355,7 @@ static int Open (vlc_object_t *obj)
/* */
/* */
vout_display_SendEventFullscreen
(
vd
,
false
);
vout_display_SendEventFullscreen
(
vd
,
false
);
vout_display_SendEventDisplaySize
(
vd
,
sys
->
width
,
sys
->
height
,
false
);
vout_display_SendEventDisplaySize
(
vd
,
width
,
height
,
false
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -397,7 +397,6 @@ static void SwapBuffers (vout_opengl_t *gl)
...
@@ -397,7 +397,6 @@ static void SwapBuffers (vout_opengl_t *gl)
{
{
vout_display_sys_t
*
sys
=
gl
->
sys
;
vout_display_sys_t
*
sys
=
gl
->
sys
;
glViewport
(
0
,
0
,
sys
->
width
,
sys
->
height
);
glXSwapBuffers
(
sys
->
display
,
sys
->
glwin
);
glXSwapBuffers
(
sys
->
display
,
sys
->
glwin
);
}
}
...
@@ -486,17 +485,19 @@ static int Control (vout_display_t *vd, int query, va_list ap)
...
@@ -486,17 +485,19 @@ static int Control (vout_display_t *vd, int query, va_list ap)
vout_display_place_t
place
;
vout_display_place_t
place
;
vout_display_PlacePicture
(
&
place
,
source
,
cfg
,
false
);
vout_display_PlacePicture
(
&
place
,
source
,
cfg
,
false
);
sys
->
width
=
place
.
width
;
sys
->
height
=
place
.
height
;
/* Move the picture within the window */
/* Move the picture within the window */
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
const
uint32_t
values
[]
=
{
place
.
x
,
place
.
y
,
place
.
width
,
place
.
height
,
};
place
.
width
,
place
.
height
,
};
xcb_configure_window
(
conn
,
sys
->
window
,
xcb_void_cookie_t
ck
=
XCB_CONFIG_WINDOW_X
|
XCB_CONFIG_WINDOW_Y
xcb_configure_window_checked
(
conn
,
sys
->
window
,
|
XCB_CONFIG_WINDOW_WIDTH
|
XCB_CONFIG_WINDOW_HEIGHT
,
XCB_CONFIG_WINDOW_X
|
XCB_CONFIG_WINDOW_Y
|
XCB_CONFIG_WINDOW_WIDTH
|
XCB_CONFIG_WINDOW_HEIGHT
,
values
);
values
);
xcb_flush
(
conn
);
if
(
CheckError
(
vd
,
conn
,
"cannot resize X11 window"
,
ck
))
return
VLC_EGENERIC
;
glViewport
(
0
,
0
,
place
.
width
,
place
.
height
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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