Commit 23db5d08 authored by Erwan Tulou's avatar Erwan Tulou

skins2: fix fullscreen issue (black screen when video terminates).

fullscreen is now managed (activation and deactivation) in skins2
 exactly as it is done in qt4.
    - activation when a VOUT_WINDOW_SETFULLSCREEN is received
    - deactivation when (and only when) a vout_window release is received.
(cherry picked from commit 2e298fb87562b7a6470c24091a336b251be64bc4)
parent 6009d223
...@@ -498,11 +498,7 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal ) ...@@ -498,11 +498,7 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
vout_thread_t* pVout = input_GetVout( pInput ); vout_thread_t* pVout = input_GetVout( pInput );
SET_BOOL( m_cVarHasVout, pVout != NULL ); SET_BOOL( m_cVarHasVout, pVout != NULL );
if( pVout ) if( pVout )
{
SET_BOOL( m_cVarFullscreen,
var_GetBool( pVout, "fullscreen" ) );
vlc_object_release( pVout ); vlc_object_release( pVout );
}
break; break;
} }
...@@ -712,7 +708,6 @@ void VlcProc::reset_input() ...@@ -712,7 +708,6 @@ void VlcProc::reset_input()
SET_BOOL( m_cVarRecordable, false ); SET_BOOL( m_cVarRecordable, false );
SET_BOOL( m_cVarRecording, false ); SET_BOOL( m_cVarRecording, false );
SET_BOOL( m_cVarDvdActive, false ); SET_BOOL( m_cVarDvdActive, false );
SET_BOOL( m_cVarFullscreen, false );
SET_BOOL( m_cVarHasAudio, false ); SET_BOOL( m_cVarHasAudio, false );
SET_BOOL( m_cVarHasVout, false ); SET_BOOL( m_cVarHasVout, false );
SET_BOOL( m_cVarStopped, true ); SET_BOOL( m_cVarStopped, true );
......
...@@ -69,11 +69,17 @@ VoutManager::VoutManager( intf_thread_t *pIntf ): SkinObject( pIntf ), ...@@ -69,11 +69,17 @@ VoutManager::VoutManager( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_pVoutMainWindow->move( 0, 0 ); m_pVoutMainWindow->move( 0, 0 );
m_pVoutMainWindow->resize( width, height ); m_pVoutMainWindow->resize( width, height );
VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
rFullscreen.addObserver( this );
} }
VoutManager::~VoutManager( ) VoutManager::~VoutManager( )
{ {
VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
rFullscreen.delObserver( this );
delete m_pVoutMainWindow; delete m_pVoutMainWindow;
} }
...@@ -249,6 +255,9 @@ void VoutManager::releaseWnd( vout_window_t *pWnd ) ...@@ -249,6 +255,9 @@ void VoutManager::releaseWnd( vout_window_t *pWnd )
break; break;
} }
} }
// force fullscreen to false so that user regains control
VlcProc::instance( getIntf() )->setFullscreenVar( false );
} }
...@@ -277,23 +286,29 @@ void VoutManager::setSizeWnd( vout_window_t *pWnd, int width, int height ) ...@@ -277,23 +286,29 @@ void VoutManager::setSizeWnd( vout_window_t *pWnd, int width, int height )
} }
} }
void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen ) void VoutManager::setFullscreenWnd( vout_window_t *pWnd, bool b_fullscreen )
{ {
msg_Dbg( pWnd, "setFullscreen (%d) received from vout thread", msg_Dbg( pWnd, "setFullscreen (%i) received from vout thread",
b_fullscreen ? 1 : 0 ); b_fullscreen );
VlcProc::instance( getIntf() )->setFullscreenVar( b_fullscreen ); VlcProc::instance( getIntf() )->setFullscreenVar( b_fullscreen );
}
if( b_fullscreen )
void VoutManager::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
if( &rVariable == &rFullscreen )
{ {
if( rFullscreen.get() )
m_pVoutMainWindow->show(); m_pVoutMainWindow->show();
}
else else
{
m_pVoutMainWindow->hide(); m_pVoutMainWindow->hide();
} }
} }
// Functions called by window provider // Functions called by window provider
// /////////////////////////////////// // ///////////////////////////////////
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
/// Singleton object handling VLC internal state and playlist /// Singleton object handling VLC internal state and playlist
class VoutManager: public SkinObject class VoutManager: public SkinObject, public Observer<VarBool>
{ {
public: public:
/// Get the instance of VoutManager /// Get the instance of VoutManager
...@@ -146,6 +146,9 @@ public: ...@@ -146,6 +146,9 @@ public:
// test if vout are running // test if vout are running
bool hasVout() { return ( m_SavedWndVec.size() != 0 ) ; } bool hasVout() { return ( m_SavedWndVec.size() != 0 ) ; }
/// called when fullscreen variable changed
virtual void onUpdate( Subject<VarBool> &rVariable , void* );
protected: protected:
// Protected because it is a singleton // Protected because it is a singleton
VoutManager( intf_thread_t *pIntf ); VoutManager( intf_thread_t *pIntf );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment