Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: media/audio/mac/audio_auhal_mac.h

Issue 1903753002: Restores larger output buffer size when output stream requiring smaller size is closed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/audio/mac/audio_auhal_mac.cc » ('j') | media/audio/mac/audio_manager_mac.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..be3fef9c536c694630843939589784a55d8df602 100644
--- a/media/audio/mac/audio_auhal_mac.h
+++ b/media/audio/mac/audio_auhal_mac.h
@@ -88,6 +88,8 @@ 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 actual_io_buffer_frame_size_; }
+ AudioUnit audio_unit() const { return audio_unit_; }
private:
// AUHAL callback.
@@ -145,9 +147,19 @@ 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.
+ size_t 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.
« no previous file with comments | « no previous file | media/audio/mac/audio_auhal_mac.cc » ('j') | media/audio/mac/audio_manager_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698