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

Unified Diff: trunk/src/media/audio/android/audio_record_input.cc

Issue 335343004: Revert 277794 "Modifies AudioInputCallback::OnData and use media..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 | « trunk/src/media/audio/android/audio_record_input.h ('k') | trunk/src/media/audio/android/opensles_input.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/media/audio/android/audio_record_input.cc
===================================================================
--- trunk/src/media/audio/android/audio_record_input.cc (revision 277811)
+++ trunk/src/media/audio/android/audio_record_input.cc (working copy)
@@ -7,18 +7,14 @@
#include "base/logging.h"
#include "jni/AudioRecordInput_jni.h"
#include "media/audio/android/audio_manager_android.h"
-#include "media/base/audio_bus.h"
namespace media {
AudioRecordInputStream::AudioRecordInputStream(
- AudioManagerAndroid* audio_manager,
- const AudioParameters& params)
+ AudioManagerAndroid* audio_manager, const AudioParameters& params)
: audio_manager_(audio_manager),
callback_(NULL),
- direct_buffer_address_(NULL),
- audio_bus_(media::AudioBus::Create(params)),
- bytes_per_sample_(params.bits_per_sample() / 8) {
+ direct_buffer_address_(NULL) {
DVLOG(2) << __PRETTY_FUNCTION__;
DCHECK(params.IsValid());
j_audio_record_.Reset(
@@ -52,13 +48,10 @@
void AudioRecordInputStream::OnData(JNIEnv* env, jobject obj, jint size,
jint hardware_delay_bytes) {
DCHECK(direct_buffer_address_);
- DCHECK_EQ(size,
- audio_bus_->frames() * audio_bus_->channels() * bytes_per_sample_);
// Passing zero as the volume parameter indicates there is no access to a
// hardware volume slider.
- audio_bus_->FromInterleaved(
- direct_buffer_address_, audio_bus_->frames(), bytes_per_sample_);
- callback_->OnData(this, audio_bus_.get(), hardware_delay_bytes, 0.0);
+ callback_->OnData(this, direct_buffer_address_, size, hardware_delay_bytes,
+ 0.0);
}
bool AudioRecordInputStream::Open() {
« no previous file with comments | « trunk/src/media/audio/android/audio_record_input.h ('k') | trunk/src/media/audio/android/opensles_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698