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

Unified Diff: webrtc/modules/audio_device/android/fine_audio_buffer.h

Issue 1254883002: Refactor the AudioDevice for iOS and improve the performance and stability (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased and cleaned up Created 5 years, 3 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 | « webrtc/modules/audio_device/BUILD.gn ('k') | webrtc/modules/audio_device/android/fine_audio_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/android/fine_audio_buffer.h
diff --git a/webrtc/modules/audio_device/android/fine_audio_buffer.h b/webrtc/modules/audio_device/android/fine_audio_buffer.h
deleted file mode 100644
index 3534271ece812397168a68d305d60245aa56987b..0000000000000000000000000000000000000000
--- a/webrtc/modules/audio_device/android/fine_audio_buffer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_FINE_AUDIO_BUFFER_H_
-#define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_FINE_AUDIO_BUFFER_H_
-
-#include "webrtc/base/scoped_ptr.h"
-#include "webrtc/typedefs.h"
-
-namespace webrtc {
-
-class AudioDeviceBuffer;
-
-// FineAudioBuffer takes an AudioDeviceBuffer which delivers audio data
-// corresponding to 10ms of data. It then allows for this data to be pulled in
-// a finer or coarser granularity. I.e. interacting with this class instead of
-// directly with the AudioDeviceBuffer one can ask for any number of audio data
-// samples.
-class FineAudioBuffer {
- public:
- // |device_buffer| is a buffer that provides 10ms of audio data.
- // |desired_frame_size_bytes| is the number of bytes of audio data
- // (not samples) |GetBufferData| should return on success.
- // |sample_rate| is the sample rate of the audio data. This is needed because
- // |device_buffer| delivers 10ms of data. Given the sample rate the number
- // of samples can be calculated.
- FineAudioBuffer(AudioDeviceBuffer* device_buffer,
- size_t desired_frame_size_bytes,
- int sample_rate);
- ~FineAudioBuffer();
-
- // Returns the required size of |buffer| when calling GetBufferData. If the
- // buffer is smaller memory trampling will happen.
- // |desired_frame_size_bytes| and |samples_rate| are as described in the
- // constructor.
- size_t RequiredBufferSizeBytes();
-
- // |buffer| must be of equal or greater size than what is returned by
- // RequiredBufferSize. This is to avoid unnecessary memcpy.
- void GetBufferData(int8_t* buffer);
-
- private:
- // Device buffer that provides 10ms chunks of data.
- AudioDeviceBuffer* device_buffer_;
- // Number of bytes delivered per GetBufferData
- size_t desired_frame_size_bytes_;
- int sample_rate_;
- size_t samples_per_10_ms_;
- // Convenience parameter to avoid converting from samples
- size_t bytes_per_10_ms_;
-
- // Storage for samples that are not yet asked for.
- rtc::scoped_ptr<int8_t[]> cache_buffer_;
- // Location of first unread sample.
- size_t cached_buffer_start_;
- // Number of bytes stored in cache.
- size_t cached_bytes_;
-};
-
-} // namespace webrtc
-
-#endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_FINE_AUDIO_BUFFER_H_
« no previous file with comments | « webrtc/modules/audio_device/BUILD.gn ('k') | webrtc/modules/audio_device/android/fine_audio_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698