Commit 517177b0 authored by Felix Paul Kühne's avatar Felix Paul Kühne

media discoverer: allow use of a custom VLCLibrary instance

parent 9d43485a
......@@ -53,6 +53,12 @@
*/
- (instancetype)initWithName:(NSString *)aServiceName;
/**
* same as above but with a custom VLCLibrary instance
* \note Using this mode can lead to a significant performance impact - use only if you know what you are doing
*/
- (instancetype)initWithName:(NSString *)aServiceName libraryInstance:(VLCLibrary *)libraryInstance;
/**
* start media discovery
* \returns -1 if start failed, otherwise 0
......
......@@ -51,12 +51,21 @@
}
- (instancetype)initWithName:(NSString *)aServiceName
{
return [self initWithName:aServiceName libraryInstance:nil];
}
- (instancetype)initWithName:(NSString *)aServiceName libraryInstance:(VLCLibrary *)libraryInstance
{
if (self = [super init]) {
_localizedName = nil;
_discoveredMedia = nil;
_privateLibrary = [VLCLibrary sharedLibrary];
if (libraryInstance != nil) {
_privateLibrary = libraryInstance;
} else {
_privateLibrary = [VLCLibrary sharedLibrary];
}
libvlc_retain([_privateLibrary instance]);
_mdis = libvlc_media_discoverer_new([_privateLibrary instance],
......
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