[vlc-devel] commit: Remove the broken window embedding core code ( Rémi Denis-Courmont )
git version control
git at videolan.org
Fri Jun 20 15:41:47 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Fri Jun 20 14:17:45 2008 +0300| [138da1916eef4f4d0e30883a8c1ac999c355aca9]
Remove the broken window embedding core code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=138da1916eef4f4d0e30883a8c1ac999c355aca9
---
include/vlc_interface.h | 7 --
modules/gui/qt4/components/interface_widgets.cpp | 4 -
modules/gui/qt4/main_interface.cpp | 32 +-------
src/interface/interface.c | 3 -
src/video_output/vout_intf.c | 97 +---------------------
5 files changed, 3 insertions(+), 140 deletions(-)
diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index 8564a7b..aa44ee3 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -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;
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index a085216..d5cdcf6 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -52,10 +52,6 @@
* 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 )
{
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index f3b7515..0611c1a 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -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();
diff --git a/src/interface/interface.c b/src/interface/interface.c
index cfbea2f..eeda226 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -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;
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 2457bbd..b572823 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -2,7 +2,6 @@
* vout_intf.c : video output interface
*****************************************************************************
* Copyright (C) 2000-2007 the VideoLAN team
- * $Id$
*
* Authors: Gildas Bazin <gbazin at 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;
}
/*****************************************************************************
More information about the vlc-devel
mailing list