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
b53cec09
Commit
b53cec09
authored
May 07, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB/XVideo: handle scaling, crop and A/R
parent
305b0ad3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+26
-7
No files found.
modules/video_output/xcb/xvideo.c
View file @
b53cec09
...
@@ -494,7 +494,7 @@ found_adaptor:
...
@@ -494,7 +494,7 @@ found_adaptor:
vout
->
output
.
i_width
=
vout
->
fmt_out
.
i_width
=
vout
->
fmt_in
.
i_width
;
vout
->
output
.
i_width
=
vout
->
fmt_out
.
i_width
=
vout
->
fmt_in
.
i_width
;
vout
->
output
.
i_height
=
vout
->
fmt_out
.
i_height
=
vout
->
fmt_in
.
i_height
;
vout
->
output
.
i_height
=
vout
->
fmt_out
.
i_height
=
vout
->
fmt_in
.
i_height
;
vout
->
fmt_out
.
i_x_offset
=
vout
->
fmt_in
.
i_x_offset
;
vout
->
fmt_out
.
i_x_offset
=
vout
->
fmt_in
.
i_x_offset
;
p_
vout
->
fmt_out
.
i_y_offset
=
vout
->
fmt_in
.
i_y_offset
;
vout
->
fmt_out
.
i_y_offset
=
vout
->
fmt_in
.
i_y_offset
;
assert
(
height
>
0
);
assert
(
height
>
0
);
vout
->
output
.
i_aspect
=
vout
->
fmt_out
.
i_aspect
=
vout
->
output
.
i_aspect
=
vout
->
fmt_out
.
i_aspect
=
...
@@ -525,9 +525,10 @@ static void Display (vout_thread_t *vout, picture_t *pic)
...
@@ -525,9 +525,10 @@ static void Display (vout_thread_t *vout, picture_t *pic)
if
(
segment
)
if
(
segment
)
xcb_xv_shm_put_image
(
p_sys
->
conn
,
p_sys
->
port
,
p_sys
->
window
,
xcb_xv_shm_put_image
(
p_sys
->
conn
,
p_sys
->
port
,
p_sys
->
window
,
p_sys
->
gc
,
segment
,
p_sys
->
id
,
0
,
p_sys
->
gc
,
segment
,
p_sys
->
id
,
0
,
/* Src: */
0
,
0
,
/* Src: */
vout
->
fmt_out
.
i_x_offset
,
pic
->
p
->
i_visible_pitch
/
pic
->
p
->
i_pixel_pitch
,
vout
->
fmt_out
.
i_y_offset
,
pic
->
p
->
i_visible_lines
,
vout
->
fmt_out
.
i_visible_width
,
vout
->
fmt_out
.
i_visible_height
,
/* Dst: */
0
,
0
,
p_sys
->
width
,
p_sys
->
height
,
/* Dst: */
0
,
0
,
p_sys
->
width
,
p_sys
->
height
,
/* Memory: */
/* Memory: */
pic
->
p
->
i_pitch
/
pic
->
p
->
i_pixel_pitch
,
pic
->
p
->
i_pitch
/
pic
->
p
->
i_pixel_pitch
,
...
@@ -535,9 +536,9 @@ static void Display (vout_thread_t *vout, picture_t *pic)
...
@@ -535,9 +536,9 @@ static void Display (vout_thread_t *vout, picture_t *pic)
else
else
xcb_xv_put_image
(
p_sys
->
conn
,
p_sys
->
port
,
p_sys
->
window
,
xcb_xv_put_image
(
p_sys
->
conn
,
p_sys
->
port
,
p_sys
->
window
,
p_sys
->
gc
,
p_sys
->
id
,
p_sys
->
gc
,
p_sys
->
id
,
0
,
0
,
vout
->
fmt_out
.
i_x_offset
,
vout
->
fmt_out
.
i_y_offset
,
pic
->
p
->
i_visible_pitch
/
pic
->
p
->
i_pixel_pitc
h
,
vout
->
fmt_out
.
i_visible_widt
h
,
pic
->
p
->
i_visible_lines
,
vout
->
fmt_out
.
i_visible_height
,
0
,
0
,
p_sys
->
width
,
p_sys
->
height
,
0
,
0
,
p_sys
->
width
,
p_sys
->
height
,
vout
->
fmt_out
.
i_width
,
vout
->
fmt_out
.
i_height
,
vout
->
fmt_out
.
i_width
,
vout
->
fmt_out
.
i_height
,
p_sys
->
data_size
,
pic
->
p
->
p_pixels
);
p_sys
->
data_size
,
pic
->
p
->
p_pixels
);
...
@@ -560,6 +561,24 @@ static int Manage (vout_thread_t *vout)
...
@@ -560,6 +561,24 @@ static int Manage (vout_thread_t *vout)
msg_Err
(
vout
,
"X server failure"
);
msg_Err
(
vout
,
"X server failure"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
CommonManage
(
vout
);
if
(
vout
->
i_changes
&
VOUT_SIZE_CHANGE
)
{
/* TODO: factor this code with XV and X11 Init() */
unsigned
x
,
y
,
width
,
height
;
if
(
GetWindowSize
(
p_sys
->
embed
,
p_sys
->
conn
,
&
width
,
&
height
))
return
VLC_EGENERIC
;
vout_PlacePicture
(
vout
,
width
,
height
,
&
x
,
&
y
,
&
width
,
&
height
);
const
uint32_t
values
[]
=
{
x
,
y
,
width
,
height
,
};
xcb_configure_window
(
p_sys
->
conn
,
p_sys
->
window
,
XCB_CONFIG_WINDOW_X
|
XCB_CONFIG_WINDOW_Y
|
XCB_CONFIG_WINDOW_WIDTH
|
XCB_CONFIG_WINDOW_HEIGHT
,
values
);
vout
->
p_sys
->
width
=
width
;
// XXX: <-- this is useless, as the zoom is
vout
->
p_sys
->
height
=
height
;
// handled with VOUT_SET_SIZE anyway.
vout
->
i_changes
&=
~
VOUT_SIZE_CHANGE
;
}
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