[vlc-devel] commit: Adding a libvlc_media_add_option_flag (Hugo Beauzee-Luyssen )

git version control git at videolan.org
Tue Jun 23 18:04:38 CEST 2009


vlc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Fri Jun 19 00:05:50 2009 +0200| [f4ad8d4d0b07ae7d82c387b27a3f2c138fc1b981] | committer: Rémi Denis-Courmont 

Adding a libvlc_media_add_option_flag

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4ad8d4d0b07ae7d82c387b27a3f2c138fc1b981
---

 bindings/cil/src/libvlc.cs     |   11 +++++++++--
 include/vlc/libvlc_media.h     |   12 ++++++++++--
 projects/activex/plugin.cpp    |    2 +-
 projects/mozilla/vlcplugin.cpp |    2 +-
 src/control/media.c            |    8 ++++----
 src/libvlc.sym                 |    2 +-
 6 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/bindings/cil/src/libvlc.cs b/bindings/cil/src/libvlc.cs
index bacaf78..89bad69 100644
--- a/bindings/cil/src/libvlc.cs
+++ b/bindings/cil/src/libvlc.cs
@@ -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")]
diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
index 18fcd21..a67778d 100644
--- a/include/vlc/libvlc_media.h
+++ b/include/vlc/libvlc_media.h
@@ -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 );
 
 
diff --git a/projects/activex/plugin.cpp b/projects/activex/plugin.cpp
index 0d63f57..f299258 100644
--- a/projects/activex/plugin.cpp
+++ b/projects/activex/plugin.cpp
@@ -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);
diff --git a/projects/mozilla/vlcplugin.cpp b/projects/mozilla/vlcplugin.cpp
index 552d6fd..0ed4a19 100644
--- a/projects/mozilla/vlcplugin.cpp
+++ b/projects/mozilla/vlcplugin.cpp
@@ -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);
diff --git a/src/control/media.c b/src/control/media.c
index 566ce11..4b3ee38 100644
--- a/src/control/media.c
+++ b/src/control/media.c
@@ -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
  **************************************************************************/
diff --git a/src/libvlc.sym b/src/libvlc.sym
index b8ae128..cfffb3b 100644
--- a/src/libvlc.sym
+++ b/src/libvlc.sym
@@ -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




More information about the vlc-devel mailing list