[vlc-devel] commit: Added es_format_InitFromVideo helper. (Laurent Aimar )

git version control git at videolan.org
Wed Jul 1 21:28:56 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jun 29 22:41:14 2009 +0200| [8a5c9258d14f1b22245ea4fdb76736d27d0a13bb] | committer: Laurent Aimar 

Added es_format_InitFromVideo helper.

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

 include/vlc_es.h     |    5 +++++
 src/libvlccore.sym   |    1 +
 src/misc/es_format.c |    6 ++++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 3a98214..ec5c822 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -288,6 +288,11 @@ VLC_EXPORT( void, video_format_FixRgb, ( video_format_t * ) );
 VLC_EXPORT( void, es_format_Init, ( es_format_t *, int i_cat, vlc_fourcc_t i_codec ) );
 
 /**
+ * This function will initialize a es_format_t structure from a video_format_t.
+ */
+VLC_EXPORT( void, es_format_InitFromVideo, ( es_format_t *, const video_format_t * ) );
+
+/**
  * This functions will copy a es_format_t.
  */
 VLC_EXPORT( int, es_format_Copy, ( es_format_t *p_dst, const es_format_t *p_src ) );
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index ac07e09..aeaa2e9 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -122,6 +122,7 @@ EnsureUTF8
 es_format_Clean
 es_format_Copy
 es_format_Init
+es_format_InitFromVideo
 es_format_IsSimilar
 filename_sanitize
 filter_Blend
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 201b004..5f502a3 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -258,6 +258,12 @@ void es_format_Init( es_format_t *fmt,
     fmt->p_extra                = NULL;
 }
 
+void es_format_InitFromVideo( es_format_t *p_es, const video_format_t *p_fmt )
+{
+    es_format_Init( p_es, VIDEO_ES, p_fmt->i_chroma );
+    video_format_Copy( &p_es->video, p_fmt );
+}
+
 int es_format_Copy( es_format_t *dst, const es_format_t *src )
 {
     int i;




More information about the vlc-devel mailing list