From be0c992bbd0db8ad03e00ccec4dad3192dccf4b5 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Fri, 14 Dec 2007 14:33:06 +0000 Subject: [PATCH] control/media_descriptor.c: As requested by Jacques Boileau, allow options tuning from the media_descriptor class. This is done through libvlc_media_descriptor_add_option. --- include/vlc/libvlc.h | 15 +++++++++++++++ src/control/media_descriptor.c | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h index 64c17ba671..1e4a11e4d0 100644 --- a/include/vlc/libvlc.h +++ b/include/vlc/libvlc.h @@ -152,6 +152,21 @@ VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new( const char * psz_mrl, libvlc_exception_t *p_e ); +/** + * Add an option to the media descriptor, + * This option will be used to determine how the media_instance will + * read the media_descriptor. This allow to use VLC advanced + * reading/streaming options in a per-media basis. + * + * The options are detailled in vlc --long-help, for instance "--sout-all" + * \param p_instance the instance + * \param psz_mrl the mrl to read + */ +VLC_PUBLIC_API void libvlc_media_descriptor_add_option( + libvlc_media_descriptor_t * p_md, + const char * ppsz_options, + libvlc_exception_t * p_e ); + VLC_PUBLIC_API void libvlc_media_descriptor_retain( libvlc_media_descriptor_t *p_meta_desc ); diff --git a/src/control/media_descriptor.c b/src/control/media_descriptor.c index 6c7ecb9d42..63ef82443d 100644 --- a/src/control/media_descriptor.c +++ b/src/control/media_descriptor.c @@ -298,6 +298,23 @@ libvlc_media_descriptor_t * libvlc_media_descriptor_new( return p_md; } +/************************************************************************** + * Add an option to the media descriptor, + * that will be used to determine how the media_instance will read the + * media_descriptor. This allow to use VLC advanced reading/streaming + * options in a per-media basis + * + * The options are detailled in vlc --long-help, for instance "--sout-all" + **************************************************************************/ +void libvlc_media_descriptor_add_option( + libvlc_media_descriptor_t * p_md, + const char * ppsz_option, + libvlc_exception_t *p_e ) +{ + (void)p_e; + input_ItemAddOptionNoDup( p_md->p_input_item, ppsz_option ); +} + /************************************************************************** * Delete a media descriptor object **************************************************************************/