]> git.sesse.net Git - vlc/commitdiff
Remove the broken window embedding core code
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Fri, 20 Jun 2008 11:17:45 +0000 (14:17 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Fri, 20 Jun 2008 13:40:27 +0000 (16:40 +0300)
include/vlc_interface.h
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/main_interface.cpp
src/interface/interface.c
src/video_output/vout_intf.c

index 8564a7b2232a1c5dd0efa833f7971f6610d7e997..aa44ee37085f5503adfeafe22fe97dfe7d557620 100644 (file)
@@ -68,13 +68,6 @@ struct intf_thread_t
     /** Interaction stuff */
     bool b_interaction;
 
-    /** Video window callbacks */
-    void * ( *pf_request_window ) ( intf_thread_t *, vout_thread_t *,
-                                    int *, int *,
-                                    unsigned int *, unsigned int * );
-    void   ( *pf_release_window ) ( intf_thread_t *, void * );
-    int    ( *pf_control_window ) ( intf_thread_t *, void *, int, va_list );
-
     /* XXX: new message passing stuff will go here */
     vlc_mutex_t  change_lock;
     bool   b_menu_change;
index a0852168a32c934a1dd6cc7210ab05ce789843d3..d5cdcf6b0adc45046d0830e87ff0c30ab2df1360 100644 (file)
  * Video Widget. A simple frame on which video is drawn
  * This class handles resize issues
  **********************************************************************/
-static void *DoRequest( intf_thread_t *, vout_thread_t *, int*,int*,
-                        unsigned int *, unsigned int * );
-static void DoRelease( intf_thread_t *, void * );
-static int DoControl( intf_thread_t *, void *, int, va_list );
 
 VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
 {
index f3b7515c55ee9376e4f3a074d07ab0bb029c4273..0611c1a8123d13e13c677c91e8bdd65598a0a1bf 100644 (file)
@@ -76,29 +76,6 @@ static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable,
                        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 )
 {
@@ -311,9 +288,6 @@ MainInterface::~MainInterface()
     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;
 }
 
@@ -463,13 +437,9 @@ void MainInterface::handleMainUi( QSettings *settings )
         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 */
@@ -745,7 +715,7 @@ void MainInterface::releaseVideoSlot( void *p_win )
     videoWidget->release( p_win );
     videoWidget->hide();
 
-    if( bgWidget )// WORONG
+    if( bgWidget )// WRONG
         bgWidget->show();
 
     adjustSize();
index cfbea2fb6995cfb455c2aaf60f246ecbe14ef273..eeda2263b4724238eab80b38bc09a80a5be2ed84 100644 (file)
@@ -93,9 +93,6 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module )
     p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF );
     if( !p_intf )
         return NULL;
-    p_intf->pf_request_window = NULL;
-    p_intf->pf_release_window = NULL;
-    p_intf->pf_control_window = NULL;
     p_intf->b_interaction = false;
     p_intf->b_should_run_on_first_thread = false;
 
index 2457bbd14c79cc1a58a28dc7b6b3cb894d9d5a3f..b5728235eb2ec391a4921efed53a47d90767340f 100644 (file)
@@ -2,7 +2,6 @@
  * vout_intf.c : video output interface
  *****************************************************************************
  * Copyright (C) 2000-2007 the VideoLAN team
- * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *
@@ -87,12 +86,6 @@ void *vout_RequestWindow( vout_thread_t *p_vout,
                           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 );
 
@@ -107,104 +100,18 @@ void *vout_RequestWindow( vout_thread_t *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;
 }
 
 /*****************************************************************************