Commit 03198bb4 authored by Erwan Tulou's avatar Erwan Tulou Committed by Jean-Baptiste Kempf

snapshot vout plugin: avoid variables conflicting with the core

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 49f85e90
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
* keep a cache of low-res snapshots. * keep a cache of low-res snapshots.
* The snapshot structure is defined in include/snapshot.h * The snapshot structure is defined in include/snapshot.h
* In order to access the current snapshot cache, object variables are used: * In order to access the current snapshot cache, object variables are used:
* snapshot-list-pointer : the pointer on the first element in the list * vout-snapshot-list-pointer : the pointer on the first element in the list
* snapshot-datasize : size of a snapshot * vout-snapshot-datasize : size of a snapshot
* (also available in snapshot_t->i_datasize) * (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 * It is used for the moment by the CORBA module and a specialized
* python-vlc binding. * python-vlc binding.
...@@ -84,10 +84,10 @@ vlc_module_begin () ...@@ -84,10 +84,10 @@ vlc_module_begin ()
set_subcategory( SUBCAT_VIDEO_VOUT ) set_subcategory( SUBCAT_VIDEO_VOUT )
set_capability( "video output", 1 ) set_capability( "video output", 1 )
add_integer( "snapshot-width", 320, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, false ) add_integer( "vout-snapshot-width", 320, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, false )
add_integer( "snapshot-height", 200, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, false ) add_integer( "vout-snapshot-height", 200, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, false )
add_string( "snapshot-chroma", "RV32", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true ) add_string( "vout-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-cache-size", 50, NULL, CACHE_TEXT, CACHE_LONGTEXT, true )
set_callbacks( Create, Destroy ) set_callbacks( Create, Destroy )
vlc_module_end () vlc_module_end ()
...@@ -128,11 +128,11 @@ static int Create( vlc_object_t *p_this ) ...@@ -128,11 +128,11 @@ static int Create( vlc_object_t *p_this )
if( ! p_vout->p_sys ) if( ! p_vout->p_sys )
return VLC_ENOMEM; return VLC_ENOMEM;
var_Create( p_vout, "snapshot-width", VLC_VAR_INTEGER ); var_Create( p_vout, "vout-snapshot-width", VLC_VAR_INTEGER );
var_Create( p_vout, "snapshot-height", VLC_VAR_INTEGER ); var_Create( p_vout, "vout-snapshot-height", VLC_VAR_INTEGER );
var_Create( p_vout, "snapshot-datasize", VLC_VAR_INTEGER ); var_Create( p_vout, "vout-snapshot-datasize", VLC_VAR_INTEGER );
var_Create( p_vout, "snapshot-cache-size", VLC_VAR_INTEGER ); var_Create( p_vout, "vout-snapshot-cache-size", VLC_VAR_INTEGER );
var_Create( p_vout, "snapshot-list-pointer", VLC_VAR_ADDRESS ); var_Create( p_vout, "vout-snapshot-list-pointer", VLC_VAR_ADDRESS );
p_vout->pf_init = Init; p_vout->pf_init = Init;
p_vout->pf_end = End; p_vout->pf_end = End;
...@@ -157,15 +157,15 @@ static int Init( vout_thread_t *p_vout ) ...@@ -157,15 +157,15 @@ static int Init( vout_thread_t *p_vout )
int i_height; int i_height;
int i_datasize; int i_datasize;
i_width = config_GetInt( p_vout, "snapshot-width" ); i_width = config_GetInt( p_vout, "vout-snapshot-width" );
i_height = config_GetInt( p_vout, "snapshot-height" ); 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( psz_chroma )
{ {
if( strlen( psz_chroma ) < 4 ) 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; return VLC_EGENERIC;
} }
i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1], i_chroma = VLC_FOURCC( psz_chroma[0], psz_chroma[1],
...@@ -258,11 +258,11 @@ static int Init( vout_thread_t *p_vout ) ...@@ -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_datasize = i_datasize;
p_vout->p_sys->i_index = 0; 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 ) 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; return VLC_EGENERIC;
} }
...@@ -293,17 +293,17 @@ static int Init( vout_thread_t *p_vout ) ...@@ -293,17 +293,17 @@ static int Init( vout_thread_t *p_vout )
} }
val.i_int = i_width; 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; 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; 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; 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; 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) */ /* Get the p_input pointer (to access video times) */
p_vout->p_sys->p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, 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 ) ...@@ -312,9 +312,9 @@ static int Init( vout_thread_t *p_vout )
if( !p_vout->p_sys->p_input ) if( !p_vout->p_sys->p_input )
return VLC_ENOOBJ; 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 ); p_vout->p_sys->p_input );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -322,9 +322,9 @@ static int Init( vout_thread_t *p_vout ) ...@@ -322,9 +322,9 @@ static int Init( vout_thread_t *p_vout )
/* Register the snapshot vout module at the input level */ /* Register the snapshot vout module at the input level */
val.p_address = p_vout; 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 ); p_vout->p_sys->p_input );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -350,12 +350,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -350,12 +350,12 @@ static void Destroy( vlc_object_t *p_this )
vout_thread_t *p_vout = ( vout_thread_t * )p_this; vout_thread_t *p_vout = ( vout_thread_t * )p_this;
int i_index; 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 ); vlc_object_release( p_vout->p_sys->p_input );
var_Destroy( p_this, "snapshot-width" ); var_Destroy( p_this, "vout-snapshot-width" );
var_Destroy( p_this, "snapshot-height" ); var_Destroy( p_this, "vout-snapshot-height" );
var_Destroy( p_this, "snapshot-datasize" ); var_Destroy( p_this, "vout-snapshot-datasize" );
for( i_index = 0 ; i_index < p_vout->p_sys->i_size ; i_index++ ) for( i_index = 0 ; i_index < p_vout->p_sys->i_size ; i_index++ )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment