From 8a5c9258d14f1b22245ea4fdb76736d27d0a13bb Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Mon, 29 Jun 2009 22:41:14 +0200 Subject: [PATCH] Added es_format_InitFromVideo helper. --- include/vlc_es.h | 5 +++++ src/libvlccore.sym | 1 + src/misc/es_format.c | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/include/vlc_es.h b/include/vlc_es.h index 3a98214e26..ec5c8225e0 100644 --- a/include/vlc_es.h +++ b/include/vlc_es.h @@ -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. */ diff --git a/src/libvlccore.sym b/src/libvlccore.sym index ac07e0906e..aeaa2e95fe 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 201b004c67..5f502a31b4 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; -- 2.39.2