X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fsnapshot.c;h=9ad89fa63aeccc24b4b6324e45980f93fa4ed60a;hb=630076053112b47b2f6279b1e67a4031d2ca45b2;hp=b33796d2fc90d3129cb87f4ee0ff9d229d0b0b80;hpb=dc8b128a9f34d9eb75d3158566cbb95df8bae61b;p=vlc diff --git a/modules/video_output/snapshot.c b/modules/video_output/snapshot.c index b33796d2fc..9ad89fa63a 100644 --- a/modules/video_output/snapshot.c +++ b/modules/video_output/snapshot.c @@ -22,12 +22,12 @@ *****************************************************************************/ /***************************************************************************** - * This module is a pseudo video output the offers the possibility to + * This module is a pseudo video output that offers the possibility to * 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 + * snapshot-datasize : size of a snapshot * (also available in snapshot_t->i_datasize) * snapshot-cache-size : size of the cache list * @@ -38,12 +38,16 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include -#include -#include -#include +#include +#include +#include +#include /***************************************************************************** * Local prototypes @@ -52,6 +56,7 @@ static int Create ( vlc_object_t * ); static void Destroy ( vlc_object_t * ); static int Init ( vout_thread_t * ); +static void End ( vout_thread_t * ); static void Display ( vout_thread_t *, picture_t * ); /***************************************************************************** @@ -79,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, VLC_FALSE ); - add_integer( "snapshot-height", 200, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_FALSE ); - add_string( "snapshot-chroma", "RV32", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, VLC_TRUE ); - add_integer( "snapshot-cache-size", 50, NULL, CACHE_TEXT, CACHE_LONGTEXT, VLC_TRUE ); + 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 ); set_callbacks( Create, Destroy ); vlc_module_end(); @@ -120,7 +125,7 @@ static int Create( vlc_object_t *p_this ) var_Create( p_vout, "snapshot-list-pointer", VLC_VAR_ADDRESS ); p_vout->pf_init = Init; - p_vout->pf_end = NULL; + p_vout->pf_end = End; p_vout->pf_manage = NULL; p_vout->pf_render = NULL; p_vout->pf_display = Display; @@ -314,6 +319,14 @@ static int Init( vout_thread_t *p_vout ) return VLC_SUCCESS; } +/***************************************************************************** + * End: terminate video thread output method + *****************************************************************************/ +static void End( vout_thread_t *p_vout ) +{ + (void)p_vout; +} + /***************************************************************************** * Destroy: destroy video thread ***************************************************************************** @@ -324,13 +337,13 @@ 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" ); + 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->p_libvlc_global, "snapshot-id" ); - for( i_index = 0 ; i_index < p_vout->p_sys->i_size ; i_index++ ) { free( p_vout->p_sys->p_list[ i_index ]->p_data ); @@ -370,9 +383,8 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic ) i_index = p_vout->p_sys->i_index; - p_vout->p_libvlc->pf_memcpy( p_vout->p_sys->p_list[i_index]->p_data, - p_pic->p->p_pixels, - p_vout->p_sys->i_datasize ); + vlc_memcpy( p_vout->p_sys->p_list[i_index]->p_data, p_pic->p->p_pixels, + p_vout->p_sys->i_datasize ); i_date = snapshot_GetMovietime( p_vout );