]> git.sesse.net Git - vlc/commitdiff
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 ef625b3b3c025941105b557298ae0fb17dba85b0..a016575ab5b21c59de6c03424c3dfb24d4f5e647 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 368f7d5b8b58403847e94b448fa5997a1ba20e1a..5d125e060c846151fae6c2fd5175ebe6a3153594 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 e220268f3979ebfbe8b3e3f54ed0589caa32e5ae..67f0e5c3b8678fb0efcd87721b15418f891cccf1 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 919e94e62793bfc1b9f5a6152999035929643d34..da41364859ffc3226154a883450ce5f50564c80a 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 bf6bb52266d368e735df6fb5f87c83b05e580559..016c2ff5d97d2fc71295bc3e85e1f7a9682aa316 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 a314050b73e804e434ae8eec9baf19d9424e0c6e..9d9d8a08ab82660681fb722a94309be068557b2f 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 b38e215c61ec821d04ed47fe52f7bf7709b6c161..7192d9f26ea24a156b9b4be46d10030e419476e1 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 eda2d7f07092737e780aed0b7fa0ccb4450487c9..1d4a8ba70aa53f0a111ec677d7e487638940d751 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 a87c101523fe6d1feac9720d1742cbe15ac0fcde..9d0455c55767913590ca6462fbe6794aa8860acf 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 a8eee2c9b0ce0c21f58816effdad965dc7e44ab8..e367817b717b095b793690ed7906e13f371c7957 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 aeec730bdc30289a3b511113f96f31b2238f1a74..6db6d57538b0ba64b3078759fdb0aa3ff4c690de 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 3e7bdddb0dda293e0d1e41cbef3c80fcd5d8e1df..3d888f22a382f996eaef0b5a1972889b74caa320 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 bddbf187a846b05bafc32c6e1eaf6719d6e7a5ce..e0837c6bb4d8bc8da3a2e5aeafb37d3035b80ffc 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 );
 }
 
 /* */