Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
3c0a0661
Commit
3c0a0661
authored
Oct 05, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wayland/shm: reorient the video in the compositor
parent
e73f49e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
modules/video_output/wl/shm.c
modules/video_output/wl/shm.c
+29
-6
No files found.
modules/video_output/wl/shm.c
View file @
3c0a0661
...
...
@@ -56,6 +56,7 @@ struct vout_display_sys_t
int
x
;
int
y
;
bool
use_buffer_transform
;
};
static
void
PictureDestroy
(
picture_t
*
pic
)
...
...
@@ -378,6 +379,9 @@ static void registry_global_cb(void *data, struct wl_registry *registry,
if
(
!
strcmp
(
iface
,
"wl_scaler"
))
sys
->
scaler
=
wl_registry_bind
(
registry
,
name
,
&
wl_scaler_interface
,
1
);
else
if
(
!
strcmp
(
iface
,
"wl_compositor"
))
sys
->
use_buffer_transform
=
vers
>=
2
;
}
static
void
registry_global_remove_cb
(
void
*
data
,
struct
wl_registry
*
registry
,
...
...
@@ -410,6 +414,7 @@ static int Open(vlc_object_t *obj)
sys
->
pool
=
NULL
;
sys
->
x
=
0
;
sys
->
y
=
0
;
sys
->
use_buffer_transform
=
false
;
/* Get window */
vout_window_cfg_t
wcfg
=
{
...
...
@@ -442,22 +447,40 @@ static int Open(vlc_object_t *obj)
wl_shm_add_listener
(
sys
->
shm
,
&
shm_cbs
,
vd
);
wl_display_roundtrip_queue
(
display
,
sys
->
eventq
);
struct
wl_surface
*
surface
=
sys
->
embed
->
handle
.
wl
;
if
(
sys
->
scaler
!=
NULL
)
sys
->
viewport
=
wl_scaler_get_viewport
(
sys
->
scaler
,
sys
->
embed
->
handle
.
wl
);
sys
->
viewport
=
wl_scaler_get_viewport
(
sys
->
scaler
,
surface
);
else
sys
->
viewport
=
NULL
;
/* Determine our pixel format */
video_format_t
fmt_pic
;
static
const
enum
wl_output_transform
transforms
[
8
]
=
{
[
ORIENT_TOP_LEFT
]
=
WL_OUTPUT_TRANSFORM_NORMAL
,
[
ORIENT_TOP_RIGHT
]
=
WL_OUTPUT_TRANSFORM_FLIPPED
,
[
ORIENT_BOTTOM_LEFT
]
=
WL_OUTPUT_TRANSFORM_FLIPPED_180
,
[
ORIENT_BOTTOM_RIGHT
]
=
WL_OUTPUT_TRANSFORM_180
,
[
ORIENT_LEFT_TOP
]
=
WL_OUTPUT_TRANSFORM_FLIPPED_270
,
[
ORIENT_LEFT_BOTTOM
]
=
WL_OUTPUT_TRANSFORM_90
,
[
ORIENT_RIGHT_TOP
]
=
WL_OUTPUT_TRANSFORM_270
,
[
ORIENT_RIGHT_BOTTOM
]
=
WL_OUTPUT_TRANSFORM_FLIPPED_90
,
};
if
(
sys
->
use_buffer_transform
)
{
wl_surface_set_buffer_transform
(
surface
,
transforms
[
vd
->
fmt
.
orientation
]);
}
else
{
video_format_t
fmt
=
vd
->
fmt
;
video_format_ApplyRotation
(
&
vd
->
fmt
,
&
fmt
);
}
video_format_ApplyRotation
(
&
fmt_pic
,
&
vd
->
fmt
);
fmt_pic
.
i_chroma
=
VLC_CODEC_RGB32
;
vd
->
fmt
.
i_chroma
=
VLC_CODEC_RGB32
;
vd
->
info
.
has_pictures_invalid
=
sys
->
viewport
==
NULL
;
vd
->
info
.
has_event_thread
=
true
;
vd
->
fmt
=
fmt_pic
;
vd
->
pool
=
Pool
;
vd
->
prepare
=
Prepare
;
vd
->
display
=
Display
;
...
...
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