WebRTC now compiles for enable_android_opensl=1.

Default is enable_android_opensl=0 but we should build for OpenSL as well.

BUG=4293
R=perkj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40719004

Cr-Commit-Position: refs/heads/master@{#8360}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8360 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrika@webrtc.org 2015-02-13 11:35:42 +00:00
parent 40fdb8ab96
commit 58f6f01acc
3 changed files with 9 additions and 13 deletions

View File

@ -30,7 +30,7 @@ class OpenSlRunnerTemplate {
public:
OpenSlRunnerTemplate()
: output_(0),
input_(0, &output_) {
input_() {
output_.AttachAudioBuffer(&audio_buffer_);
if (output_.Init() != 0) {
assert(false);

View File

@ -25,8 +25,6 @@
do { \
SLresult err = (op); \
if (err != SL_RESULT_SUCCESS) { \
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, id_, \
"OpenSL error: %d", err); \
assert(false); \
return ret_val; \
} \
@ -43,11 +41,8 @@ enum {
namespace webrtc {
OpenSlesInput::OpenSlesInput(
const int32_t id, PlayoutDelayProvider* delay_provider)
: id_(id),
delay_provider_(delay_provider),
initialized_(false),
OpenSlesInput::OpenSlesInput()
: initialized_(false),
mic_initialized_(false),
rec_initialized_(false),
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
@ -419,7 +414,6 @@ bool OpenSlesInput::HandleOverrun(int event_id, int event_msg) {
if (event_id == kNoOverrun) {
return false;
}
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, id_, "Audio overrun");
assert(event_id == kOverrun);
assert(event_msg > 0);
// Wait for all enqueued buffers be flushed.
@ -533,7 +527,8 @@ bool OpenSlesInput::CbThreadImpl() {
while (fifo_->size() > 0 && recording_) {
int8_t* audio = fifo_->Pop();
audio_buffer_->SetRecordedBuffer(audio, buffer_size_samples());
audio_buffer_->SetVQEData(delay_provider_->PlayoutDelayMs(),
// TODO(henrika): improve the delay estimate.
audio_buffer_->SetVQEData(100,
recording_delay_, 0);
audio_buffer_->DeliverRecordedData();
}

View File

@ -35,7 +35,7 @@ class ThreadWrapper;
// to non-const methods require exclusive access to the object.
class OpenSlesInput {
public:
OpenSlesInput(const int32_t id, PlayoutDelayProvider* delay_provider);
OpenSlesInput();
~OpenSlesInput();
static int32_t SetAndroidAudioDeviceObjects(void* javaVM,
@ -177,8 +177,9 @@ class OpenSlesInput {
// Java API handle
AudioManagerJni audio_manager_;
int id_;
PlayoutDelayProvider* delay_provider_;
// TODO(henrika): improve this area
// PlayoutDelayProvider* delay_provider_;
bool initialized_;
bool mic_initialized_;
bool rec_initialized_;