vout: Rename vout_Destroy to vout_CloseAndDestroy.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 17 Jul 2008 21:03:08 +0000 (23:03 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 17 Jul 2008 22:18:16 +0000 (00:18 +0200)
13 files changed:
include/vlc_vout.h
modules/video_filter/clone.c
modules/video_filter/crop.c
modules/video_filter/deinterlace.c
modules/video_filter/logo.c
modules/video_filter/magnify.c
modules/video_filter/opencv_wrapper.c
modules/video_filter/panoramix.c
modules/video_filter/puzzle.c
modules/video_filter/transform.c
modules/video_filter/wall.c
src/libvlccore.sym
src/video_output/video_output.c

index ef625b3..a016575 100644 (file)
@@ -536,7 +536,8 @@ struct vout_thread_t
  *
  * You can call vout_Request on a vout created by vout_Create or by a previous
  * call to vout_Request.
- * You can release the returned value either by vout_Request or vout_Destroy.
+ * You can release the returned value either by vout_Request or vout_Close()
+ * followed by a vlc_object_release() or shorter vout_CloseAndRelease()
  *
  * \param p_this a vlc object
  * \param p_vout a vout candidate
@@ -560,11 +561,26 @@ VLC_EXPORT( vout_thread_t *, __vout_Request,    ( vlc_object_t *p_this, vout_thr
 VLC_EXPORT( vout_thread_t *, __vout_Create,       ( vlc_object_t *p_this, video_format_t *p_fmt ) );
 
 /**
- * This function will destroy a vout created by vout_Create or vout_Request.
+ * This function will close a vout created by vout_Create or vout_Request.
+ * The associated vout module is closed.
+ * Note: It is not released yet, you'll have to call vlc_object_release()
+ * or use the convenient vout_CloseAndRelease().
  *
- * \param p_vout the vout to destroy
+ * \param p_vout the vout to close
  */
-VLC_EXPORT( void,            vout_Destroy,        ( vout_thread_t *p_vout ) );
+VLC_EXPORT( void,            vout_Close,        ( vout_thread_t *p_vout ) );
+
+/**
+ * This function will close a vout created by vout_Create
+ * and then release it.
+ *
+ * \param p_vout the vout to close and release
+ */
+static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
+{
+    vout_Close( p_vout );
+    vlc_object_release( p_vout );
+}
 
 /* */
 VLC_EXPORT( int,             vout_ChromaCmp,      ( uint32_t, uint32_t ) );
index 368f7d5..5d125e0 100644 (file)
@@ -387,7 +387,7 @@ static void RemoveAllVout( vout_thread_t *p_vout )
          --p_vout->p_sys->i_clones;
          DEL_CALLBACKS( p_vout->p_sys->pp_vout[p_vout->p_sys->i_clones],
                         SendEvents );
-         vout_Destroy( p_vout->p_sys->pp_vout[p_vout->p_sys->i_clones] );
+         vout_CloseAndRelease( p_vout->p_sys->pp_vout[p_vout->p_sys->i_clones] );
     }
 }
 
index e220268..67f0e5c 100644 (file)
@@ -412,7 +412,7 @@ static void End( vout_thread_t *p_vout )
     }
 
     if( p_vout->p_sys->p_vout )
-        vout_Destroy( p_vout->p_sys->p_vout );
+        vout_CloseAndRelease( p_vout->p_sys->p_vout );
 }
 
 /*****************************************************************************
@@ -456,7 +456,7 @@ static int Manage( vout_thread_t *p_vout )
     if( p_vout->p_sys->p_vout )
     {
         DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
-        vout_Destroy( p_vout->p_sys->p_vout );
+        vout_CloseAndRelease( p_vout->p_sys->p_vout );
     }
 
     fmt.i_width = fmt.i_visible_width = p_vout->p_sys->i_width;
index 919e94e..da41364 100644 (file)
@@ -433,7 +433,7 @@ static void End( vout_thread_t *p_vout )
     }
 
     if( p_vout->p_sys->p_vout )
-        vout_Destroy( p_vout->p_sys->p_vout );
+        vout_CloseAndRelease( p_vout->p_sys->p_vout );
 }
 
 /*****************************************************************************
@@ -2063,7 +2063,7 @@ static int FilterCallback( vlc_object_t *p_this, char const *psz_cmd,
     if( p_vout->p_sys->p_vout )
     {
         DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
-        vout_Destroy( p_vout->p_sys->p_vout );
+        vout_CloseAndRelease( p_vout->p_sys->p_vout );
     }
 
     /* Try to open a new video output */
index bf6bb52..016c2ff 100644 (file)
@@ -489,7 +489,7 @@ static void End( vout_thread_t *p_vout )
     var_DelCallback( p_sys->p_vout, "mouse-x", MouseEvent, p_vout);
     var_DelCallback( p_sys->p_vout, "mouse-y", MouseEvent, p_vout);
 
-    vout_Destroy( p_sys->p_vout );
+    vout_CloseAndRelease( p_sys->p_vout );
 
     if( p_sys->p_blend->p_module )
         module_Unneed( p_sys->p_blend, p_sys->p_blend->p_module );
index a314050..9d9d8a0 100644 (file)
@@ -201,7 +201,7 @@ static void End( vout_thread_t *p_vout )
     var_DelCallback( p_vout->p_sys->p_vout, "mouse-y", MouseEvent, p_vout);
     var_DelCallback( p_vout->p_sys->p_vout, "mouse-clicked", MouseEvent, p_vout);
 
-    vout_Destroy( p_vout->p_sys->p_vout );
+    vout_CloseAndRelease( p_vout->p_sys->p_vout );
 }
 
 /*****************************************************************************
index b38e215..7192d9f 100644 (file)
@@ -395,7 +395,7 @@ static void End( vout_thread_t *p_vout )
         p_vout->p_sys->p_opencv = NULL;
     }
 
-    vout_Destroy( p_vout->p_sys->p_vout )
+    vout_CloseAndRelease( p_vout->p_sys->p_vout )
 }
 
 /*****************************************************************************
index eda2d7f..1d4a8ba 100644 (file)
@@ -1903,7 +1903,7 @@ static void RemoveAllVout( vout_thread_t *p_vout )
              DEL_CALLBACKS(
                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout,
                  SendEvents );
-             vout_Destroy( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
+             vout_CloseAndRelease( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
          }
     }
 }
index a87c101..9d0455c 100644 (file)
@@ -304,7 +304,7 @@ static void End( vout_thread_t *p_vout )
     var_DelCallback( p_vout->p_sys->p_vout, "mouse-y", MouseEvent, p_vout);
     var_DelCallback( p_vout->p_sys->p_vout, "mouse-clicked", MouseEvent, p_vout);
 
-    vout_Destroy( p_vout->p_sys->p_vout );
+    vout_CloseAndRelease( p_vout->p_sys->p_vout );
 }
 
 #define SHUFFLE_WIDTH 81
index a8eee2c..e367817 100644 (file)
@@ -287,7 +287,7 @@ static void End( vout_thread_t *p_vout )
         free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
     }
 
-    vout_Destroy( p_vout->p_sys->p_vout );
+    vout_CloseAndRelease( p_vout->p_sys->p_vout );
 }
 
 /*****************************************************************************
index aeec730..6db6d57 100644 (file)
@@ -584,7 +584,7 @@ static void RemoveAllVout( vout_thread_t *p_vout )
              DEL_CALLBACKS(
                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout,
                  SendEvents );
-             vout_Destroy( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
+             vout_CloseAndRelease( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
          }
     }
 }
index 3e7bddd..3d888f2 100644 (file)
@@ -478,10 +478,10 @@ vlm_MessageNew
 __vlm_New
 __vout_AllocatePicture
 vout_ChromaCmp
+vout_Close
 vout_ControlWindow
 __vout_CopyPicture
 __vout_Create
-vout_Destroy
 vout_CreatePicture
 vout_DatePicture
 vout_DestroyPicture
index bddbf18..e0837c6 100644 (file)
@@ -129,7 +129,7 @@ vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
          * TODO: support for reusing video outputs with proper _thread-safe_
          * reference handling. */
         if( p_vout )
-            vout_Destroy( p_vout );
+            vout_CloseAndRelease( p_vout );
         return NULL;
     }
 
@@ -441,7 +441,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     if( p_vout->b_error )
     {
         msg_Err( p_vout, "video output creation failed" );
-        vout_Destroy( p_vout );
+        vout_CloseAndRelease( p_vout );
         return NULL;
     }
 
@@ -449,20 +449,20 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
 }
 
 /*****************************************************************************
- * vout_Destroy: destroys a vout created by vout_Create.
+ * vout_Close: Close a vout created by vout_Create.
  *****************************************************************************
- * You HAVE to call it on vout created by vout_Create. You should NEVER call
- * it on vout not obtained though vout_Create (like with vout_Request or
- * vlc_object_find.)
+ * You HAVE to call it on vout created by vout_Create before vlc_object_release.
+ * You should NEVER call it on vout not obtained though vout_Create
+ * (like with vout_Request or vlc_object_find.)
+ * You can use vout_CloseAndRelease() as a convenient method.
  *****************************************************************************/
-void vout_Destroy( vout_thread_t *p_vout )
+void vout_Close( vout_thread_t *p_vout )
 {
     assert( p_vout );
 
     vlc_object_kill( p_vout );
     vlc_thread_join( p_vout );
     module_Unneed( p_vout, p_vout->p_module );
-    vlc_object_release( p_vout );
 }
 
 /* */