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
787a60ad
Commit
787a60ad
authored
Oct 12, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout: dispatch window events to the display events handler
parent
fad21f3c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
12 deletions
+152
-12
src/Makefile.am
src/Makefile.am
+1
-0
src/video_output/display.c
src/video_output/display.c
+23
-9
src/video_output/video_output.c
src/video_output/video_output.c
+3
-3
src/video_output/window.c
src/video_output/window.c
+100
-0
src/video_output/window.h
src/video_output/window.h
+25
-0
No files found.
src/Makefile.am
View file @
787a60ad
...
...
@@ -412,6 +412,7 @@ SOURCES_libvlc_common = \
video_output/video_widgets.c
\
video_output/vout_subpictures.c
\
video_output/window.c
\
video_output/window.h
\
video_output/opengl.c
\
video_output/vout_intf.c
\
video_output/vout_internal.h
\
...
...
src/video_output/display.c
View file @
787a60ad
...
...
@@ -39,6 +39,7 @@
#include <libvlc.h>
#include "display.h"
#include "window.h"
#include "event.h"
...
...
@@ -734,6 +735,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
static
vout_window_t
*
VoutDisplayNewWindow
(
vout_display_t
*
vd
,
const
vout_window_cfg_t
*
cfg
)
{
vout_display_owner_sys_t
*
osys
=
vd
->
owner
.
sys
;
vout_window_t
*
window
;
#ifdef ALLOW_DUMMY_VOUT
if
(
!
osys
->
vout
->
p
)
{
...
...
@@ -742,24 +744,30 @@ static vout_window_t *VoutDisplayNewWindow(vout_display_t *vd, const vout_window
if
(
!
var_InheritBool
(
osys
->
vout
,
"embedded-video"
))
cfg_override
.
is_standalone
=
true
;
return
vout_window_New
(
VLC_OBJECT
(
osys
->
vout
),
"$window"
,
&
cfg_override
,
NULL
);
window
=
vout_display_window_New
(
osys
->
vout
,
&
cfg_override
);
}
else
#endif
return
vout_NewDisplayWindow
(
osys
->
vout
,
cfg
);
window
=
vout_NewDisplayWindow
(
osys
->
vout
,
cfg
);
if
(
window
!=
NULL
)
vout_display_window_Attach
(
window
,
vd
);
return
window
;
}
static
void
VoutDisplayDelWindow
(
vout_display_t
*
vd
,
vout_window_t
*
window
)
{
vout_display_owner_sys_t
*
osys
=
vd
->
owner
.
sys
;
if
(
window
!=
NULL
)
vout_display_window_Detach
(
window
);
#ifdef ALLOW_DUMMY_VOUT
if
(
!
osys
->
vout
->
p
)
{
if
(
window
)
vout_window_Delete
(
window
);
return
;
vout_display_window_Delete
(
window
);
}
#endif
else
vout_DeleteDisplayWindow
(
osys
->
vout
,
window
);
}
...
...
@@ -1434,17 +1442,23 @@ struct video_splitter_owner_t {
static
vout_window_t
*
SplitterNewWindow
(
vout_display_t
*
vd
,
const
vout_window_cfg_t
*
cfg_ptr
)
{
vout_display_owner_sys_t
*
osys
=
vd
->
owner
.
sys
;
vout_window_t
*
window
;
vout_window_cfg_t
cfg
=
*
cfg_ptr
;
cfg
.
is_standalone
=
true
;
return
vout_window_New
(
VLC_OBJECT
(
osys
->
vout
),
"$window"
,
&
cfg
,
NULL
);
window
=
vout_display_window_New
(
osys
->
vout
,
&
cfg
);
if
(
window
!=
NULL
)
vout_display_window_Attach
(
window
,
vd
);
return
window
;
}
static
void
SplitterDelWindow
(
vout_display_t
*
vd
,
vout_window_t
*
window
)
{
if
(
window
!=
NULL
)
vout_window_Delete
(
window
);
if
(
window
!=
NULL
)
{
vout_display_window_Detach
(
window
);
vout_display_window_Delete
(
window
);
}
(
void
)
vd
;
}
...
...
src/video_output/video_output.c
View file @
787a60ad
...
...
@@ -50,6 +50,7 @@
#include "vout_internal.h"
#include "interlacing.h"
#include "display.h"
#include "window.h"
/*****************************************************************************
* Local prototypes
...
...
@@ -173,8 +174,7 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
.
height
=
cfg
->
fmt
->
i_visible_height
,
};
vout
->
p
->
window
=
vout_window_New
(
VLC_OBJECT
(
vout
),
"$window"
,
&
wcfg
,
NULL
);
vout
->
p
->
window
=
vout_display_window_New
(
vout
,
&
wcfg
);
}
else
vout
->
p
->
window
=
NULL
;
...
...
@@ -642,7 +642,7 @@ vout_window_t * vout_NewDisplayWindow(vout_thread_t *vout,
void
vout_DeleteDisplayWindow
(
vout_thread_t
*
vout
,
vout_window_t
*
window
)
{
if
(
window
==
NULL
&&
vout
->
p
->
window
!=
NULL
)
{
vout_window_Delete
(
vout
->
p
->
window
);
vout_
display_
window_Delete
(
vout
->
p
->
window
);
vout
->
p
->
window
=
NULL
;
}
assert
(
vout
->
p
->
window
==
window
);
...
...
src/video_output/window.c
View file @
787a60ad
...
...
@@ -111,3 +111,103 @@ void vout_window_Delete(vout_window_t *window)
vlc_module_unload
(
w
->
module
,
vout_window_stop
,
window
);
vlc_object_release
(
window
);
}
/* Video output display integration */
#include <vlc_vout_display.h>
#include "window.h"
typedef
struct
vout_display_window
{
vout_display_t
*
vd
;
unsigned
width
;
unsigned
height
;
vlc_mutex_t
lock
;
}
vout_display_window_t
;
static
void
vout_display_window_ResizeNotify
(
vout_window_t
*
window
,
unsigned
width
,
unsigned
height
)
{
vout_display_window_t
*
state
=
window
->
owner
.
sys
;
msg_Dbg
(
window
,
"resized to %ux%u"
,
width
,
height
);
vlc_mutex_lock
(
&
state
->
lock
);
state
->
width
=
width
;
state
->
height
=
height
;
if
(
state
->
vd
!=
NULL
)
vout_display_SendEventDisplaySize
(
state
->
vd
,
width
,
height
);
vlc_mutex_unlock
(
&
state
->
lock
);
}
/**
* Creates a video window, initially without any attached display.
*/
vout_window_t
*
vout_display_window_New
(
vout_thread_t
*
vout
,
const
vout_window_cfg_t
*
cfg
)
{
vout_display_window_t
*
state
=
malloc
(
sizeof
(
*
state
));
if
(
state
==
NULL
)
return
NULL
;
state
->
vd
=
NULL
;
state
->
width
=
cfg
->
width
;
state
->
height
=
cfg
->
height
;
vlc_mutex_init
(
&
state
->
lock
);
vout_window_owner_t
owner
=
{
.
sys
=
state
,
.
resized
=
vout_display_window_ResizeNotify
,
};
vout_window_t
*
window
;
window
=
vout_window_New
((
vlc_object_t
*
)
vout
,
"$window"
,
cfg
,
&
owner
);
if
(
window
==
NULL
)
{
vlc_mutex_destroy
(
&
state
->
lock
);
free
(
state
);
}
return
window
;
}
/**
* Attaches a window to a display. Window events will be dispatched to the
* display until they are detached.
*/
void
vout_display_window_Attach
(
vout_window_t
*
window
,
vout_display_t
*
vd
)
{
vout_display_window_t
*
state
=
window
->
owner
.
sys
;
vlc_mutex_lock
(
&
state
->
lock
);
state
->
vd
=
vd
;
vout_display_SendEventDisplaySize
(
vd
,
state
->
width
,
state
->
height
);
vlc_mutex_unlock
(
&
state
->
lock
);
}
/**
* Detaches a window from a display. Window events will no longer be dispatched
* (except those that do not need a display).
*/
void
vout_display_window_Detach
(
vout_window_t
*
window
)
{
vout_display_window_t
*
state
=
window
->
owner
.
sys
;
vlc_mutex_lock
(
&
state
->
lock
);
state
->
vd
=
NULL
;
vlc_mutex_unlock
(
&
state
->
lock
);
}
/**
* Destroys a video window.
* \note The window must be detached.
*/
void
vout_display_window_Delete
(
vout_window_t
*
window
)
{
vout_display_window_t
*
state
=
window
->
owner
.
sys
;
vout_window_Delete
(
window
);
assert
(
state
->
vd
==
NULL
);
vlc_mutex_destroy
(
&
state
->
lock
);
free
(
state
);
}
src/video_output/window.h
0 → 100644
View file @
787a60ad
/*****************************************************************************
* window.h: window managment for VLC video output
*****************************************************************************
* Copyright © 2014 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
vout_window_t
*
vout_display_window_New
(
vout_thread_t
*
,
const
vout_window_cfg_t
*
);
void
vout_display_window_Attach
(
vout_window_t
*
,
vout_display_t
*
);
void
vout_display_window_Detach
(
vout_window_t
*
);
void
vout_display_window_Delete
(
vout_window_t
*
);
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