]> git.sesse.net Git - vlc/commitdiff
Adding a libvlc_media_add_option_flag
authorHugo Beauzee-Luyssen <beauze.h@gmail.com>
Thu, 18 Jun 2009 22:05:50 +0000 (00:05 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 23 Jun 2009 16:00:09 +0000 (19:00 +0300)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
bindings/cil/src/libvlc.cs
include/vlc/libvlc_media.h
projects/activex/plugin.cpp
projects/mozilla/vlcplugin.cpp
src/control/media.c
src/libvlc.sym

index bacaf7813723ec3f9a7a169b5ca151d33d00d7b3..89bad696aed31d422afa1e6dfe740cefb8bba97b 100644 (file)
@@ -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")]
index 18fcd216d4e5e2bc0319f7082848d18d456b468a..a67778d98aba5b90a81fa9e6843375f44049236f 100644 (file)
@@ -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 );
 
 
index 0d63f57affb9367a69aead04ee9d627f3e844ed8..f299258d3cb160af3c6749a7247a687fe1f3472e 100644 (file)
@@ -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);
index 552d6fdad43fb9a780a511f1e6f5e19b90094110..0ed4a19a9e6483a1e2b13d9d1c0ee978e668e194 100644 (file)
@@ -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);
index 566ce11b24b1a2aac6e4a45531946b00b78378c9..4b3ee382b6e54e66f360762dc0f7d0fbd88b55a1 100644 (file)
@@ -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
  **************************************************************************/
index b8ae1287fa15f3e04db04e86a8fb121371c27ab6..cfffb3b78aab7eacbde83ed0d41b0ca725a9c366 100644 (file)
@@ -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