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()
*/
void ActionsManager::fullscreen()
{
vout_thread_t *p_vout =
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
vout_thread_t *p_vout = THEMIM->getVout();
if( p_vout)
{
var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
......@@ -122,8 +121,7 @@ void ActionsManager::fullscreen()
void ActionsManager::snapshot()
{
vout_thread_t *p_vout =
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
vout_thread_t *p_vout = THEMIM->getVout();
if( p_vout )
{
vout_Control( p_vout, VOUT_SNAPSHOT );
......
......@@ -30,6 +30,7 @@
#endif
#include <vlc_input.h>
#include <vlc_vout.h>
#include "qt4.hpp"
......@@ -206,6 +207,18 @@ public:
input_thread_t *getInput() { return p_input; };
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:
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