Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
2f81dcb1
Commit
2f81dcb1
authored
May 18, 2018
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout: add thread control for display window size
parent
4f5c052c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
10 deletions
+39
-10
include/vlc_vout_wrapper.h
include/vlc_vout_wrapper.h
+1
-0
src/video_output/display.c
src/video_output/display.c
+15
-10
src/video_output/video_output.c
src/video_output/video_output.c
+21
-0
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+2
-0
No files found.
include/vlc_vout_wrapper.h
View file @
2f81dcb1
...
...
@@ -86,6 +86,7 @@ bool vout_AreDisplayPicturesInvalid(vout_display_t *);
bool
vout_ManageDisplay
(
vout_display_t
*
,
bool
allow_reset_pictures
);
void
vout_SetDisplaySize
(
vout_display_t
*
,
unsigned
width
,
unsigned
height
);
void
vout_SetDisplayFilled
(
vout_display_t
*
,
bool
is_filled
);
void
vout_SetDisplayZoom
(
vout_display_t
*
,
unsigned
num
,
unsigned
den
);
void
vout_SetDisplayAspect
(
vout_display_t
*
,
unsigned
num
,
unsigned
den
);
...
...
src/video_output/display.c
View file @
2f81dcb1
...
...
@@ -777,17 +777,9 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
#endif
/* */
if
(
ch_display_size
)
{
#if defined(_WIN32) || defined(__OS2__)
osys
->
width_saved
=
osys
->
cfg
.
display
.
width
;
osys
->
height_saved
=
osys
->
cfg
.
display
.
height
;
#endif
osys
->
cfg
.
display
.
width
=
display_width
;
osys
->
cfg
.
display
.
height
=
display_height
;
if
(
ch_display_size
)
vout_SetDisplaySize
(
vd
,
display_width
,
display_height
);
vout_display_Control
(
vd
,
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
,
&
osys
->
cfg
);
}
/* */
if
(
osys
->
is_display_filled
!=
osys
->
cfg
.
is_display_filled
)
{
osys
->
cfg
.
is_display_filled
=
osys
->
is_display_filled
;
...
...
@@ -982,6 +974,19 @@ void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t
}
}
void
vout_SetDisplaySize
(
vout_display_t
*
vd
,
unsigned
width
,
unsigned
height
)
{
vout_display_owner_sys_t
*
osys
=
vd
->
owner
.
sys
;
#if defined(_WIN32) || defined(__OS2__)
osys
->
width_saved
=
osys
->
cfg
.
display
.
width
;
osys
->
height_saved
=
osys
->
cfg
.
display
.
height
;
#endif
osys
->
cfg
.
display
.
width
=
width
;
osys
->
cfg
.
display
.
height
=
height
;
vout_display_Control
(
vd
,
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
,
&
osys
->
cfg
);
}
void
vout_SetDisplayFilled
(
vout_display_t
*
vd
,
bool
is_filled
)
{
vout_display_owner_sys_t
*
osys
=
vd
->
owner
.
sys
;
...
...
src/video_output/video_output.c
View file @
2f81dcb1
...
...
@@ -489,6 +489,18 @@ void vout_ControlChangeWindowState(vout_thread_t *vout, unsigned st)
{
vout_control_PushInteger
(
&
vout
->
p
->
control
,
VOUT_CONTROL_WINDOW_STATE
,
st
);
}
void
vout_ControlChangeDisplaySize
(
vout_thread_t
*
vout
,
unsigned
width
,
unsigned
height
)
{
vout_control_cmd_t
cmd
;
vout_control_cmd_Init
(
&
cmd
,
VOUT_CONTROL_DISPLAY_SIZE
);
cmd
.
window
.
x
=
0
;
cmd
.
window
.
y
=
0
;
cmd
.
window
.
width
=
width
;
cmd
.
window
.
height
=
height
;
vout_control_Push
(
&
vout
->
p
->
control
,
&
cmd
);
}
void
vout_ControlChangeDisplayFilled
(
vout_thread_t
*
vout
,
bool
is_filled
)
{
vout_control_PushBool
(
&
vout
->
p
->
control
,
VOUT_CONTROL_DISPLAY_FILLED
,
...
...
@@ -1396,6 +1408,12 @@ static void ThreadTranslateMouseState(vout_thread_t *vout,
vout_SendDisplayEventMouse
(
vout
,
&
vid_mouse
);
}
static
void
ThreadChangeDisplaySize
(
vout_thread_t
*
vout
,
unsigned
width
,
unsigned
height
)
{
vout_SetDisplaySize
(
vout
->
p
->
display
.
vd
,
width
,
height
);
}
static
void
ThreadChangeDisplayFilled
(
vout_thread_t
*
vout
,
bool
is_filled
)
{
vout_SetDisplayFilled
(
vout
->
p
->
display
.
vd
,
is_filled
);
...
...
@@ -1710,6 +1728,9 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
case
VOUT_CONTROL_MOUSE_STATE
:
ThreadTranslateMouseState
(
vout
,
&
cmd
.
mouse
);
break
;
case
VOUT_CONTROL_DISPLAY_SIZE
:
ThreadChangeDisplaySize
(
vout
,
cmd
.
window
.
width
,
cmd
.
window
.
height
);
break
;
case
VOUT_CONTROL_DISPLAY_FILLED
:
ThreadChangeDisplayFilled
(
vout
,
cmd
.
boolean
);
break
;
...
...
src/video_output/vout_internal.h
View file @
2f81dcb1
...
...
@@ -190,6 +190,8 @@ static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
/* TODO to move them to vlc_vout.h */
void
vout_ControlChangeFullscreen
(
vout_thread_t
*
,
bool
fullscreen
);
void
vout_ControlChangeWindowState
(
vout_thread_t
*
,
unsigned
state
);
void
vout_ControlChangeDisplaySize
(
vout_thread_t
*
,
unsigned
width
,
unsigned
height
);
void
vout_ControlChangeDisplayFilled
(
vout_thread_t
*
,
bool
is_filled
);
void
vout_ControlChangeZoom
(
vout_thread_t
*
,
int
num
,
int
den
);
void
vout_ControlChangeSampleAspectRatio
(
vout_thread_t
*
,
unsigned
num
,
unsigned
den
);
...
...
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