]> git.sesse.net Git - vlc/commitdiff
Method for adding vlc-options to a VLCMedia
authorRune Botten <rbotten@gmail.com>
Fri, 17 Dec 2010 21:00:30 +0000 (22:00 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 19 Dec 2010 14:46:27 +0000 (15:46 +0100)
--0016e64f6886ef58a30497a17561
Content-Type: text/plain; charset=ISO-8859-1

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Sources/VLCMedia.m

index 52954fbb296404a90fb7c61a13bc645117a16caf..13223325a22d4b3bf3966471ef6d10c896720465 100644 (file)
@@ -332,4 +332,15 @@ extern NSString *VLCMediaTracksInformationTypeUnknown;
  */
 - (void)parse;
 
+/**************************************************************************
+ * Add options to the media, that will be used to determine how
+ * VLCMediaPlayer will read the media. This allow to use VLC advanced
+ * reading/streaming options in a per-media basis
+ *
+ * The options are detailed in vlc --long-help, for instance "--sout-all"
+ * And on the web: http://wiki.videolan.org/VLC_command-line_help
+
+**************************************************************************/
+- (void) addOptions:(NSDictionary*) options;
+
 @end
index 5f6fec57881cf3337ec1829c4e689a672eb86cf7..958591eda295cba70c49b830aa7ee95515826c1c 100644 (file)
@@ -324,6 +324,20 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
     libvlc_media_parse_async(p_md);
 }
 
+- (void)addOptions:(NSDictionary*)options
+{
+    if (p_md)
+    {
+        for (NSString * key in [options allKeys])
+        {
+            if ([options objectForKey:key] != [NSNull null])
+                libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@=%@", key, [options objectForKey:key]] UTF8String]);
+            else
+                libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@", key] UTF8String]);
+        }
+    }
+}
+
 NSString *VLCMediaTracksInformationCodec = @"codec"; // NSNumber
 NSString *VLCMediaTracksInformationId    = @"id";    // NSNumber
 NSString *VLCMediaTracksInformationType  = @"type";  // NSString