| Index: media/audio/mac/audio_auhal_mac.h
|
| diff --git a/media/audio/mac/audio_auhal_mac.h b/media/audio/mac/audio_auhal_mac.h
|
| index b4fce5d708e8b729a23ba7d11f2dd15efde8b432..feb6fff850d334ae4b10f1df97dae3093afc1e5a 100644
|
| --- a/media/audio/mac/audio_auhal_mac.h
|
| +++ b/media/audio/mac/audio_auhal_mac.h
|
| @@ -24,6 +24,7 @@
|
|
|
| #include <memory>
|
|
|
| +#include "base/atomicops.h"
|
| #include "base/cancelable_callback.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/macros.h"
|
| @@ -88,6 +89,10 @@ class AUHALStream : public AudioOutputStream {
|
|
|
| AudioDeviceID device_id() const { return device_; }
|
| size_t requested_buffer_size() const { return number_of_frames_; }
|
| + size_t actual_buffer_size() const {
|
| + return base::subtle::Acquire_Load(&actual_io_buffer_frame_size_);
|
| + }
|
| + AudioUnit audio_unit() const { return audio_unit_; }
|
|
|
| private:
|
| // AUHAL callback.
|
| @@ -145,9 +150,21 @@ class AUHALStream : public AudioOutputStream {
|
| // For convenience - same as in params_.
|
| const int output_channels_;
|
|
|
| - // Buffer-size.
|
| + // Size of audio buffer requested at construction. The actual buffer size
|
| + // is given by |actual_io_buffer_frame_size_| and it can differ from the
|
| + // requested size.
|
| const size_t number_of_frames_;
|
|
|
| + // Size of I/O buffers measured in number of audio frames. Default value is
|
| + // 512 but we always try to set it to a vaule as close as possible to
|
| + // |number_of_frames_|. It might not be possible to match the requested size,
|
| + // especially not if the utilized device is used by other streams as well.
|
| + // This value will be the same as |number_of_frames_requested_| but they are
|
| + // used for different purpuses and updated at different times.
|
| + // The member is read by the audio manager on the main browser thread
|
| + // (CrBrowserMain) and modified by this class on the Core Audio I/O thread.
|
| + base::subtle::Atomic32 actual_io_buffer_frame_size_;
|
| +
|
| // Stores the number of frames that we actually get callbacks for.
|
| // This may be different from what we ask for, so we use this for stats in
|
| // order to understand how often this happens and what are the typical values.
|
|
|