Commit 7b2d398a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Do not propagate fullscreen status up the filter chain

This is fundamentally a lock inversion between the parent and child
object variables locks. Interfaces (hotkeys and others) use downward
propagation, so we keep that direction and remove the other direction.
parent 49334e07
...@@ -86,9 +86,9 @@ static inline int ForwardEvent( vlc_object_t *p_this, char const *psz_var, ...@@ -86,9 +86,9 @@ static inline int ForwardEvent( vlc_object_t *p_this, char const *psz_var,
* Install/remove all callbacks needed for proper event handling inside * Install/remove all callbacks needed for proper event handling inside
* a vout-filter. * a vout-filter.
*/ */
static inline void vout_filter_SetupChild( vout_thread_t *p_parent, vout_thread_t *p_child, static inline void vout_filter_SetupChild( vout_thread_t *p_parent,
vout_thread_t *p_child,
vlc_callback_t pf_mouse_event, vlc_callback_t pf_mouse_event,
vlc_callback_t pf_fullscreen_up,
vlc_callback_t pf_fullscreen_down, vlc_callback_t pf_fullscreen_down,
bool b_init ) bool b_init )
{ {
...@@ -115,14 +115,11 @@ static inline void vout_filter_SetupChild( vout_thread_t *p_parent, vout_thread_ ...@@ -115,14 +115,11 @@ static inline void vout_filter_SetupChild( vout_thread_t *p_parent, vout_thread_
pf_execute( VLC_OBJECT(p_parent), "crop", ForwardEvent, p_child ); pf_execute( VLC_OBJECT(p_parent), "crop", ForwardEvent, p_child );
/* */ /* */
if( !pf_fullscreen_up )
pf_fullscreen_up = ForwardEvent;
if( !pf_fullscreen_down ) if( !pf_fullscreen_down )
pf_fullscreen_down = ForwardEvent; pf_fullscreen_down = ForwardEvent;
pf_execute( VLC_OBJECT(p_child), "fullscreen", pf_fullscreen_up, p_parent );
pf_execute( VLC_OBJECT(p_parent), "fullscreen", pf_fullscreen_down, p_child ); pf_execute( VLC_OBJECT(p_parent), "fullscreen", pf_fullscreen_down, p_child );
} }
#define vout_filter_AddChild( a, b, c ) vout_filter_SetupChild( a, b, c, NULL, NULL, true ) #define vout_filter_AddChild( a, b, c ) vout_filter_SetupChild( a, b, c, NULL, true )
#define vout_filter_DelChild( a, b, c ) vout_filter_SetupChild( a, b, c, NULL, NULL, false ) #define vout_filter_DelChild( a, b, c ) vout_filter_SetupChild( a, b, c, NULL, false )
...@@ -117,8 +117,6 @@ static int FilterAllocationInit ( filter_t *, void * ); ...@@ -117,8 +117,6 @@ static int FilterAllocationInit ( filter_t *, void * );
static void FilterAllocationClean( filter_t * ); static void FilterAllocationClean( filter_t * );
/* */ /* */
static int FullscreenEventUp( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int FullscreenEventDown( vlc_object_t *, char const *, static int FullscreenEventDown( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
static int SplitterPictureNew( video_splitter_t *, picture_t *pp_picture[] ); static int SplitterPictureNew( video_splitter_t *, picture_t *pp_picture[] );
...@@ -310,11 +308,11 @@ static int Init( vout_thread_t *p_vout ) ...@@ -310,11 +308,11 @@ static int Init( vout_thread_t *p_vout )
} }
} }
/* Attach once pp_vout is completly field to avoid race conditions */ /* Attach once pp_vout is completly filed to avoid race conditions */
for( int i = 0; i < p_splitter->i_output; i++ ) for( int i = 0; i < p_splitter->i_output; i++ )
vout_filter_SetupChild( p_vout, p_sys->pp_vout[i], vout_filter_SetupChild( p_vout, p_sys->pp_vout[i],
MouseEvent, MouseEvent,
FullscreenEventUp, FullscreenEventDown, true ); FullscreenEventDown, true );
/* Restore settings */ /* Restore settings */
var_SetInteger( p_vout, "align", i_org_align ); var_SetInteger( p_vout, "align", i_org_align );
var_SetInteger( p_vout, "video-x", i_org_x ); var_SetInteger( p_vout, "video-x", i_org_x );
...@@ -398,7 +396,7 @@ static void VoutsClean( vout_thread_t *p_vout, int i_count ) ...@@ -398,7 +396,7 @@ static void VoutsClean( vout_thread_t *p_vout, int i_count )
else else
vout_filter_SetupChild( p_vout, p_sys->pp_vout[i], vout_filter_SetupChild( p_vout, p_sys->pp_vout[i],
MouseEvent, MouseEvent,
FullscreenEventUp, FullscreenEventDown, false ); FullscreenEventDown, false );
} }
for( int i = 0; i < i_count; i++ ) for( int i = 0; i < i_count; i++ )
...@@ -555,15 +553,6 @@ static bool IsFullscreenActive( vout_thread_t *p_vout ) ...@@ -555,15 +553,6 @@ static bool IsFullscreenActive( vout_thread_t *p_vout )
} }
return false; return false;
} }
static int FullscreenEventUp( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
vout_thread_t *p_vout = p_data;
VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(newval);
const bool b_fullscreen = IsFullscreenActive( p_vout );
return var_SetBool( p_vout, "fullscreen", b_fullscreen );
}
static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var, static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
......
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