+#define POS_TEXT N_("Logo position")
+#define POS_LONGTEXT N_( \
+ "Enforce the logo position on the video " \
+ "(0=center, 1=left, 2=right, 4=top, 8=bottom, you can " \
+ "also use combinations of these values, eg 6 = top-right).")
+
+#define CFG_PREFIX "logo-"
+
+static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
+static const char *const ppsz_pos_descriptions[] =
+{ N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
+ N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
+
+vlc_module_begin ()
+ set_capability( "sub filter", 0 )
+ set_callbacks( CreateFilter, DestroyFilter )
+ set_description( N_("Logo sub filter") )
+ set_shortname( N_("Logo overlay") )
+ set_category( CAT_VIDEO )
+ set_subcategory( SUBCAT_VIDEO_SUBPIC )
+ add_shortcut( "logo" )
+
+ add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false )
+ add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, true )
+ add_integer( CFG_PREFIX "y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, true )
+ /* default to 1000 ms per image, continuously cycle through them */
+ add_integer( CFG_PREFIX "delay", 1000, NULL, DELAY_TEXT, DELAY_LONGTEXT, true )
+ add_integer( CFG_PREFIX "repeat", -1, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, true )
+ add_integer_with_range( CFG_PREFIX "transparency", 255, 0, 255, NULL,
+ TRANS_TEXT, TRANS_LONGTEXT, false )
+ add_integer( CFG_PREFIX "position", -1, NULL, POS_TEXT, POS_LONGTEXT, false )
+ change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL )
+
+ /* video output filter submodule */
+ add_submodule ()
+ set_capability( "video filter", 0 )
+ set_callbacks( Create, Destroy )
+ set_description( N_("Logo video filter") )
+vlc_module_end ()
+
+static const char *const ppsz_filter_options[] = {
+ "file", "x", "y", "delay", "repeat", "transparency", "position", NULL
+};
+
+/*****************************************************************************
+ * Structure to hold the set of individual logo image names, times,
+ * transparencies
+ ****************************************************************************/
+typedef struct
+{
+ char *psz_file; /* candidate for deletion -- not needed */
+ int i_delay; /* -1 means use default delay */
+ int i_alpha; /* -1 means use default alpha */
+ picture_t *p_pic;
+
+} logo_t;
+
+/*****************************************************************************
+ * Logo list structure. Common to both the vout and sub picture filter
+ ****************************************************************************/
+typedef struct
+{
+ logo_t *p_logo; /* the parsing's result */
+ unsigned int i_count; /* the number of logo images to be displayed */
+
+ int i_repeat; /* how often to repeat the images, image time in ms */
+ mtime_t i_next_pic; /* when to bring up a new logo image */
+
+ unsigned int i_counter; /* index into the list of logo images */
+
+ int i_delay; /* default delay (0 - 60000 ms) */
+ int i_alpha; /* default alpha */
+
+ char *psz_filename; /* --logo-file string ( is it really useful
+ * to store it ? ) */