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

Unified Diff: webrtc/modules/audio_device/audio_device_buffer.h

Issue 2482053003: AudioDeviceBuffer now uses 16-bit buffers (Closed)
Patch Set: Final fix for Android Created 4 years, 1 month 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 | webrtc/modules/audio_device/audio_device_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/audio_device_buffer.h
diff --git a/webrtc/modules/audio_device/audio_device_buffer.h b/webrtc/modules/audio_device/audio_device_buffer.h
index f5f8f1d2207d0be59cb85a761081a70f10850b75..0e7a22dda5d9f51e08e50bfe474548df56d0e782 100644
--- a/webrtc/modules/audio_device/audio_device_buffer.h
+++ b/webrtc/modules/audio_device/audio_device_buffer.h
@@ -60,13 +60,13 @@ class AudioDeviceBuffer {
int32_t RecordingChannel(AudioDeviceModule::ChannelType& channel) const;
virtual int32_t SetRecordedBuffer(const void* audio_buffer,
- size_t num_samples);
+ size_t samples_per_channel);
int32_t SetCurrentMicLevel(uint32_t level);
virtual void SetVQEData(int play_delay_ms, int rec_delay_ms, int clock_drift);
virtual int32_t DeliverRecordedData();
uint32_t NewMicLevel() const;
- virtual int32_t RequestPlayoutData(size_t num_samples);
+ virtual int32_t RequestPlayoutData(size_t samples_per_channel);
virtual int32_t GetPlayoutData(void* audio_buffer);
// TODO(henrika): these methods should not be used and does not contain any
@@ -95,8 +95,8 @@ class AudioDeviceBuffer {
// Updates counters in each play/record callback but does it on the task
// queue to ensure that they can be read by LogStats() without any locks since
// each task is serialized by the task queue.
- void UpdateRecStats(int16_t max_abs, size_t num_samples);
- void UpdatePlayStats(int16_t max_abs, size_t num_samples);
+ void UpdateRecStats(int16_t max_abs, size_t samples_per_channel);
+ void UpdatePlayStats(int16_t max_abs, size_t samples_per_channel);
// Clears all members tracking stats for recording and playout.
// These methods both run on the task queue.
@@ -154,12 +154,13 @@ class AudioDeviceBuffer {
bool recording_ ACCESS_ON(main_thread_checker_);
// Buffer used for audio samples to be played out. Size can be changed
- // dynamically.
- rtc::Buffer play_buffer_ ACCESS_ON(playout_thread_checker_);
+ // dynamically. The 16-bit samples are interleaved, hence the size is
+ // proportional to the number of channels.
+ rtc::BufferT<int16_t> play_buffer_ ACCESS_ON(playout_thread_checker_);
// Byte buffer used for recorded audio samples. Size can be changed
// dynamically.
- rtc::Buffer rec_buffer_ ACCESS_ON(recording_thread_checker_);
+ rtc::BufferT<int16_t> rec_buffer_ ACCESS_ON(recording_thread_checker_);
// AGC parameters.
#if !defined(WEBRTC_WIN)
« no previous file with comments | « no previous file | webrtc/modules/audio_device/audio_device_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698