[vlc-devel] commit: dynamicoverlay: We need a commanddesc_static_t for non strdup() -ed initializer. (Pierre d'Herbemont )

git version control git at videolan.org
Fri Aug 21 00:07:41 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Fri Aug 21 00:07:11 2009 +0200| [456fa63530470956d0e4f2906211857d168f40fb] | committer: Pierre d'Herbemont 

dynamicoverlay: We need a commanddesc_static_t for non strdup()-ed initializer.

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

 .../video_filter/dynamicoverlay/dynamicoverlay.h   |   23 ++++++++++++++-----
 .../dynamicoverlay/dynamicoverlay_commands.c       |    2 +-
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.h b/modules/video_filter/dynamicoverlay/dynamicoverlay.h
index e0818d5..e905838 100644
--- a/modules/video_filter/dynamicoverlay/dynamicoverlay.h
+++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.h
@@ -71,18 +71,29 @@ typedef struct commandparams_t
     bool b_visible; /*< visibility flag of overlay */
 } commandparams_t;
 
+typedef int (*parser_func_t)(char *psz_command, char *psz_end, commandparams_t *p_params );
+typedef int (*execute_func_t)( filter_t *p_filter, const commandparams_t *p_params, commandparams_t *p_results );
+typedef int (*unparse_func_t)( const commandparams_t *p_results, buffer_t *p_output );
+
 typedef struct commanddesc_t
 {
     char *psz_command;
     bool b_atomic;
-    int ( *pf_parser ) ( char *psz_command, char *psz_end,
-                         commandparams_t *p_params );
-    int ( *pf_execute ) ( filter_t *p_filter, const commandparams_t *p_params,
-                          commandparams_t *p_results );
-    int ( *pf_unparse ) ( const commandparams_t *p_results,
-                          buffer_t *p_output );
+    parser_func_t pf_parser;
+    execute_func_t pf_execute;
+    unparse_func_t pf_unparse;
 } commanddesc_t;
 
+typedef struct commanddesc_static_t
+{
+    const char *psz_command;
+    bool b_atomic;
+    parser_func_t pf_parser;
+    execute_func_t pf_execute;
+    unparse_func_t pf_unparse;
+} commanddesc_static_t;
+
+
 typedef struct command_t
 {
     struct commanddesc_t *p_command;
diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
index cee57f1..f8697f2 100644
--- a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
+++ b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
@@ -792,7 +792,7 @@ static int exec_StartAtomic( filter_t *p_filter,
 /*****************************************************************************
  * Command functions
  *****************************************************************************/
-static const commanddesc_t p_commands[] =
+static const commanddesc_static_t p_commands[] =
 {
     {   .psz_command = "DataSharedMem",
         .b_atomic = true,




More information about the vlc-devel mailing list