| Index: media/audio/mac/audio_device_listener_mac.h
|
| diff --git a/media/audio/mac/audio_device_listener_mac.h b/media/audio/mac/audio_device_listener_mac.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..32497a5c462485010eb4921bb57220cb97e8ce9d
|
| --- /dev/null
|
| +++ b/media/audio/mac/audio_device_listener_mac.h
|
| @@ -0,0 +1,39 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MEDIA_AUDIO_MAC_AUDIO_DEVICE_LISTENER_MAC_H_
|
| +#define MEDIA_AUDIO_MAC_AUDIO_DEVICE_LISTENER_MAC_H_
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/gtest_prod_util.h"
|
| +#include "base/threading/thread_checker.h"
|
| +#include "media/base/media_export.h"
|
| +
|
| +namespace media {
|
| +
|
| +// Listens for default device changes and forwards them to AudioManagerMac so it
|
| +// can notify downstream clients. Only output device changes are supported
|
| +// currently.
|
| +class MEDIA_EXPORT AudioDeviceListenerMac {
|
| + public:
|
| + // The listener callback may be called from a system level multimedia thread,
|
| + // thus the callee must be thread safe. |listener_cb| is a permanent callback
|
| + // and must outlive AudioDeviceListenerMac.
|
| + explicit AudioDeviceListenerMac(const base::Closure& listener_cb);
|
| + ~AudioDeviceListenerMac();
|
| +
|
| + // Callback for when an audio device changes.
|
| + void OnDefaultDeviceChanged();
|
| +
|
| + private:
|
| + FRIEND_TEST_ALL_PREFIXES(AudioDeviceListenerMacTest, OutputDeviceChange);
|
| + base::Closure listener_cb_;
|
| + base::ThreadChecker thread_checker_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AudioDeviceListenerMac);
|
| +};
|
| +
|
| +} // namespace media
|
| +
|
| +#endif // MEDIA_AUDIO_MAC_AUDIO_DEVICE_LISTENER_MAC_H_
|
|
|