Index: media/audio/mac/audio_low_latency_input_mac.cc |
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc |
index 1baa09f1fe07f0e2b4d5a89c017eaf53c8a23247..2b2ce0090da0f54d25fdb9a40f60eb5e7f417b14 100644 |
--- a/media/audio/mac/audio_low_latency_input_mac.cc |
+++ b/media/audio/mac/audio_low_latency_input_mac.cc |
@@ -451,6 +451,29 @@ double AUAudioInputStream::GetVolume() { |
return 0.0; |
} |
+bool AUAudioInputStream::IsMuted() { |
+ // Verify that we have a valid device. |
+ DCHECK_NE(input_device_id_, kAudioObjectUnknown) << "Device ID is unknown"; |
+ |
+ AudioObjectPropertyAddress property_address = { |
+ kAudioDevicePropertyMute, |
+ kAudioDevicePropertyScopeInput, |
+ kAudioObjectPropertyElementMaster |
+ }; |
+ |
+ if (!AudioObjectHasProperty(input_device_id_, &property_address)) { |
+ DLOG(ERROR) << "Device does not support checking master mute state"; |
+ return false; |
+ } |
+ |
+ UInt32 muted = 0; |
+ UInt32 size = sizeof(muted); |
+ OSStatus result = AudioObjectGetPropertyData( |
+ input_device_id_, &property_address, 0, NULL, &size, &muted); |
+ DLOG_IF(WARNING, result != noErr) << "Failed to get mute state"; |
+ return result == noErr && muted != 0; |
+} |
+ |
// AUHAL AudioDeviceOutput unit callback |
OSStatus AUAudioInputStream::InputProc(void* user_data, |
AudioUnitRenderActionFlags* flags, |