vlc_value_t old_val, vlc_value_t new_val, void *param );
static int InteractCallback( vlc_object_t *, const char *, vlc_value_t,
vlc_value_t, void *);
-/* Video handling */
-static void *DoRequest( intf_thread_t *p_intf, vout_thread_t *p_vout,
- int *pi1, int *pi2, unsigned int*pi3,unsigned int*pi4)
-{
- return p_intf->p_sys->p_mi->requestVideo( p_vout, pi1, pi2, pi3, pi4 );
-}
-
-static void *DoNotEmbeddedRequest( intf_thread_t *p_intf, vout_thread_t *p_vout,
- int *pi1, int *pi2, unsigned int*pi3,unsigned int*pi4)
-{
- p_intf->p_sys->p_mi->requestNotEmbeddedVideo( p_vout );
- return NULL;
-}
-
-static void DoRelease( intf_thread_t *p_intf, void *p_win )
-{
- return p_intf->p_sys->p_mi->releaseVideo( p_win );
-}
-
-static int DoControl( intf_thread_t *p_intf, void *p_win, int i_q, va_list a )
-{
- return p_intf->p_sys->p_mi->controlVideo( p_win, i_q, a );
-}
MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
p_intf->b_interaction = false;
var_DelCallback( p_intf, "interaction", InteractCallback, this );
- p_intf->pf_request_window = NULL;
- p_intf->pf_release_window = NULL;
- p_intf->pf_control_window = NULL;
p_intf->p_sys->p_mi = NULL;
}
videoWidget = new VideoWidget( p_intf );
mainLayout->insertWidget( 0, videoWidget );
- p_intf->pf_request_window = ::DoRequest;
- p_intf->pf_release_window = ::DoRelease;
- p_intf->pf_control_window = ::DoControl;
}
else
{
- p_intf->pf_request_window = ::DoNotEmbeddedRequest;
}
/* Finish the sizing */
videoWidget->release( p_win );
videoWidget->hide();
- if( bgWidget )// WORONG
+ if( bgWidget )// WRONG
bgWidget->show();
adjustSize();
* vout_intf.c : video output interface
*****************************************************************************
* Copyright (C) 2000-2007 the VideoLAN team
- * $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
unsigned int *pi_width_hint,
unsigned int *pi_height_hint )
{
- intf_thread_t *p_intf = NULL;
- vlc_list_t *p_list;
- void *p_window;
- vlc_value_t val;
- int i;
-
/* Small kludge */
if( !var_Type( p_vout, "aspect-ratio" ) ) vout_IntfInit( p_vout );
int drawable = var_CreateGetInteger( p_vout, "drawable" );
if( drawable ) return (void *)(intptr_t)drawable;
-#if 0
- /* FIXME:
- * This code is utter crap w.r.t. threading. And it has always been.
- * First, one cannot invoke callbacks from another thread's object.
- * Not without a well-defined locking convention.
- *
- * Second, this would need to "wait" for the interface to be ready.
- * Otherwise, the availability of the embded window would become
- * time-dependent.
- *
- * In the past, this kind of things worked by accident. This time is over.
- * -- Courmisch, 12 Jun 2008
- */
- /* Find if the main interface supports embedding */
- p_list = vlc_list_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE );
- if( !p_list ) return NULL;
-
- for( i = 0; i < p_list->i_count; i++ )
- {
- p_intf = (intf_thread_t *)p_list->p_values[i].p_object;
- if( p_intf->pf_request_window ) break;
- p_intf = NULL;
- }
-
- if( !p_intf )
- {
- vlc_list_release( p_list );
- return NULL;
- }
-
- vlc_object_yield( p_intf );
- vlc_list_release( p_list );
-
- p_window = p_intf->pf_request_window( p_intf, p_vout, pi_x_hint, pi_y_hint,
- pi_width_hint, pi_height_hint );
-
- if( !p_window ) vlc_object_release( p_intf );
- else p_vout->p_parent_intf = p_intf;
-
- return p_window;
-#else
return NULL;
-#endif
}
void vout_ReleaseWindow( vout_thread_t *p_vout, void *p_window )
{
- intf_thread_t *p_intf = p_vout->p_parent_intf;
-
- if( !p_intf ) return;
-
- vlc_object_lock( p_intf );
- if( p_intf->b_dead )
- {
- vlc_object_unlock( p_intf );
- return;
- }
-
- if( !p_intf->pf_release_window )
- {
- msg_Err( p_vout, "no pf_release_window");
- vlc_object_unlock( p_intf );
- vlc_object_release( p_intf );
- return;
- }
-
- p_intf->pf_release_window( p_intf, p_window );
-
- p_vout->p_parent_intf = NULL;
- vlc_object_unlock( p_intf );
- vlc_object_release( p_intf );
+ (void)p_vout; (void)p_window;
}
int vout_ControlWindow( vout_thread_t *p_vout, void *p_window,
int i_query, va_list args )
{
- intf_thread_t *p_intf = p_vout->p_parent_intf;
- int i_ret;
-
- if( !p_intf ) return VLC_EGENERIC;
-
- vlc_object_lock( p_intf );
- if( p_intf->b_dead )
- {
- vlc_object_unlock( p_intf );
- return VLC_EGENERIC;
- }
-
- if( !p_intf->pf_control_window )
- {
- msg_Err( p_vout, "no pf_control_window");
- vlc_object_unlock( p_intf );
- return VLC_EGENERIC;
- }
-
- i_ret = p_intf->pf_control_window( p_intf, p_window, i_query, args );
- vlc_object_unlock( p_intf );
- return i_ret;
+ (void)p_vout; (void)p_window; (void)i_query; (void)args;
}
/*****************************************************************************