[vlc-devel] commit: snapshot vout plugin: avoid variables conflicting with the core ( Erwan Tulou )

git version control git at videolan.org
Tue May 26 02:12:54 CEST 2009


vlc | branch: master | Erwan Tulou <brezhoneg1 at yahoo.fr> | Mon May 25 22:00:35 2009 +0200| [03198bb4cd53269427d6ac17b847c9d696c21059] | committer: Jean-Baptiste Kempf 

snapshot vout plugin: avoid variables conflicting with the core

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03198bb4cd53269427d6ac17b847c9d696c21059
---

 modules/video_output/snapshot.c |   62 +++++++++++++++++++-------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/modules/video_output/snapshot.c b/modules/video_output/snapshot.c
index b5dce25..ca916da 100644
--- a/modules/video_output/snapshot.c
+++ b/modules/video_output/snapshot.c
@@ -26,10 +26,10 @@
  * keep a cache of low-res snapshots.
  * The snapshot structure is defined in include/snapshot.h
  * In order to access the current snapshot cache, object variables are used:
- *   snapshot-list-pointer : the pointer on the first element in the list
- *   snapshot-datasize     : size of a snapshot
+ *   vout-snapshot-list-pointer : the pointer on the first element in the list
+ *   vout-snapshot-datasize     : size of a snapshot
  *                           (also available in snapshot_t->i_datasize)
- *   snapshot-cache-size   : size of the cache list
+ *   vout-snapshot-cache-size   : size of the cache list
  *
  * It is used for the moment by the CORBA module and a specialized
  * python-vlc binding.
@@ -84,10 +84,10 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_VIDEO_VOUT )
     set_capability( "video output", 1 )
 
-    add_integer( "snapshot-width", 320, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, false )
-    add_integer( "snapshot-height", 200, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, false )
-    add_string( "snapshot-chroma", "RV32", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
-    add_integer( "snapshot-cache-size", 50, NULL, CACHE_TEXT, CACHE_LONGTEXT, true )
+    add_integer( "vout-snapshot-width", 320, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, false )
+    add_integer( "vout-snapshot-height", 200, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, false )
+    add_string( "vout-snapshot-chroma", "RV32", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
+    add_integer( "vout-snapshot-cache-size", 50, NULL, CACHE_TEXT, CACHE_LONGTEXT, true )
 
     set_callbacks( Create, Destroy )
 vlc_module_end ()
@@ -128,11 +128,11 @@ static int Create( vlc_object_t *p_this )
     if( ! p_vout->p_sys )
         return VLC_ENOMEM;
 
-    var_Create( p_vout, "snapshot-width", VLC_VAR_INTEGER );
-    var_Create( p_vout, "snapshot-height", VLC_VAR_INTEGER );
-    var_Create( p_vout, "snapshot-datasize", VLC_VAR_INTEGER );
-    var_Create( p_vout, "snapshot-cache-size", VLC_VAR_INTEGER );
-    var_Create( p_vout, "snapshot-list-pointer", VLC_VAR_ADDRESS );
+    var_Create( p_vout, "vout-snapshot-width", VLC_VAR_INTEGER );
+    var_Create( p_vout, "vout-snapshot-height", VLC_VAR_INTEGER );
+    var_Create( p_vout, "vout-snapshot-datasize", VLC_VAR_INTEGER );
+    var_Create( p_vout, "vout-snapshot-cache-size", VLC_VAR_INTEGER );
+    var_Create( p_vout, "vout-snapshot-list-pointer", VLC_VAR_ADDRESS );
 
     p_vout->pf_init = Init;
     p_vout->pf_end = End;
@@ -157,15 +157,15 @@ static int Init( vout_thread_t *p_vout )
     int i_height;
     int i_datasize;
 
-    i_width  = config_GetInt( p_vout, "snapshot-width" );
-    i_height = config_GetInt( p_vout, "snapshot-height" );
+    i_width  = config_GetInt( p_vout, "vout-snapshot-width" );
+    i_height = config_GetInt( p_vout, "vout-snapshot-height" );
 
-    psz_chroma = config_GetPsz( p_vout, "snapshot-chroma" );
+    psz_chroma = config_GetPsz( p_vout, "vout-snapshot-chroma" );
     if( psz_chroma )
     {
         if( strlen( psz_chroma ) < 4 )
         {
-            msg_Err( p_vout, "snapshot-chroma should be 4 characters long" );
+            msg_Err( p_vout, "vout-snapshot-chroma should be 4 characters long" );
             return VLC_EGENERIC;
         }
         i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
@@ -258,11 +258,11 @@ static int Init( vout_thread_t *p_vout )
 
     p_vout->p_sys->i_datasize = i_datasize;
     p_vout->p_sys->i_index = 0;
-    p_vout->p_sys->i_size = config_GetInt( p_vout, "snapshot-cache-size" );
+    p_vout->p_sys->i_size = config_GetInt( p_vout, "vout-snapshot-cache-size" );
 
     if( p_vout->p_sys->i_size < 2 )
     {
-        msg_Err( p_vout, "snapshot-cache-size must be at least 1." );
+        msg_Err( p_vout, "vout-snapshot-cache-size must be at least 1." );
         return VLC_EGENERIC;
     }
 
@@ -293,17 +293,17 @@ static int Init( vout_thread_t *p_vout )
     }
 
     val.i_int = i_width;
-    var_Set( p_vout, "snapshot-width", val );
+    var_Set( p_vout, "vout-snapshot-width", val );
     val.i_int = i_height;
-    var_Set( p_vout, "snapshot-height", val );
+    var_Set( p_vout, "vout-snapshot-height", val );
     val.i_int = i_datasize;
-    var_Set( p_vout, "snapshot-datasize", val );
+    var_Set( p_vout, "vout-snapshot-datasize", val );
 
     val.i_int = p_vout->p_sys->i_size;
-    var_Set( p_vout, "snapshot-cache-size", val );
+    var_Set( p_vout, "vout-snapshot-cache-size", val );
 
     val.p_address = p_vout->p_sys->p_list;
-    var_Set( p_vout, "snapshot-list-pointer", val );
+    var_Set( p_vout, "vout-snapshot-list-pointer", val );
 
     /* Get the p_input pointer (to access video times) */
     p_vout->p_sys->p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT,
@@ -312,9 +312,9 @@ static int Init( vout_thread_t *p_vout )
     if( !p_vout->p_sys->p_input )
         return VLC_ENOOBJ;
 
-    if( var_Create( p_vout->p_sys->p_input, "snapshot-id", VLC_VAR_INTEGER ) )
+    if( var_Create( p_vout->p_sys->p_input, "vout-snapshot-id", VLC_VAR_INTEGER ) )
     {
-        msg_Err( p_vout, "Cannot create snapshot-id variable in p_input(%p).",
+        msg_Err( p_vout, "Cannot create vout-snapshot-id variable in p_input(%p).",
                  p_vout->p_sys->p_input );
         return VLC_EGENERIC;
     }
@@ -322,9 +322,9 @@ static int Init( vout_thread_t *p_vout )
     /* Register the snapshot vout module at the input level */
     val.p_address = p_vout;
 
-    if( var_Set( p_vout->p_sys->p_input, "snapshot-id", val ) )
+    if( var_Set( p_vout->p_sys->p_input, "vout-snapshot-id", val ) )
     {
-        msg_Err( p_vout, "Cannot register snapshot-id in p_input(%p).",
+        msg_Err( p_vout, "Cannot register vout-snapshot-id in p_input(%p).",
                  p_vout->p_sys->p_input );
         return VLC_EGENERIC;
     }
@@ -350,12 +350,12 @@ static void Destroy( vlc_object_t *p_this )
     vout_thread_t *p_vout = ( vout_thread_t * )p_this;
     int i_index;
 
-    var_Destroy( p_vout->p_sys->p_input, "snapshot-id" );
+    var_Destroy( p_vout->p_sys->p_input, "vout-snapshot-id" );
 
     vlc_object_release( p_vout->p_sys->p_input );
-    var_Destroy( p_this, "snapshot-width" );
-    var_Destroy( p_this, "snapshot-height" );
-    var_Destroy( p_this, "snapshot-datasize" );
+    var_Destroy( p_this, "vout-snapshot-width" );
+    var_Destroy( p_this, "vout-snapshot-height" );
+    var_Destroy( p_this, "vout-snapshot-datasize" );
 
     for( i_index = 0 ; i_index < p_vout->p_sys->i_size ; i_index++ )
     {




More information about the vlc-devel mailing list