Android audio playout now supports non-call media streams.

The default (preferred) stream type for output audio is STREAM_VOICE_CALL since the WebRTC stack is mainly intended for VoIP calls. But if the user wants to run in another mode than COMM mode, we now accept it and change the stream type to STREAM_MUSIC instead. It can e.g. be suitable for applications that does not record audio or if a call shall be casted to a Chromecast device.

The solution is somewhat experimental.

NOTRY=TRUE

BUG=webrtc:4767

Review-Url: https://codereview.webrtc.org/2411263003
Cr-Commit-Position: refs/heads/master@{#14613}
This commit is contained in:
henrika
2016-10-12 08:11:42 -07:00
committed by Commit bot
parent 116ec6da50
commit 872f614111
7 changed files with 65 additions and 3 deletions

View File

@ -524,12 +524,16 @@ class AudioDeviceTest : public ::testing::Test {
audio_device_ = CreateAudioDevice(AudioDeviceModule::kPlatformDefaultAudio);
EXPECT_NE(audio_device_.get(), nullptr);
EXPECT_EQ(0, audio_device_->Init());
// Set audio mode to MODE_IN_COMMUNICATION.
audio_manager()->SetCommunicationMode(true);
playout_parameters_ = audio_manager()->GetPlayoutAudioParameters();
record_parameters_ = audio_manager()->GetRecordAudioParameters();
build_info_.reset(new BuildInfo());
}
virtual ~AudioDeviceTest() {
EXPECT_EQ(0, audio_device_->Terminate());
// Restore audio mode back to MODE_NORMAL.
audio_manager()->SetCommunicationMode(false);
}
int playout_sample_rate() const {