I must recant my last comment. I was successful in retrieving custom properties on both Device and Stream using the following code:
const CMIOExtensionProperty CMIOExtensionPropertyCustomPropertyData_just = @"4cc_just_glob_0000";
const CMIOExtensionProperty CMIOExtensionPropertyCustomPropertyData_dust = @"4cc_dust_glob_0000";
const CMIOExtensionProperty CMIOExtensionPropertyCustomPropertyData_rust = @"4cc_rust_glob_0000";
+ (NSMutableDictionary*)sampleCustomPropertiesWithPropertySet:(NSSet<CMIOExtensionProperty>*)properties {
NSMutableDictionary* dictionary = [NSMutableDictionary dictionary];
if ([properties containsObject:CMIOExtensionPropertyCustomPropertyData_just]) {
CMIOExtensionPropertyState* propertyState = [CMIOExtensionPropertyState propertyStateWithValue:@"Property value for 'just'"];
[dictionary setValue:propertyState forKey:CMIOExtensionPropertyCustomPropertyData_just];
}
if ([properties containsObject:CMIOExtensionPropertyCustomPropertyData_dust]) {
const size_t sData_length = 12;
static const unsigned char sData[sData_length] = { 0xFE,0xED,0xFE,0xED, 0xFE,0xED,0xFE,0xED, 0xFE,0xED,0xFE,0xED };
CMIOExtensionPropertyState* propertyState = [CMIOExtensionPropertyState propertyStateWithValue:[NSData dataWithBytes:sData length:sData_length]];
[dictionary setValue:propertyState forKey:CMIOExtensionPropertyCustomPropertyData_dust];
}
if ([properties containsObject:CMIOExtensionPropertyCustomPropertyData_rust]) {
NSString* propertyValue = [NSString stringWithFormat:@"Custom property value for property '%@'.", CMIOExtensionPropertyCustomPropertyData_rust ];
CMIOExtensionPropertyState* propertyState = [CMIOExtensionPropertyState propertyStateWithValue:propertyValue];
[dictionary setValue:propertyState forKey:CMIOExtensionPropertyCustomPropertyData_rust];
}
return dictionary;
}
Then for CMIOExtensionDeviceSource, I passed the custom property values as a dictionary to the initializer:
- (NSSet<CMIOExtensionProperty> *)availableProperties {
return [NSSet setWithObjects:
CMIOExtensionPropertyDeviceTransportType,
CMIOExtensionPropertyDeviceModel,
CMIOExtensionPropertyCustomPropertyData_just,
CMIOExtensionPropertyCustomPropertyData_dust,
CMIOExtensionPropertyCustomPropertyData_rust,
nil];
}
- (nullable CMIOExtensionDeviceProperties *)devicePropertiesForProperties:(NSSet<CMIOExtensionProperty> *)properties
error:(NSError * _Nullable *)outError {
NSMutableDictionary* dictionary = [self sampleCustomPropertiesWithPropertySet:properties];
CMIOExtensionDeviceProperties *deviceProperties = [CMIOExtensionDeviceProperties devicePropertiesWithDictionary:dictionary];
And for CMIOExtensionStreamSource:
- (NSSet<CMIOExtensionProperty> *)availableProperties {
return [NSSet setWithObjects:
CMIOExtensionPropertyStreamActiveFormatIndex,
CMIOExtensionPropertyStreamFrameDuration,
CMIOExtensionPropertyCustomPropertyData_just,
CMIOExtensionPropertyCustomPropertyData_dust,
CMIOExtensionPropertyCustomPropertyData_rust,
nil];
}
- (nullable CMIOExtensionStreamProperties *)streamPropertiesForProperties:(NSSet<CMIOExtensionProperty> *)properties
error:(NSError * _Nullable *)outError {
NSMutableDictionary* dictionary = [self sampleCustomPropertiesWithPropertySet:properties];
CMIOExtensionStreamProperties* streamProperties = [CMIOExtensionStreamProperties streamPropertiesWithDictionary:dictionary];
This error message below is not related to the actual format of the key, the error is regarding the format of the propertyState (ie. the data associated with the key).
CMIO_DAL_CMIOExtension_Stream.mm:1165:GetPropertyData 50 wrong 4cc format for key 4cc_cust_glob_0000
I haven't tried on the Ventura beta but on 12.4 I am in the practice of rebooting after every update to my extension. If you're having problems it might be due to the fact that an old instance of your extension is being used by the system.