]> git.sesse.net Git - vlc/blobdiff - src/video_output/vout_intf.c
events: Add wrappers around vlc_event_manager_init for object casting.
[vlc] / src / video_output / vout_intf.c
index c5270dfe84d8048ff972257131ec264fc2319f5d..279bd9faa2b53801c8572f568700eb6b85a76c4b 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 
 #include <stdio.h>
 #include <stdlib.h>                                                /* free() */
@@ -107,6 +107,19 @@ void *vout_RequestWindow( vout_thread_t *p_vout,
     var_Get( p_vout->p_libvlc, "drawable", &val );
     if( val.i_int ) return (void *)(intptr_t)val.i_int;
 
+#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;
@@ -134,6 +147,9 @@ void *vout_RequestWindow( vout_thread_t *p_vout,
     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 )
@@ -505,7 +521,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
 
         /* Destination object-id is following object: */
         i_id = atoi( &val.psz_string[7] );
-        p_dest = ( vlc_object_t* )vlc_current_object( i_id );
+        p_dest = ( vlc_object_t* )vlc_object_get( i_id );
         if( !p_dest )
         {
             msg_Err( p_vout, "Cannot find calling object" );