Update AVMonitor.m

This commit is contained in:
Patrick Wardle 2024-09-23 10:22:16 +02:00
parent 74b6566011
commit 289a6add52
1 changed files with 9 additions and 9 deletions

View File

@ -121,15 +121,15 @@ extern os_log_t logHandle;
//watch all input audio (mic) devices //watch all input audio (mic) devices
for(AVCaptureDevice* audioDevice in [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio]) for(AVCaptureDevice* audioDevice in [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio])
{ {
//start (device) monitor //start (device) monitor
[self watchAudioDevice:audioDevice]; [self watchAudioDevice:audioDevice];
} }
//watch all input video (cam) devices //watch all input video (cam) devices
for(AVCaptureDevice* videoDevice in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) for(AVCaptureDevice* videoDevice in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo])
{ {
//start (device) monitor //start (device) monitor
[self watchVideoDevice:videoDevice]; [self watchVideoDevice:videoDevice];
} }
//dbg msg //dbg msg
@ -774,7 +774,7 @@ extern os_log_t logHandle;
propertyStruct.mScope = kAudioObjectPropertyScopeGlobal; propertyStruct.mScope = kAudioObjectPropertyScopeGlobal;
//init property struct's element //init property struct's element
propertyStruct.mElement = kAudioObjectPropertyElementMaster; propertyStruct.mElement = kAudioObjectPropertyElementMain;
//block //block
// invoked when audio changes // invoked when audio changes
@ -915,7 +915,7 @@ bail:
propertyStruct.mScope = kAudioObjectPropertyScopeGlobal; propertyStruct.mScope = kAudioObjectPropertyScopeGlobal;
//init property struct's element //init property struct's element
propertyStruct.mElement = kAudioObjectPropertyElementMaster; propertyStruct.mElement = kAudioObjectPropertyElementMain;
//block //block
// invoked when video changes // invoked when video changes
@ -1287,7 +1287,7 @@ bail:
propertyStruct.mScope = kCMIOObjectPropertyScopeGlobal; propertyStruct.mScope = kCMIOObjectPropertyScopeGlobal;
//init property struct's element //init property struct's element
propertyStruct.mElement = kAudioObjectPropertyElementMaster; propertyStruct.mElement = kAudioObjectPropertyElementMain;
//query to get 'kAudioDevicePropertyDeviceIsRunningSomewhere' status //query to get 'kAudioDevicePropertyDeviceIsRunningSomewhere' status
status = CMIOObjectGetPropertyData(deviceID, &propertyStruct, 0, NULL, sizeof(kAudioDevicePropertyDeviceIsRunningSomewhere), &propertySize, &isRunning); status = CMIOObjectGetPropertyData(deviceID, &propertyStruct, 0, NULL, sizeof(kAudioDevicePropertyDeviceIsRunningSomewhere), &propertySize, &isRunning);
@ -1745,7 +1745,7 @@ bail:
propertyStruct.mScope = kAudioObjectPropertyScopeGlobal; propertyStruct.mScope = kAudioObjectPropertyScopeGlobal;
//init property struct's element //init property struct's element
propertyStruct.mElement = kAudioObjectPropertyElementMaster; propertyStruct.mElement = kAudioObjectPropertyElementMain;
//remove //remove
status = AudioObjectRemovePropertyListenerBlock(deviceID, &propertyStruct, self.eventQueue, self.audioListeners[device.uniqueID]); status = AudioObjectRemovePropertyListenerBlock(deviceID, &propertyStruct, self.eventQueue, self.audioListeners[device.uniqueID]);
@ -1806,7 +1806,7 @@ bail:
propertyStruct.mScope = kAudioObjectPropertyScopeGlobal; propertyStruct.mScope = kAudioObjectPropertyScopeGlobal;
//init property struct's element //init property struct's element
propertyStruct.mElement = kAudioObjectPropertyElementMaster; propertyStruct.mElement = kAudioObjectPropertyElementMain;
//remove //remove
status = CMIOObjectRemovePropertyListenerBlock(deviceID, &propertyStruct, self.eventQueue, self.cameraListeners[device.uniqueID]); status = CMIOObjectRemovePropertyListenerBlock(deviceID, &propertyStruct, self.eventQueue, self.cameraListeners[device.uniqueID]);