Bug 1572281 - Remove audio device change notifications from video capture in OSX. r=dminor

Video capture used to provide device change notifications for audio and video devices. From now on, CubebDeviceEnumerator will provide audio device change notifications thus video capture is updated to notify only changes of the video device. This is the OSX part.

Differential Revision: https://phabricator.services.mozilla.com/D46273

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Chronopoulos 2019-09-18 13:16:56 +00:00
parent 67bc215a66
commit aa5a82572d

View File

@ -113,7 +113,9 @@
queue:[NSOperationQueue mainQueue] queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) { usingBlock:^(NSNotification *note) {
[_lock lock]; [_lock lock];
if(_owner) AVCaptureDevice *device = [note object];
BOOL isVideoDevice = [device hasMediaType: AVMediaTypeVideo];
if(isVideoDevice && _owner)
_owner->DeviceChange(); _owner->DeviceChange();
[_lock unlock]; [_lock unlock];
}]; }];
@ -123,7 +125,9 @@
queue:[NSOperationQueue mainQueue] queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) { usingBlock:^(NSNotification *note) {
[_lock lock]; [_lock lock];
if(_owner) AVCaptureDevice *device = [note object];
BOOL isVideoDevice = [device hasMediaType: AVMediaTypeVideo];
if(isVideoDevice && _owner)
_owner->DeviceChange(); _owner->DeviceChange();
[_lock unlock]; [_lock unlock];
}]; }];