* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_interface.h>
"creating one file per image. In this case, " \
"the number is not appended to the filename." )
-static const char *psz_format_list[] = { "png", "jpeg" };
-static const char *psz_format_list_text[] = { "PNG", "JPEG" };
+static const char *const psz_format_list[] = { "png", "jpeg" };
+static const char *const psz_format_list_text[] = { "PNG", "JPEG" };
#define CFG_PREFIX "image-out-"
vlc_module_begin( );
- set_shortname( _( "Image file" ) );
- set_description( _( "Image video output" ) );
+ set_shortname( N_( "Image file" ) );
+ set_description( N_( "Image video output" ) );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VOUT );
set_capability( "video output", 0 );
add_string( CFG_PREFIX "format", "png", NULL,
- FORMAT_TEXT, FORMAT_LONGTEXT, VLC_FALSE );
+ FORMAT_TEXT, FORMAT_LONGTEXT, false );
change_string_list( psz_format_list, psz_format_list_text, 0 );
add_integer( CFG_PREFIX "width", 0, NULL,
- WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE );
+ WIDTH_TEXT, WIDTH_LONGTEXT, true );
add_deprecated_alias( "image-width" ); /* since 0.9.0 */
add_integer( CFG_PREFIX "height", 0, NULL,
- HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE );
+ HEIGHT_TEXT, HEIGHT_LONGTEXT, true );
add_deprecated_alias( "image-height" ); /* since 0.9.0 */
add_integer( CFG_PREFIX "ratio", 3, NULL,
- RATIO_TEXT, RATIO_LONGTEXT, VLC_FALSE );
+ RATIO_TEXT, RATIO_LONGTEXT, false );
add_string( CFG_PREFIX "prefix", "img", NULL,
- PREFIX_TEXT, PREFIX_LONGTEXT, VLC_FALSE );
+ PREFIX_TEXT, PREFIX_LONGTEXT, false );
add_bool( CFG_PREFIX "replace", 0, NULL,
- REPLACE_TEXT, REPLACE_LONGTEXT, VLC_FALSE );
+ REPLACE_TEXT, REPLACE_LONGTEXT, false );
set_callbacks( Create, Destroy );
vlc_module_end();
-static const char *ppsz_vout_options[] = {
+static const char *const ppsz_vout_options[] = {
"format", "width", "height", "ratio", "prefix", "replace", NULL
};
int i_current; /* Current image */
int i_frames; /* Number of frames */
- vlc_bool_t b_replace;
+ bool b_replace;
- vlc_bool_t b_time;
- vlc_bool_t b_meta;
+ bool b_time;
+ bool b_meta;
image_handler_t *p_image;
};
p_vout->p_sys->psz_prefix =
var_CreateGetString( p_this, CFG_PREFIX "prefix" );
p_vout->p_sys->b_time = strchr( p_vout->p_sys->psz_prefix, '%' )
- ? VLC_TRUE : VLC_FALSE;
+ ? true : false;
p_vout->p_sys->b_meta = strchr( p_vout->p_sys->psz_prefix, '$' )
- ? VLC_TRUE : VLC_FALSE;
+ ? true : false;
p_vout->p_sys->psz_format =
var_CreateGetString( p_this, CFG_PREFIX "format" );
p_vout->p_sys->i_width =
{
msg_Err( p_this, "unable to create image handler") ;
FREENULL( p_vout->p_sys->psz_prefix );
+ FREENULL( p_vout->p_sys->psz_format );
FREENULL( p_vout->p_sys );
return VLC_EGENERIC;
}
psz_prefix = psz_tmp;
psz_filename = (char *)malloc( 10 + strlen( psz_prefix )
+ strlen( p_vout->p_sys->psz_format ) );
+ if( !psz_filename )
+ return;
+
if( p_vout->p_sys->b_replace )
{
sprintf( psz_filename, "%s.%s", psz_prefix,
static void End( vout_thread_t *p_vout )
{
+ VLC_UNUSED(p_vout);
}