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
411471d7
Commit
411471d7
authored
Jul 31, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated skins2 vout_window provider to the new API.
parent
15431387
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
66 deletions
+53
-66
modules/gui/skins2/src/skin_main.cpp
modules/gui/skins2/src/skin_main.cpp
+4
-8
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+0
-1
modules/gui/skins2/src/vout_manager.cpp
modules/gui/skins2/src/vout_manager.cpp
+30
-36
modules/gui/skins2/src/vout_manager.hpp
modules/gui/skins2/src/vout_manager.hpp
+10
-13
modules/gui/skins2/src/vout_window.cpp
modules/gui/skins2/src/vout_window.cpp
+6
-6
modules/gui/skins2/src/vout_window.hpp
modules/gui/skins2/src/vout_window.hpp
+3
-2
No files found.
modules/gui/skins2/src/skin_main.cpp
View file @
411471d7
...
...
@@ -32,7 +32,7 @@
#include <vlc_demux.h>
#include <vlc_playlist.h>
#include <vlc_threads.h>
#include <vlc_window.h>
#include <vlc_
vout_
window.h>
#include "dialogs.hpp"
#include "os_factory.hpp"
...
...
@@ -364,7 +364,7 @@ static int WindowOpen( vlc_object_t *p_this )
if
(
pWnd
->
handle
.
hwnd
)
{
pWnd
->
p_private
=
pIntf
;
pWnd
->
sys
=
(
vout_window_sys_t
*
)
pIntf
;
pWnd
->
control
=
&
VoutManager
::
controlWindow
;
return
VLC_SUCCESS
;
}
...
...
@@ -377,7 +377,7 @@ static int WindowOpen( vlc_object_t *p_this )
static
void
WindowClose
(
vlc_object_t
*
p_this
)
{
vout_window_t
*
pWnd
=
(
vout_window_t
*
)
p_this
;
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
p
_this
->
p_private
;
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
p
Wnd
->
sys
;
VoutManager
::
releaseWindow
(
pIntf
,
pWnd
);
}
...
...
@@ -569,11 +569,7 @@ vlc_module_begin ()
add_shortcut
(
"skins"
)
add_submodule
()
#ifndef WIN32
set_capability
(
"xwindow"
,
51
)
#else
set_capability
(
"hwnd"
,
51
)
#endif
set_capability
(
"vout window"
,
51
)
set_callbacks
(
WindowOpen
,
WindowClose
)
add_submodule
()
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
411471d7
...
...
@@ -30,7 +30,6 @@
#include <vlc_aout.h>
#include <vlc_vout.h>
#include <vlc_playlist.h>
#include <vlc_window.h>
#include "vlcproc.hpp"
#include "os_factory.hpp"
...
...
modules/gui/skins2/src/vout_manager.cpp
View file @
411471d7
...
...
@@ -26,7 +26,6 @@
#endif
#include <vlc_vout.h>
#include <vlc_window.h>
#include "vout_manager.hpp"
#include "window_manager.hpp"
...
...
@@ -57,7 +56,7 @@ void VoutManager::destroy( intf_thread_t *pIntf )
VoutManager
::
VoutManager
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_pVoutMainWindow
(
NULL
),
m_pCtrlVideoVec
(),
m_pCtrlVideoVecBackup
(),
m_Saved
Vout
Vec
()
m_pCtrlVideoVecBackup
(),
m_Saved
Wnd
Vec
()
{
vlc_mutex_init
(
&
vout_lock
);
...
...
@@ -83,8 +82,8 @@ void VoutManager::saveVoutConfig( )
{
// Save width/height to be consistent across themes
// and detach Video Controls
vector
<
Saved
Vout
>::
iterator
it
;
for
(
it
=
m_Saved
VoutVec
.
begin
();
it
!=
m_SavedVout
Vec
.
end
();
it
++
)
vector
<
Saved
Wnd
>::
iterator
it
;
for
(
it
=
m_Saved
WndVec
.
begin
();
it
!=
m_SavedWnd
Vec
.
end
();
it
++
)
{
if
(
(
*
it
).
pCtrlVideo
)
{
...
...
@@ -113,8 +112,8 @@ void VoutManager::restoreVoutConfig( bool b_success )
}
// reattach vout(s) to Video Controls
vector
<
Saved
Vout
>::
iterator
it
;
for
(
it
=
m_Saved
VoutVec
.
begin
();
it
!=
m_SavedVout
Vec
.
end
();
it
++
)
vector
<
Saved
Wnd
>::
iterator
it
;
for
(
it
=
m_Saved
WndVec
.
begin
();
it
!=
m_SavedWnd
Vec
.
end
();
it
++
)
{
CtrlVideo
*
pCtrlVideo
=
getBestCtrlVideo
();
if
(
pCtrlVideo
)
...
...
@@ -128,8 +127,8 @@ void VoutManager::restoreVoutConfig( bool b_success )
void
VoutManager
::
discardVout
(
CtrlVideo
*
pCtrlVideo
)
{
vector
<
Saved
Vout
>::
iterator
it
;
for
(
it
=
m_Saved
VoutVec
.
begin
();
it
!=
m_SavedVout
Vec
.
end
();
it
++
)
vector
<
Saved
Wnd
>::
iterator
it
;
for
(
it
=
m_Saved
WndVec
.
begin
();
it
!=
m_SavedWnd
Vec
.
end
();
it
++
)
{
if
(
(
*
it
).
pCtrlVideo
==
pCtrlVideo
)
{
...
...
@@ -146,8 +145,8 @@ void VoutManager::discardVout( CtrlVideo* pCtrlVideo )
void
VoutManager
::
requestVout
(
CtrlVideo
*
pCtrlVideo
)
{
vector
<
Saved
Vout
>::
iterator
it
;
for
(
it
=
m_Saved
VoutVec
.
begin
();
it
!=
m_SavedVout
Vec
.
end
();
it
++
)
vector
<
Saved
Wnd
>::
iterator
it
;
for
(
it
=
m_Saved
WndVec
.
begin
();
it
!=
m_SavedWnd
Vec
.
end
();
it
++
)
{
if
(
(
*
it
).
pCtrlVideo
==
NULL
)
{
...
...
@@ -177,10 +176,10 @@ CtrlVideo* VoutManager::getBestCtrlVideo( )
}
void
*
VoutManager
::
accept
Vout
(
vout_thread_t
*
pVout
,
int
width
,
int
height
)
void
*
VoutManager
::
accept
Wnd
(
vout_window_t
*
pWnd
,
int
width
,
int
height
)
{
// Creation of a dedicated Window per vout thread
VoutWindow
*
pVoutWindow
=
new
VoutWindow
(
getIntf
(),
p
Vout
,
width
,
height
,
VoutWindow
*
pVoutWindow
=
new
VoutWindow
(
getIntf
(),
p
Wnd
,
width
,
height
,
(
GenericWindow
*
)
m_pVoutMainWindow
);
void
*
handle
=
pVoutWindow
->
getOSHandle
();
...
...
@@ -195,10 +194,10 @@ void* VoutManager::acceptVout( vout_thread_t* pVout, int width, int height )
}
// save vout characteristics
m_Saved
VoutVec
.
push_back
(
SavedVout
(
pVout
,
pVoutWindow
,
pCtrlVideo
)
);
m_Saved
WndVec
.
push_back
(
SavedWnd
(
pWnd
,
pVoutWindow
,
pCtrlVideo
)
);
msg_Dbg
(
getIntf
(),
"New incoming vout=0x%p, handle=0x%p, VideoCtrl=0x%p"
,
p
Vout
,
handle
,
pCtrlVideo
);
p
Wnd
,
handle
,
pCtrlVideo
);
return
handle
;
}
...
...
@@ -215,13 +214,12 @@ void *VoutManager::getWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
VoutManager
*
pThis
=
pIntf
->
p_sys
->
p_voutManager
;
vout_thread_t
*
pVout
=
pWnd
->
vout
;
int
width
=
(
int
)
pWnd
->
width
;
int
height
=
(
int
)
pWnd
->
height
;
int
width
=
(
int
)
pWnd
->
cfg
->
width
;
int
height
=
(
int
)
pWnd
->
cfg
->
height
;
pThis
->
lockVout
();
void
*
handle
=
pThis
->
accept
Vout
(
pVout
,
width
,
height
);
void
*
handle
=
pThis
->
accept
Wnd
(
pWnd
,
width
,
height
);
pThis
->
unlockVout
();
...
...
@@ -237,18 +235,16 @@ void VoutManager::releaseWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
if
(
!
pIntf
->
p_sys
->
p_theme
)
return
;
vout_thread_t
*
pVout
=
pWnd
->
vout
;
pThis
->
lockVout
();
// remove vout thread from savedVec
vector
<
Saved
Vout
>::
iterator
it
;
for
(
it
=
pThis
->
m_Saved
VoutVec
.
begin
();
it
!=
pThis
->
m_SavedVout
Vec
.
end
();
it
++
)
vector
<
Saved
Wnd
>::
iterator
it
;
for
(
it
=
pThis
->
m_Saved
WndVec
.
begin
();
it
!=
pThis
->
m_SavedWnd
Vec
.
end
();
it
++
)
{
if
(
(
*
it
).
p
Vout
==
pVout
)
if
(
(
*
it
).
p
Wnd
==
pWnd
)
{
msg_Dbg
(
pIntf
,
"vout released vout=0x%p, VideoCtrl=0x%p"
,
p
Vout
,
(
*
it
).
pCtrlVideo
);
p
Wnd
,
(
*
it
).
pCtrlVideo
);
// if a video control was being used, detach from it
if
(
(
*
it
).
pCtrlVideo
)
...
...
@@ -258,7 +254,7 @@ void VoutManager::releaseWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
// remove resources
delete
(
*
it
).
pVoutWindow
;
pThis
->
m_Saved
Vout
Vec
.
erase
(
it
);
pThis
->
m_Saved
Wnd
Vec
.
erase
(
it
);
break
;
}
}
...
...
@@ -270,13 +266,12 @@ void VoutManager::releaseWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
int
VoutManager
::
controlWindow
(
struct
vout_window_t
*
pWnd
,
int
query
,
va_list
args
)
{
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pWnd
->
p_private
;
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pWnd
->
sys
;
VoutManager
*
pThis
=
pIntf
->
p_sys
->
p_voutManager
;
vout_thread_t
*
pVout
=
pWnd
->
vout
;
switch
(
query
)
{
case
VOUT_SET_SIZE
:
case
VOUT_
WINDOW_
SET_SIZE
:
{
unsigned
int
i_width
=
va_arg
(
args
,
unsigned
int
);
unsigned
int
i_height
=
va_arg
(
args
,
unsigned
int
);
...
...
@@ -285,17 +280,17 @@ int VoutManager::controlWindow( struct vout_window_t *pWnd,
{
pThis
->
lockVout
();
vector
<
Saved
Vout
>::
iterator
it
;
for
(
it
=
pThis
->
m_Saved
Vout
Vec
.
begin
();
it
!=
pThis
->
m_Saved
Vout
Vec
.
end
();
it
++
)
vector
<
Saved
Wnd
>::
iterator
it
;
for
(
it
=
pThis
->
m_Saved
Wnd
Vec
.
begin
();
it
!=
pThis
->
m_Saved
Wnd
Vec
.
end
();
it
++
)
{
if
(
(
*
it
).
p
Vout
==
pVout
)
if
(
(
*
it
).
p
Wnd
==
pWnd
)
{
// Post a vout resize command
CmdResizeVout
*
pCmd
=
new
CmdResizeVout
(
pThis
->
getIntf
(),
(
*
it
).
pVoutWindow
,
(
int
)
i_width
,
(
int
)
i_height
);
i_width
,
i_height
);
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pThis
->
getIntf
()
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
...
...
@@ -305,13 +300,12 @@ int VoutManager::controlWindow( struct vout_window_t *pWnd,
pThis
->
unlockVout
();
}
return
VLC_SUCCESS
;
}
default:
msg_Dbg
(
pWnd
,
"control query not supported"
);
break
;
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
modules/gui/skins2/src/vout_manager.hpp
View file @
411471d7
...
...
@@ -27,7 +27,7 @@
#include <vector>
#include <vlc_vout.h>
#include <vlc_window.h>
#include <vlc_
vout_
window.h>
#include "../utils/position.hpp"
#include "../commands/cmd_generic.hpp"
#include "../controls/ctrl_video.hpp"
...
...
@@ -37,17 +37,17 @@ class GenericWindow;
#include <stdio.h>
class
Saved
Vout
class
Saved
Wnd
{
public:
Saved
Vout
(
vout_thread_t
*
pVout
,
VoutWindow
*
pVoutWindow
=
NULL
,
Saved
Wnd
(
vout_window_t
*
pWnd
,
VoutWindow
*
pVoutWindow
=
NULL
,
CtrlVideo
*
pCtrlVideo
=
NULL
,
int
height
=
0
,
int
width
=
0
)
:
p
Vout
(
pVout
),
pVoutWindow
(
pVoutWindow
),
pCtrlVideo
(
pCtrlVideo
),
p
Wnd
(
pWnd
),
pVoutWindow
(
pVoutWindow
),
pCtrlVideo
(
pCtrlVideo
),
height
(
height
),
width
(
width
)
{}
~
Saved
Vout
()
{}
~
Saved
Wnd
()
{}
vout_
thread_t
*
pVout
;
vout_
window_t
*
pWnd
;
VoutWindow
*
pVoutWindow
;
CtrlVideo
*
pCtrlVideo
;
int
height
;
...
...
@@ -83,8 +83,8 @@ class VoutManager: public SkinObject
/// Callback to request a vout window
static
void
*
getWindow
(
intf_thread_t
*
pIntf
,
vout_window_t
*
pWnd
);
/// Accept
Vout
void
*
accept
Vout
(
vout_thread_t
*
pVout
,
int
width
,
int
height
);
/// Accept
Wnd
void
*
accept
Wnd
(
vout_window_t
*
pWnd
,
int
width
,
int
height
);
// Window provider (release)
static
void
releaseWindow
(
intf_thread_t
*
pIntf
,
vout_window_t
*
pWnd
);
...
...
@@ -104,9 +104,6 @@ class VoutManager: public SkinObject
void
discardVout
(
CtrlVideo
*
pCtrlVideo
);
void
requestVout
(
CtrlVideo
*
pCtrlVideo
);
// get a VoutWindow
void
*
getHandle
(
vout_thread_t
*
pVout
,
int
width
,
int
height
);
// get a useable video Control
CtrlVideo
*
getBestCtrlVideo
(
);
...
...
@@ -114,7 +111,7 @@ class VoutManager: public SkinObject
VoutMainWindow
*
getVoutMainWindow
()
{
return
m_pVoutMainWindow
;
}
// test if vout are running
bool
hasVout
()
{
return
(
m_Saved
Vout
Vec
.
size
()
!=
0
)
;
}
bool
hasVout
()
{
return
(
m_Saved
Wnd
Vec
.
size
()
!=
0
)
;
}
// (un)lock functions to protect vout sets
void
lockVout
(
)
{
vlc_mutex_lock
(
&
vout_lock
);
}
...
...
@@ -129,7 +126,7 @@ class VoutManager: public SkinObject
vector
<
CtrlVideo
*>
m_pCtrlVideoVec
;
vector
<
CtrlVideo
*>
m_pCtrlVideoVecBackup
;
vector
<
Saved
Vout
>
m_SavedVout
Vec
;
vector
<
Saved
Wnd
>
m_SavedWnd
Vec
;
VoutMainWindow
*
m_pVoutMainWindow
;
...
...
modules/gui/skins2/src/vout_window.cpp
View file @
411471d7
...
...
@@ -31,17 +31,17 @@
int
VoutWindow
::
count
=
0
;
VoutWindow
::
VoutWindow
(
intf_thread_t
*
pIntf
,
vout_
thread_t
*
pVout
,
VoutWindow
::
VoutWindow
(
intf_thread_t
*
pIntf
,
vout_
window_t
*
pWnd
,
int
width
,
int
height
,
GenericWindow
*
pParent
)
:
GenericWindow
(
pIntf
,
0
,
0
,
false
,
false
,
pParent
),
m_p
Vout
(
pVout
),
original_width
(
width
),
original_height
(
height
),
m_p
Wnd
(
pWnd
),
original_width
(
width
),
original_height
(
height
),
m_pParentWindow
(
pParent
),
m_pImage
(
NULL
)
{
// counter for debug
count
++
;
if
(
m_p
Vout
)
vlc_object_hold
(
m_p
Vout
);
if
(
m_p
Wnd
)
vlc_object_hold
(
m_p
Wnd
);
// needed on MS-Windows to prevent vlc hanging
show
();
...
...
@@ -51,8 +51,8 @@ VoutWindow::VoutWindow( intf_thread_t *pIntf, vout_thread_t* pVout,
VoutWindow
::~
VoutWindow
()
{
delete
m_pImage
;
if
(
m_p
Vout
)
vlc_object_release
(
m_p
Vout
);
if
(
m_p
Wnd
)
vlc_object_release
(
m_p
Wnd
);
count
--
;
msg_Dbg
(
getIntf
(),
"VoutWindow count = %d"
,
count
);
...
...
modules/gui/skins2/src/vout_window.hpp
View file @
411471d7
...
...
@@ -25,6 +25,7 @@
#define VOUT_WINDOW_HPP
#include "generic_window.hpp"
#include <vlc_vout_window.h>
class
OSGraphics
;
class
CtrlVideo
;
...
...
@@ -35,7 +36,7 @@ class VoutWindow: private GenericWindow
{
public:
VoutWindow
(
intf_thread_t
*
pIntf
,
vout_
thread_t
*
pVout
,
VoutWindow
(
intf_thread_t
*
pIntf
,
vout_
window_t
*
pWnd
,
int
width
,
int
height
,
GenericWindow
*
pParent
=
NULL
);
virtual
~
VoutWindow
();
...
...
@@ -79,7 +80,7 @@ class VoutWindow: private GenericWindow
OSGraphics
*
m_pImage
;
/// vout thread
vout_
thread_t
*
m_pVout
;
vout_
window_t
*
m_pWnd
;
/// original width and height
int
original_width
;
...
...
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