Commit f4ad8d4d authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen Committed by Rémi Denis-Courmont

Adding a libvlc_media_add_option_flag

Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent d83c47ab
......@@ -34,6 +34,12 @@ namespace VideoLAN.LibVLC
* @brief Native: unmanaged LibVLC APIs
* @ingroup Internals
*/
internal enum MediaOptionFlag
{
OptionTrusted = 0x2,
OptionUnique = 0x100,
};
internal static class LibVLC
{
/* Where is the run-time?
......@@ -101,9 +107,10 @@ namespace VideoLAN.LibVLC
NativeException ex);
[DllImport (lib,
EntryPoint="libvlc_media_add_option_untrusted")]
EntryPoint="libvlc_media_add_option_flag")]
public static extern
void MediaAddUntrustedOption (MediaHandle media, U8String options,
void MediaAddOptionWithFlag (MediaHandle media, U8String options,
MediaOptionFlag flag,
NativeException ex);
[DllImport (lib, EntryPoint="libvlc_media_release")]
......
......@@ -93,6 +93,12 @@ typedef enum libvlc_state_t
libvlc_Error
} libvlc_state_t;
typedef enum libvlc_media_option_t
{
libvlc_media_option_trusted = 0x2,
libvlc_media_option_unique = 0x100
} libvlc_media_option_t;
/**
* Create a media with the given MRL.
*
......@@ -137,7 +143,7 @@ VLC_PUBLIC_API void libvlc_media_add_option(
const char * ppsz_options,
libvlc_exception_t * p_e );
/**
* Add an option to the media from an untrusted source.
* Add an option to the media with configurable flags.
*
* This option will be used to determine how the media_player will
* read the media. This allows to use VLC's advanced
......@@ -147,11 +153,13 @@ VLC_PUBLIC_API void libvlc_media_add_option(
*
* \param p_instance the instance
* \param ppsz_options the options (as a string)
* \param i_flags the flags for this option
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_media_add_option_untrusted(
VLC_PUBLIC_API void libvlc_media_add_option_flag(
libvlc_media_t * p_md,
const char * ppsz_options,
libvlc_media_option_t i_flags,
libvlc_exception_t * p_e );
......
......@@ -1069,7 +1069,7 @@ int VLCPlugin::playlist_add_extended_untrusted(const char *mrl, int optc, const
for( int i = 0; i < optc; ++i )
{
libvlc_media_add_option_untrusted(p_m, optv[i],ex);
libvlc_media_add_option_flag(p_m, optv[i], libvlc_media_option_unique, ex);
if( libvlc_exception_raised(ex) )
{
libvlc_media_release(p_m);
......
......@@ -322,7 +322,7 @@ int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *nam
for( int i = 0; i < optc; ++i )
{
libvlc_media_add_option_untrusted(p_m, optv[i],ex);
libvlc_media_add_option_flag(p_m, optv[i], libvlc_media_option_unique, ex);
if( libvlc_exception_raised(ex) )
{
libvlc_media_release(p_m);
......
......@@ -361,19 +361,19 @@ void libvlc_media_add_option(
}
/**************************************************************************
* Same as libvlc_media_add_option but with untrusted source.
* Same as libvlc_media_add_option but with configurable flags.
**************************************************************************/
void libvlc_media_add_option_untrusted(
void libvlc_media_add_option_flag(
libvlc_media_t * p_md,
const char * ppsz_option,
libvlc_media_option_t i_flags,
libvlc_exception_t *p_e )
{
VLC_UNUSED(p_e);
input_item_AddOption( p_md->p_input_item, ppsz_option,
VLC_INPUT_OPTION_UNIQUE );
i_flags );
}
/**************************************************************************
* Delete a media descriptor object
**************************************************************************/
......
......@@ -49,7 +49,7 @@ libvlc_log_iterator_has_next
libvlc_log_iterator_next
libvlc_log_open
libvlc_media_add_option
libvlc_media_add_option_untrusted
libvlc_media_add_option_flag
libvlc_media_discoverer_event_manager
libvlc_media_discoverer_is_running
libvlc_media_discoverer_localized_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment