[vlc-commits] [Git][videolan/vlc][master] 2 commits: bonjour: add input type selection per protocol
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Aug 19 23:25:52 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
36a225b9 by Felix Paul Kühne at 2026-08-19T18:05:42+00:00
bonjour: add input type selection per protocol
Some discovery protocols expose services as streams rather than
directories. Allowing each protocol to specify its input type ensures
the appropriate input item is created during service discovery. This is
required for protocols such as NDI, which discover stream services
directly.
Counter-part of 42039f5b in !9712
- - - - -
3b6d1b0b by Felix Paul Kühne at 2026-08-19T18:05:42+00:00
bonjour: add support for discovering NDI sources
Counter-part of ae57ad4a in !7396
- - - - -
1 changed file:
- modules/services_discovery/bonjour.m
Changes:
=====================================
modules/services_discovery/bonjour.m
=====================================
@@ -1,7 +1,7 @@
/*****************************************************************************
* bonjour.m: mDNS services discovery module based on Bonjour
*****************************************************************************
- * Copyright (C) 2016 VLC authors, VideoLAN and VideoLabs
+ * Copyright (C) 2016-2026 VLC authors, VideoLAN and VideoLabs
*
* Authors: Felix Paul Kühne <fkuehne at videolan.org>
* Marvin Scholz <epirat07 at gmail.com>
@@ -79,6 +79,7 @@ vlc_module_end()
NSString *const VLCBonjourProtocolName = @"VLCBonjourProtocolName";
NSString *const VLCBonjourProtocolServiceName = @"VLCBonjourProtocolServiceName";
NSString *const VLCBonjourProtocolModules = @"VLCBonjourProtocolModules";
+NSString *const VLCBonjourInputType = @"VLCBonjourInputType";
NSString *const VLCBonjourIsRenderer = @"VLCBonjourIsRenderer";
NSString *const VLCBonjourRendererFlags = @"VLCBonjourRendererFlags";
NSString *const VLCBonjourRendererDemux = @"VLCBonjourRendererDemux";
@@ -184,39 +185,52 @@ static NSString * ipAddressAsStringForData(NSData * data)
NSDictionary *VLCFtpProtocol = @{ VLCBonjourProtocolName : @"ftp",
VLCBonjourProtocolServiceName : @"_ftp._tcp.",
VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourProtocolModules : @[@"ftp"]
};
NSDictionary *VLCSmbProtocol = @{ VLCBonjourProtocolName : @"smb",
VLCBonjourProtocolServiceName : @"_smb._tcp.",
VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourProtocolModules : @[@"dsm", @"smb2"]
};
NSDictionary *VLCNfsProtocol = @{ VLCBonjourProtocolName : @"nfs",
VLCBonjourProtocolServiceName : @"_nfs._tcp.",
VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourProtocolModules : @[@"nfs"]
};
NSDictionary *VLCSftpProtocol = @{ VLCBonjourProtocolName : @"sftp",
VLCBonjourProtocolServiceName: @"_sftp-ssh._tcp.",
VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourProtocolModules : @[@"sftp"]
};
NSDictionary *VLCWebDavProtocol = @{ VLCBonjourProtocolName : @"webdav",
VLCBonjourProtocolServiceName: @"_webdav._tcp.",
VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourProtocolModules : @[@"webdav"]
};
NSDictionary *VLCWebDavsProtocol = @{ VLCBonjourProtocolName : @"webdavs",
VLCBonjourProtocolServiceName: @"_webdavs._tcp.",
VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourProtocolModules : @[@"webdavs"]
};
NSDictionary *VLCCastProtocol = @{ VLCBonjourProtocolName : @"chromecast",
VLCBonjourProtocolServiceName: @"_googlecast._tcp.",
VLCBonjourIsRenderer : @(YES),
+ VLCBonjourInputType : @(ITEM_TYPE_DIRECTORY),
VLCBonjourRendererFlags : @(VLC_RENDERER_CAN_AUDIO),
VLCBonjourRendererDemux : @"cc_demux"
};
+ NSDictionary *VLCNdiProtocol = @{ VLCBonjourProtocolName : @"ndi",
+ VLCBonjourProtocolServiceName : @"_ndi._tcp.",
+ VLCBonjourIsRenderer : @(NO),
+ VLCBonjourInputType : @(ITEM_TYPE_STREAM),
+ VLCBonjourProtocolModules : @[@"noidea"]
+ };
NSArray *VLCSupportedProtocols = @[VLCFtpProtocol,
VLCSmbProtocol,
@@ -224,7 +238,8 @@ static NSString * ipAddressAsStringForData(NSData * data)
VLCSftpProtocol,
VLCWebDavProtocol,
VLCWebDavsProtocol,
- VLCCastProtocol];
+ VLCCastProtocol,
+ VLCNdiProtocol];
_rawNetServices = [[NSMutableArray alloc] init];
_resolvedNetServices = [[NSMutableArray alloc] init];
@@ -334,16 +349,18 @@ static NSString * ipAddressAsStringForData(NSData * data)
if (![_resolvedNetServices containsObject:aNetService]) {
NSString *serviceType = aNetService.type;
NSString *protocol = nil;
+ enum input_item_type_e inputType = ITEM_TYPE_DIRECTORY;
for (NSDictionary *protocolDefinition in _activeProtocols) {
if ([serviceType isEqualToString:[protocolDefinition objectForKey:VLCBonjourProtocolServiceName]]) {
protocol = [protocolDefinition objectForKey:VLCBonjourProtocolName];
+ inputType = [[protocolDefinition objectForKey:VLCBonjourInputType] intValue];
}
}
if (_isRendererDiscovery) {
[self addResolvedRendererItem:aNetService withProtocol:protocol];
} else {
- [self addResolvedInputItem:aNetService withProtocol:protocol];
+ [self addResolvedInputItem:aNetService withProtocol:protocol inputType:inputType];
}
}
@@ -422,7 +439,7 @@ static NSString * ipAddressAsStringForData(NSData * data)
}
}
-- (void)addResolvedInputItem:(NSNetService *)netService withProtocol:(NSString *)protocol
+- (void)addResolvedInputItem:(NSNetService *)netService withProtocol:(NSString *)protocol inputType:(enum input_item_type_e)inputType
{
services_discovery_t *p_sd = (services_discovery_t *)_p_this;
NSString *host = netService.hostName;
@@ -436,7 +453,11 @@ static NSString * ipAddressAsStringForData(NSData * data)
components.port = @(netService.port);
NSString *uri = components.URL.absoluteString;
- input_item_t *p_input_item = input_item_NewDirectory([uri UTF8String], [netService.name UTF8String], ITEM_NET );
+ input_item_t *p_input_item;
+ if (inputType == ITEM_TYPE_STREAM)
+ p_input_item = input_item_NewStream([uri UTF8String], [netService.name UTF8String], INPUT_DURATION_UNSET );
+ else
+ p_input_item = input_item_NewDirectory([uri UTF8String], [netService.name UTF8String], ITEM_NET );
if (p_input_item != NULL) {
services_discovery_AddItem(p_sd, p_input_item);
[_inputItemsForNetServices addObject:[NSValue valueWithPointer:p_input_item]];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3ec4ead2a0138c76b05c9275ec3a4d61359a4920...3b6d1b0bd87cc1aa8bda5b6599a58e4688e20072
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3ec4ead2a0138c76b05c9275ec3a4d61359a4920...3b6d1b0bd87cc1aa8bda5b6599a58e4688e20072
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list