My question is about accessing the custom properties of provider (CMIOExtensionProviderSource).
I have successfully transfer some string data from host app to camera extension using custom properties of the device (CMIOExtensionDeviceSource) but I cannot find the way to access the custom property of Extension Provider (CMIOExtensionProviderSource).
I use this code to set the custom property of the device:
let selector = FourCharCode("keep")
var address = CMIOObjectPropertyAddress(selector, .global, .main)
//deviceId: CMIOObjectID
let exists = CMIOObjectHasProperty(deviceId, &address)
if exists {
var settable: DarwinBoolean = false
CMIOObjectIsPropertySettable(deviceId,&address,&settable)
if settable == false {
return
}
var dataSize: UInt32 = 0
CMIOObjectGetPropertyDataSize(deviceId, &address, 0, nil, &dataSize)
var newCommand: CFString = "command string here" as NSString
CMIOObjectSetPropertyData(deviceId, &address, 0, nil, dataSize, &newCommand)
}
As I understand to set the property of provider I have to pass CMIOObjectId of Provider. I tried to use kCMIOObjectSystemObject, but unsuccessfully.
//To use Extension Provider instead of Control Camera, Provider CMIOObjectId should be passed to CMIOObjectSetPropertyData instead of deviceId
let exists = CMIOObjectHasProperty("ProviderId", &address)
//this doesn't work, exists == false
let exists = CMIOObjectHasProperty(kCMIOObjectSystemObject, &address)
Has someone used CMIOExtensionProviderSource custom properties and can help with that?
Topic:
App & System Services
SubTopic:
Drivers
Tags: