[vlc-devel] commit: Add video_format_{Copy, Init, Clean} inline functions and bump ABI. ( Jean-Paul Saman )
git version control
git at videolan.org
Wed Aug 27 14:48:24 CEST 2008
vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Tue Aug 12 18:10:27 2008 +0800| [5e7051c3d89b05592702ba7f4ba6bcfdfa5c7525] | committer: Jean-Paul Saman
Add video_format_{Copy,Init,Clean} inline functions and bump ABI.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5e7051c3d89b05592702ba7f4ba6bcfdfa5c7525
---
include/vlc_es.h | 28 ++++++++++++++++++++++++++++
include/vlc_plugin.h | 4 ++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/include/vlc_es.h b/include/vlc_es.h
index ad45797..b65e5ac 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -136,6 +136,34 @@ struct video_format_t
video_palette_t *p_palette; /**< video palette from demuxer */
};
+static inline void video_format_Init( video_format_t *p_src, vlc_fourcc_t i_chroma )
+{
+ memset( p_src, 0, sizeof( video_format_t ) );
+ p_src->i_chroma = i_chroma;
+ p_src->i_sar_num = p_src->i_sar_den = 1;
+ p_src->p_palette = NULL;
+}
+
+static inline int video_format_Copy( video_format_t *p_dst, video_format_t *p_src )
+{
+ memcpy( p_dst, p_src, sizeof( video_format_t ) );
+ if( p_src->p_palette )
+ {
+ p_dst->p_palette = (video_palette_t *) malloc( sizeof( video_palette_t ) );
+ if( !p_dst->p_palette )
+ return VLC_ENOMEM;
+ memcpy( p_dst->p_palette, p_src->p_palette, sizeof( video_palette_t ) );
+ }
+ return VLC_SUCCESS;
+};
+
+static inline void video_format_Clean( video_format_t *p_src )
+{
+ free( p_src->p_palette );
+ memset( p_src, 0, sizeof( video_format_t ) );
+ p_src->p_palette = NULL;
+}
+
/**
* subtitles format description
*/
diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index 364e53c..d6b810d 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -39,8 +39,8 @@
/**
* Current plugin ABI version
*/
-# define MODULE_SYMBOL 0_9_0m
-# define MODULE_SUFFIX "__0_9_0m"
+# define MODULE_SYMBOL 0_9_0n
+# define MODULE_SUFFIX "__0_9_0n"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
More information about the vlc-devel
mailing list