Added es_format_InitFromVideo helper.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 29 Jun 2009 20:41:14 +0000 (22:41 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 1 Jul 2009 19:24:35 +0000 (21:24 +0200)
include/vlc_es.h
src/libvlccore.sym
src/misc/es_format.c

index 3a98214..ec5c822 100644 (file)
@@ -287,6 +287,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.
  */
index ac07e09..aeaa2e9 100644 (file)
@@ -122,6 +122,7 @@ EnsureUTF8
 es_format_Clean
 es_format_Copy
 es_format_Init
+es_format_InitFromVideo
 es_format_IsSimilar
 filename_sanitize
 filter_Blend
index 201b004..5f502a3 100644 (file)
@@ -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;