(Auto)update libjingle 69291002-> 69292418
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6450 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -578,6 +578,29 @@ bool ChannelManager::SetAudioOptions_w(
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Sets Engine-specific audio options according to enabled experiments.
|
||||
bool ChannelManager::SetEngineAudioOptions(const AudioOptions& options) {
|
||||
// If we're initialized, pass the settings to the media engine.
|
||||
bool ret = false;
|
||||
if (initialized_) {
|
||||
ret = worker_thread_->Invoke<bool>(
|
||||
Bind(&ChannelManager::SetEngineAudioOptions_w, this, options));
|
||||
}
|
||||
|
||||
// If all worked well, save the audio options.
|
||||
if (ret) {
|
||||
audio_options_ = options;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ChannelManager::SetEngineAudioOptions_w(const AudioOptions& options) {
|
||||
ASSERT(worker_thread_ == talk_base::Thread::Current());
|
||||
ASSERT(initialized_);
|
||||
|
||||
return media_engine_->SetAudioOptions(options);
|
||||
}
|
||||
|
||||
bool ChannelManager::GetOutputVolume(int* level) {
|
||||
if (!initialized_) {
|
||||
return false;
|
||||
|
||||
@@ -143,6 +143,8 @@ class ChannelManager : public talk_base::MessageHandler,
|
||||
bool SetAudioOptions(const std::string& wave_in_device,
|
||||
const std::string& wave_out_device,
|
||||
const AudioOptions& options);
|
||||
// Sets Engine-specific audio options according to enabled experiments.
|
||||
bool SetEngineAudioOptions(const AudioOptions& options);
|
||||
bool GetOutputVolume(int* level);
|
||||
bool SetOutputVolume(int level);
|
||||
bool IsSameCapturer(const std::string& capturer_name,
|
||||
@@ -266,6 +268,7 @@ class ChannelManager : public talk_base::MessageHandler,
|
||||
void DestroySoundclip_w(Soundclip* soundclip);
|
||||
bool SetAudioOptions_w(const AudioOptions& options, int delay_offset,
|
||||
const Device* in_dev, const Device* out_dev);
|
||||
bool SetEngineAudioOptions_w(const AudioOptions& options);
|
||||
bool SetCaptureDevice_w(const Device* cam_device);
|
||||
void OnVideoCaptureStateChange(VideoCapturer* capturer,
|
||||
CaptureState result);
|
||||
|
||||
@@ -321,6 +321,25 @@ TEST_F(ChannelManagerTest, SetAudioOptions) {
|
||||
EXPECT_FALSE(cm_->SetAudioOptions("audio-in9", "audio-out2", options));
|
||||
}
|
||||
|
||||
TEST_F(ChannelManagerTest, SetEngineAudioOptions) {
|
||||
EXPECT_TRUE(cm_->Init());
|
||||
// Test setting specific values.
|
||||
AudioOptions options;
|
||||
options.experimental_ns.Set(true);
|
||||
EXPECT_TRUE(cm_->SetEngineAudioOptions(options));
|
||||
bool experimental_ns = false;
|
||||
EXPECT_TRUE(fme_->audio_options().experimental_ns.Get(&experimental_ns));
|
||||
EXPECT_TRUE(experimental_ns);
|
||||
}
|
||||
|
||||
TEST_F(ChannelManagerTest, SetEngineAudioOptionsBeforeInitFails) {
|
||||
// Test that values that we set before Init are not applied.
|
||||
AudioOptions options;
|
||||
options.experimental_ns.Set(true);
|
||||
EXPECT_FALSE(cm_->SetEngineAudioOptions(options));
|
||||
EXPECT_FALSE(fme_->audio_options().experimental_ns.IsSet());
|
||||
}
|
||||
|
||||
TEST_F(ChannelManagerTest, SetCaptureDeviceBeforeInit) {
|
||||
// Test that values that we set before Init are applied.
|
||||
EXPECT_TRUE(cm_->SetCaptureDevice("video-in2"));
|
||||
|
||||
Reference in New Issue
Block a user