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

Unified Diff: media/base/android/java/src/org/chromium/media/AudioRecordInput.java

Issue 2689483006: Switch browser side audio capture path to use base time primitives. (Closed)
Patch Set: Bloop Created 3 years, 10 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
Index: media/base/android/java/src/org/chromium/media/AudioRecordInput.java
diff --git a/media/base/android/java/src/org/chromium/media/AudioRecordInput.java b/media/base/android/java/src/org/chromium/media/AudioRecordInput.java
index 89d694a92ed3a38029f8bfe03240a65b96523112..e69f8a150e6d218d921d236725ae3227737b18db 100644
--- a/media/base/android/java/src/org/chromium/media/AudioRecordInput.java
+++ b/media/base/android/java/src/org/chromium/media/AudioRecordInput.java
@@ -35,7 +35,6 @@ class AudioRecordInput {
private final int mSampleRate;
private final int mChannels;
private final int mBitsPerSample;
- private final int mHardwareDelayBytes;
private final boolean mUsePlatformAEC;
private ByteBuffer mBuffer;
private AudioRecord mAudioRecord;
@@ -62,8 +61,7 @@ class AudioRecordInput {
while (mKeepAlive) {
int bytesRead = mAudioRecord.read(mBuffer, mBuffer.capacity());
if (bytesRead > 0) {
- nativeOnData(mNativeAudioRecordInputStream, bytesRead,
- mHardwareDelayBytes);
+ nativeOnData(mNativeAudioRecordInputStream, bytesRead, HARDWARE_DELAY_MS);
} else {
Log.e(TAG, "read failed: %d", bytesRead);
if (bytesRead == AudioRecord.ERROR_INVALID_OPERATION) {
@@ -107,7 +105,6 @@ class AudioRecordInput {
mSampleRate = sampleRate;
mChannels = channels;
mBitsPerSample = bitsPerSample;
- mHardwareDelayBytes = HARDWARE_DELAY_MS * sampleRate / 1000 * bitsPerSample / 8;
mUsePlatformAEC = usePlatformAEC;
// We use a direct buffer so that the native class can have access to
@@ -243,6 +240,6 @@ class AudioRecordInput {
private native void nativeCacheDirectBufferAddress(long nativeAudioRecordInputStream,
ByteBuffer buffer);
- private native void nativeOnData(long nativeAudioRecordInputStream, int size,
- int hardwareDelayBytes);
+ private native void nativeOnData(
+ long nativeAudioRecordInputStream, int size, int hardwareDelayMs);
}

Powered by Google App Engine
This is Rietveld 408576698