Changeset 138da1916eef4f4d0e30883a8c1ac999c355aca9
- Timestamp:
- 06/20/08 15:40:27 (3 months ago)
- git-parent:
- Files:
-
- include/vlc_interface.h (modified) (1 diff)
- modules/gui/qt4/components/interface_widgets.cpp (modified) (1 diff)
- modules/gui/qt4/main_interface.cpp (modified) (4 diffs)
- src/interface/interface.c (modified) (1 diff)
- src/video_output/vout_intf.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_interface.h
rfbb8255 r138da19 69 69 bool b_interaction; 70 70 71 /** Video window callbacks */72 void * ( *pf_request_window ) ( intf_thread_t *, vout_thread_t *,73 int *, int *,74 unsigned int *, unsigned int * );75 void ( *pf_release_window ) ( intf_thread_t *, void * );76 int ( *pf_control_window ) ( intf_thread_t *, void *, int, va_list );77 78 71 /* XXX: new message passing stuff will go here */ 79 72 vlc_mutex_t change_lock; modules/gui/qt4/components/interface_widgets.cpp
rc49d121 r138da19 53 53 * This class handles resize issues 54 54 **********************************************************************/ 55 static void *DoRequest( intf_thread_t *, vout_thread_t *, int*,int*,56 unsigned int *, unsigned int * );57 static void DoRelease( intf_thread_t *, void * );58 static int DoControl( intf_thread_t *, void *, int, va_list );59 55 60 56 VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i ) modules/gui/qt4/main_interface.cpp
r99c1a25 r138da19 77 77 static int InteractCallback( vlc_object_t *, const char *, vlc_value_t, 78 78 vlc_value_t, void *); 79 /* Video handling */80 static void *DoRequest( intf_thread_t *p_intf, vout_thread_t *p_vout,81 int *pi1, int *pi2, unsigned int*pi3,unsigned int*pi4)82 {83 return p_intf->p_sys->p_mi->requestVideo( p_vout, pi1, pi2, pi3, pi4 );84 }85 86 static void *DoNotEmbeddedRequest( intf_thread_t *p_intf, vout_thread_t *p_vout,87 int *pi1, int *pi2, unsigned int*pi3,unsigned int*pi4)88 {89 p_intf->p_sys->p_mi->requestNotEmbeddedVideo( p_vout );90 return NULL;91 }92 93 static void DoRelease( intf_thread_t *p_intf, void *p_win )94 {95 return p_intf->p_sys->p_mi->releaseVideo( p_win );96 }97 98 static int DoControl( intf_thread_t *p_intf, void *p_win, int i_q, va_list a )99 {100 return p_intf->p_sys->p_mi->controlVideo( p_win, i_q, a );101 }102 79 103 80 MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) … … 312 289 var_DelCallback( p_intf, "interaction", InteractCallback, this ); 313 290 314 p_intf->pf_request_window = NULL;315 p_intf->pf_release_window = NULL;316 p_intf->pf_control_window = NULL;317 291 p_intf->p_sys->p_mi = NULL; 318 292 } … … 464 438 mainLayout->insertWidget( 0, videoWidget ); 465 439 466 p_intf->pf_request_window = ::DoRequest;467 p_intf->pf_release_window = ::DoRelease;468 p_intf->pf_control_window = ::DoControl;469 440 } 470 441 else 471 442 { 472 p_intf->pf_request_window = ::DoNotEmbeddedRequest;473 443 } 474 444 … … 746 716 videoWidget->hide(); 747 717 748 if( bgWidget )// W ORONG718 if( bgWidget )// WRONG 749 719 bgWidget->show(); 750 720 src/interface/interface.c
r57c3ecd r138da19 94 94 if( !p_intf ) 95 95 return NULL; 96 p_intf->pf_request_window = NULL;97 p_intf->pf_release_window = NULL;98 p_intf->pf_control_window = NULL;99 96 p_intf->b_interaction = false; 100 97 p_intf->b_should_run_on_first_thread = false; src/video_output/vout_intf.c
rfc56db9 r138da19 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2007 the VideoLAN team 5 * $Id$6 5 * 7 6 * Authors: Gildas Bazin <gbazin@videolan.org> … … 88 87 unsigned int *pi_height_hint ) 89 88 { 90 intf_thread_t *p_intf = NULL;91 vlc_list_t *p_list;92 void *p_window;93 vlc_value_t val;94 int i;95 96 89 /* Small kludge */ 97 90 if( !var_Type( p_vout, "aspect-ratio" ) ) vout_IntfInit( p_vout ); … … 108 101 if( drawable ) return (void *)(intptr_t)drawable; 109 102 110 #if 0111 /* FIXME:112 * This code is utter crap w.r.t. threading. And it has always been.113 * First, one cannot invoke callbacks from another thread's object.114 * Not without a well-defined locking convention.115 *116 * Second, this would need to "wait" for the interface to be ready.117 * Otherwise, the availability of the embded window would become118 * time-dependent.119 *120 * In the past, this kind of things worked by accident. This time is over.121 * -- Courmisch, 12 Jun 2008122 */123 /* Find if the main interface supports embedding */124 p_list = vlc_list_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE );125 if( !p_list ) return NULL;126 127 for( i = 0; i < p_list->i_count; i++ )128 {129 p_intf = (intf_thread_t *)p_list->p_values[i].p_object;130 if( p_intf->pf_request_window ) break;131 p_intf = NULL;132 }133 134 if( !p_intf )135 {136 vlc_list_release( p_list );137 return NULL;138 }139 140 vlc_object_yield( p_intf );141 vlc_list_release( p_list );142 143 p_window = p_intf->pf_request_window( p_intf, p_vout, pi_x_hint, pi_y_hint,144 pi_width_hint, pi_height_hint );145 146 if( !p_window ) vlc_object_release( p_intf );147 else p_vout->p_parent_intf = p_intf;148 149 return p_window;150 #else151 103 return NULL; 152 #endif153 104 } 154 105 155 106 void vout_ReleaseWindow( vout_thread_t *p_vout, void *p_window ) 156 107 { 157 intf_thread_t *p_intf = p_vout->p_parent_intf; 158 159 if( !p_intf ) return; 160 161 vlc_object_lock( p_intf ); 162 if( p_intf->b_dead ) 163 { 164 vlc_object_unlock( p_intf ); 165 return; 166 } 167 168 if( !p_intf->pf_release_window ) 169 { 170 msg_Err( p_vout, "no pf_release_window"); 171 vlc_object_unlock( p_intf ); 172 vlc_object_release( p_intf ); 173 return; 174 } 175 176 p_intf->pf_release_window( p_intf, p_window ); 177 178 p_vout->p_parent_intf = NULL; 179 vlc_object_unlock( p_intf ); 180 vlc_object_release( p_intf ); 108 (void)p_vout; (void)p_window; 181 109 } 182 110 … … 184 112 int i_query, va_list args ) 185 113 { 186 intf_thread_t *p_intf = p_vout->p_parent_intf; 187 int i_ret; 188 189 if( !p_intf ) return VLC_EGENERIC; 190 191 vlc_object_lock( p_intf ); 192 if( p_intf->b_dead ) 193 { 194 vlc_object_unlock( p_intf ); 195 return VLC_EGENERIC; 196 } 197 198 if( !p_intf->pf_control_window ) 199 { 200 msg_Err( p_vout, "no pf_control_window"); 201 vlc_object_unlock( p_intf ); 202 return VLC_EGENERIC; 203 } 204 205 i_ret = p_intf->pf_control_window( p_intf, p_window, i_query, args ); 206 vlc_object_unlock( p_intf ); 207 return i_ret; 114 (void)p_vout; (void)p_window; (void)i_query; (void)args; 208 115 } 209 116
