]> git.sesse.net Git - vlc/commitdiff
Remove libvlc_set_video_drawable, libvlc_video_set_parent offers the same functionality
authorFilippo Carone <littlejohn@videolan.org>
Fri, 3 Nov 2006 22:06:14 +0000 (22:06 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Fri, 3 Nov 2006 22:06:14 +0000 (22:06 +0000)
bindings/java/src/graphics-jni.cc
bindings/java/src/video-jni.cc
include/vlc/libvlc.h
src/control/video.c

index 6627feccde5f58dbe00b483a8c56d41eb6bbfb2f..634aca727ef2b01e855e3cd7b1c1e2434b8f25c1 100644 (file)
@@ -97,7 +97,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
 
   drawable = reinterpret_cast<int>(dsi_win->hwnd);
   long vlcInstance = getJVLCInstance( env, canvas );
-  libvlc_set_video_drawable( (libvlc_instance_t *) vlcInstance, drawable, exception );
+  libvlc_video_set_parent( (libvlc_instance_t *) vlcInstance, drawable, exception );
 
 #else // UNIX
   /* Get the platform-specific drawing info */
@@ -109,7 +109,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
   
   drawable = dsi_x11->drawable;
   long vlcInstance = getJVLCInstance( env, canvas );
-  libvlc_set_video_drawable( (libvlc_instance_t *)vlcInstance, drawable, exception );
+  libvlc_video_set_parent( (libvlc_instance_t *)vlcInstance, drawable, exception );
 
   XFreeGC(dsi_x11->display, gc);
 
index 0700d8ed53009ecd438495774e2a9a654b263bbe..161b52dd08361dbefd4aaa9bf2ed118e9fcb3e51 100644 (file)
@@ -133,6 +133,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
     
     GET_INPUT_THREAD ;
 
+    libvlc_drawable_t drawable;
+
     JAWT awt;
     JAWT_DrawingSurface* ds;
     JAWT_DrawingSurfaceInfo* dsi;
@@ -144,8 +146,6 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
 #endif    
     jint lock;
     
-    vlc_value_t value;
-
     /* Get the AWT */
     awt.version = JAWT_VERSION_1_3;
     if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
@@ -181,15 +181,12 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
 #ifdef WIN32
     /* Get the platform-specific drawing info */
     dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
+    drawable = reinterpret_cast<int>(dsi_win->hwnd);
 
-    libvlc_video_reparent( input, (libvlc_drawable_t)dsi_win->hwnd, exception );
+    libvlc_video_reparent( input, drawable, exception );
 
     CHECK_EXCEPTION_FREE ;
     
-    /* Now paint */
-    value.i_int = reinterpret_cast<int>(dsi_win->hwnd); 
-    VLC_VariableSet( 1, "drawable", value );
-
 #else // UNIX
     /* Get the platform-specific drawing info */
 
@@ -200,14 +197,11 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
     XSetBackground(dsi_x11->display, gc, 0);
 
     /* and reparent */
-    libvlc_video_reparent( input, (libvlc_drawable_t)dsi_x11->drawable, exception );
+    drawable = dsi_x11->drawable;
+    libvlc_video_reparent( input, drawable, exception );
 
     CHECK_EXCEPTION_FREE ;
 
-    /* also update the drawable variable value */
-    value.i_int = dsi_x11->drawable;
-    VLC_VariableSet( 0, "drawable", value );
-    
     XFreeGC(dsi_x11->display, gc);
 
 #endif
index 40e0ec3fa312c228fb6114153bbca02eccc5572f..10a8b7400dd1418bfc9b8e6e971c05c177e5aee1 100644 (file)
@@ -297,14 +297,6 @@ typedef int libvlc_drawable_t;
 vlc_bool_t  libvlc_input_has_vout       ( libvlc_input_t *, libvlc_exception_t *);
 float       libvlc_input_get_fps        ( libvlc_input_t *, libvlc_exception_t *);
 
-/**
- * Toggle fullscreen status on video output
- * \param p_input the input
- * \param drawable the drawable where the video output thread will display the video
- * \param p_exception an initialized exception
- */
-void libvlc_set_video_drawable( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t *);
-    
 /**
  * Toggle fullscreen status on video output
  * \param p_input the input
index fd176cb0ad94c235c6846ca5df674ef92ea4e2a2..1f7aaf763836f1bfd7d5bcea15177c19105b4450 100644 (file)
@@ -69,18 +69,6 @@ static vout_thread_t *GetVout( libvlc_input_t *p_input,
  * Exported functions
  **********************************************************************/
 
-void libvlc_set_video_drawable( libvlc_instance_t *p_instance,
-                                libvlc_drawable_t drawable,
-                                libvlc_exception_t *p_e )
-{
-    vlc_value_t value;
-    value.i_int = drawable;
-    
-    var_Set( p_instance->p_libvlc_int, "drawable", value);
-}
-
-
-
 void libvlc_set_fullscreen( libvlc_input_t *p_input, int b_fullscreen,
                             libvlc_exception_t *p_e )
 {
@@ -226,6 +214,13 @@ int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d,
                            libvlc_exception_t *p_e )
 {
     vout_thread_t *p_vout = GetVout( p_input, p_e );
+
+    if ( p_vout == NULL)
+    {
+        /// \todo: set exception
+        return 0;
+    }
+    
     vout_Control( p_vout , VOUT_REPARENT, d);
     vlc_object_release( p_vout );
 
@@ -242,7 +237,7 @@ void libvlc_video_resize( libvlc_input_t *p_input, int width, int height, libvlc
 /* global video settings */
 
 void libvlc_video_set_parent( libvlc_instance_t *p_instance, libvlc_drawable_t d,
-                           libvlc_exception_t *p_e )
+                              libvlc_exception_t *p_e )
 {
     /* set as default for future vout instances */
     var_SetInteger(p_instance->p_libvlc_int, "drawable", (int)d);