[vlc-commits] commit: Method for adding vlc-options to a VLCMedia (Rune Botten )
git at videolan.org
git at videolan.org
Sun Dec 19 15:47:04 CET 2010
vlc | branch: master | Rune Botten <rbotten at gmail.com> | Fri Dec 17 22:00:30 2010 +0100| [d722087d8e5367da64b747bae0f4780ad5fed291] | committer: Felix Paul Kühne
Method for adding vlc-options to a VLCMedia
--0016e64f6886ef58a30497a17561
Content-Type: text/plain; charset=ISO-8859-1
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d722087d8e5367da64b747bae0f4780ad5fed291
---
.../macosx/framework/Headers/Public/VLCMedia.h | 11 +++++++++++
projects/macosx/framework/Sources/VLCMedia.m | 14 ++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/projects/macosx/framework/Headers/Public/VLCMedia.h b/projects/macosx/framework/Headers/Public/VLCMedia.h
index 52954fb..1322332 100644
--- a/projects/macosx/framework/Headers/Public/VLCMedia.h
+++ b/projects/macosx/framework/Headers/Public/VLCMedia.h
@@ -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
diff --git a/projects/macosx/framework/Sources/VLCMedia.m b/projects/macosx/framework/Sources/VLCMedia.m
index 5f6fec5..958591e 100644
--- a/projects/macosx/framework/Sources/VLCMedia.m
+++ b/projects/macosx/framework/Sources/VLCMedia.m
@@ -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
More information about the vlc-commits
mailing list