Commit a7c94c6a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Create a getVout() in MIM to remove some vlc_object_find( p_intf,...

Qt: Create a getVout() in MIM to remove some vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); calls

Just used now for buttons.
parent ea39325d
...@@ -111,8 +111,7 @@ void ActionsManager::play() ...@@ -111,8 +111,7 @@ void ActionsManager::play()
*/ */
void ActionsManager::fullscreen() void ActionsManager::fullscreen()
{ {
vout_thread_t *p_vout = vout_thread_t *p_vout = THEMIM->getVout();
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_vout) if( p_vout)
{ {
var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) ); var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
...@@ -122,8 +121,7 @@ void ActionsManager::fullscreen() ...@@ -122,8 +121,7 @@ void ActionsManager::fullscreen()
void ActionsManager::snapshot() void ActionsManager::snapshot()
{ {
vout_thread_t *p_vout = vout_thread_t *p_vout = THEMIM->getVout();
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_vout ) if( p_vout )
{ {
vout_Control( p_vout, VOUT_SNAPSHOT ); vout_Control( p_vout, VOUT_SNAPSHOT );
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#endif #endif
#include <vlc_input.h> #include <vlc_input.h>
#include <vlc_vout.h>
#include "qt4.hpp" #include "qt4.hpp"
...@@ -206,6 +207,18 @@ public: ...@@ -206,6 +207,18 @@ public:
input_thread_t *getInput() { return p_input; }; input_thread_t *getInput() { return p_input; };
InputManager *getIM() { return im; }; InputManager *getIM() { return im; };
vout_thread_t * getVout()
{
vout_thread_t **pp_vout; int i_vout;
if( !input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
{
for( int i = 1; i < i_vout; i++ ) vlc_object_release( pp_vout[i]);
vout_thread_t *p_tmp = pp_vout[0];
free( pp_vout );
return p_tmp;
}
return NULL;
}
private: private:
MainInputManager( intf_thread_t * ); MainInputManager( intf_thread_t * );
......
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