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
6d62ce57
Commit
6d62ce57
authored
Oct 12, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout: request resize directly from the window rather than display
parent
07ed042d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
21 deletions
+37
-21
src/video_output/display.c
src/video_output/display.c
+17
-20
src/video_output/display.h
src/video_output/display.h
+3
-1
src/video_output/video_output.c
src/video_output/video_output.c
+17
-0
No files found.
src/video_output/display.c
View file @
6d62ce57
...
...
@@ -411,7 +411,6 @@ struct vout_display_owner_sys_t {
bool
ch_display_size
;
int
display_width
;
int
display_height
;
bool
display_is_forced
;
int
fit_window
;
...
...
@@ -708,7 +707,6 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
osys
->
ch_display_size
=
true
;
osys
->
display_width
=
width
;
osys
->
display_height
=
height
;
osys
->
display_is_forced
=
false
;
vlc_mutex_unlock
(
&
osys
->
lock
);
break
;
...
...
@@ -793,14 +791,12 @@ static void VoutDisplayFitWindow(vout_display_t *vd, bool default_size)
vout_display_GetDefaultDisplaySize
(
&
display_width
,
&
display_height
,
&
vd
->
source
,
&
cfg
);
vlc_mutex_lock
(
&
osys
->
lock
);
osys
->
ch_display_size
=
true
;
osys
->
display_width
=
display_width
;
osys
->
display_height
=
display_height
;
osys
->
display_is_forced
=
true
;
vlc_mutex_unlock
(
&
osys
->
lock
);
#ifdef ALLOW_DUMMY_VOUT
if
(
!
osys
->
vout
->
p
)
vout_display_SendEventDisplaySize
(
vd
,
display_width
,
display_height
);
else
#endif
vout_SetDisplayWindowSize
(
osys
->
vout
,
display_width
,
display_height
);
}
static
void
VoutDisplayCropRatio
(
int
*
left
,
int
*
top
,
int
*
right
,
int
*
bottom
,
...
...
@@ -868,7 +864,6 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
bool
ch_display_size
=
osys
->
ch_display_size
;
int
display_width
=
osys
->
display_width
;
int
display_height
=
osys
->
display_height
;
bool
display_is_forced
=
osys
->
display_is_forced
;
osys
->
ch_display_size
=
false
;
bool
reset_pictures
;
...
...
@@ -906,15 +901,18 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
cfg
.
display
.
width
=
cfg
.
is_fullscreen
?
0
:
osys
->
width_saved
;
cfg
.
display
.
height
=
cfg
.
is_fullscreen
?
0
:
osys
->
height_saved
;
if
(
vout_display_Control
(
vd
,
VOUT_DISPLAY_CHANGE_FULLSCREEN
,
&
cfg
))
{
msg_Err
(
vd
,
"Failed to set fullscreen"
);
if
(
vout_display_Control
(
vd
,
VOUT_DISPLAY_CHANGE_FULLSCREEN
,
&
cfg
)
==
VLC_SUCCESS
)
{
osys
->
cfg
.
is_fullscreen
=
is_fullscreen
;
if
(
!
is_fullscreen
)
vout_SetDisplayWindowSize
(
osys
->
vout
,
osys
->
width_saved
,
osys
->
height_saved
);
}
else
{
is_fullscreen
=
osys
->
cfg
.
is_fullscreen
;
}
else
if
(
!
is_fullscreen
)
{
vout_display_Control
(
vd
,
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
,
&
cfg
,
true
);
msg_Err
(
vd
,
"Failed to set fullscreen"
);
}
osys
->
cfg
.
is_fullscreen
=
is_fullscreen
;
/* */
vout_SendEventFullscreen
(
osys
->
vout
,
osys
->
cfg
.
is_fullscreen
);
}
...
...
@@ -928,9 +926,8 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
osys
->
height_saved
=
osys
->
cfg
.
display
.
height
;
if
(
vout_display_Control
(
vd
,
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
,
&
cfg
,
display_is_forced
))
{
if
(
!
display_is_forced
)
msg_Err
(
vd
,
"Failed to resize display"
);
&
cfg
,
false
))
{
msg_Err
(
vd
,
"Failed to resize display"
);
/* We ignore the resized */
display_width
=
osys
->
cfg
.
display
.
width
;
...
...
src/video_output/display.h
View file @
6d62ce57
...
...
@@ -33,7 +33,9 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
/* FIXME should not be there */
void
vout_SendDisplayEventMouse
(
vout_thread_t
*
,
const
vlc_mouse_t
*
);
vout_window_t
*
vout_NewDisplayWindow
(
vout_thread_t
*
,
const
vout_window_cfg_t
*
);
void
vout_DeleteDisplayWindow
(
vout_thread_t
*
,
vout_window_t
*
);
void
vout_
UpdateDisplaySourceProperties
(
vout_display_t
*
vd
,
const
video_format_t
*
);
void
vout_
SetDisplayWindowSize
(
vout_thread_t
*
,
unsigned
,
unsigned
);
void
vout_UpdateDisplaySourceProperties
(
vout_display_t
*
vd
,
const
video_format_t
*
);
src/video_output/video_output.c
View file @
6d62ce57
...
...
@@ -648,6 +648,23 @@ void vout_DeleteDisplayWindow(vout_thread_t *vout, vout_window_t *window)
assert
(
vout
->
p
->
window
==
window
);
}
void
vout_SetDisplayWindowSize
(
vout_thread_t
*
vout
,
unsigned
width
,
unsigned
height
)
{
vout_window_t
*
window
=
vout
->
p
->
window
;
if
(
window
!=
NULL
)
/* Request a resize of the window. If it fails, there is nothing to do.
* If it succeeds, the window will emit a resize event later. */
vout_window_SetSize
(
window
,
width
,
height
);
else
if
(
vout
->
p
->
display
.
vd
!=
NULL
)
/* Force a resize of window-less display. This is not allowed to fail,
* although the display is allowed to ignore the size anyway. */
/* FIXME: remove this, fix MSW and OS/2 window providers */
vout_display_SendEventDisplaySize
(
vout
->
p
->
display
.
vd
,
width
,
height
);
}
/* */
static
picture_t
*
VoutVideoFilterInteractiveNewPicture
(
filter_t
*
filter
)
{
...
...
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