OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 } | 205 } |
206 | 206 |
207 // If audio_output_volume_ has been set via SetOutputVolume(), set the | 207 // If audio_output_volume_ has been set via SetOutputVolume(), set the |
208 // audio output volume of the engine. | 208 // audio output volume of the engine. |
209 if (kNotSetOutputVolume != audio_output_volume_ && | 209 if (kNotSetOutputVolume != audio_output_volume_ && |
210 !SetOutputVolume(audio_output_volume_)) { | 210 !SetOutputVolume(audio_output_volume_)) { |
211 LOG(LS_WARNING) << "Failed to SetOutputVolume to " | 211 LOG(LS_WARNING) << "Failed to SetOutputVolume to " |
212 << audio_output_volume_; | 212 << audio_output_volume_; |
213 } | 213 } |
214 | 214 |
215 // Now apply the default video codec that has been set earlier. | |
216 if (default_video_encoder_config_.max_codec.id != 0) { | |
217 SetDefaultVideoEncoderConfig(default_video_encoder_config_); | |
218 } | |
219 | |
220 return initialized_; | 215 return initialized_; |
221 } | 216 } |
222 | 217 |
223 bool ChannelManager::InitMediaEngine_w() { | 218 bool ChannelManager::InitMediaEngine_w() { |
224 ASSERT(worker_thread_ == rtc::Thread::Current()); | 219 ASSERT(worker_thread_ == rtc::Thread::Current()); |
225 return (media_engine_->Init(worker_thread_)); | 220 return (media_engine_->Init(worker_thread_)); |
226 } | 221 } |
227 | 222 |
228 void ChannelManager::Terminate() { | 223 void ChannelManager::Terminate() { |
229 ASSERT(initialized_); | 224 ASSERT(initialized_); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 media_engine_.get(), level)); | 438 media_engine_.get(), level)); |
444 } | 439 } |
445 | 440 |
446 if (ret) { | 441 if (ret) { |
447 audio_output_volume_ = level; | 442 audio_output_volume_ = level; |
448 } | 443 } |
449 | 444 |
450 return ret; | 445 return ret; |
451 } | 446 } |
452 | 447 |
453 bool ChannelManager::SetDefaultVideoEncoderConfig(const VideoEncoderConfig& c) { | |
454 bool ret = true; | |
455 if (initialized_) { | |
456 ret = worker_thread_->Invoke<bool>( | |
457 Bind(&MediaEngineInterface::SetDefaultVideoEncoderConfig, | |
458 media_engine_.get(), c)); | |
459 } | |
460 if (ret) { | |
461 default_video_encoder_config_ = c; | |
462 } | |
463 return ret; | |
464 } | |
465 | |
466 std::vector<cricket::VideoFormat> ChannelManager::GetSupportedFormats( | 448 std::vector<cricket::VideoFormat> ChannelManager::GetSupportedFormats( |
467 VideoCapturer* capturer) const { | 449 VideoCapturer* capturer) const { |
468 ASSERT(capturer != NULL); | 450 ASSERT(capturer != NULL); |
469 std::vector<VideoFormat> formats; | 451 std::vector<VideoFormat> formats; |
470 worker_thread_->Invoke<void>(rtc::Bind(&ChannelManager::GetSupportedFormats_w, | 452 worker_thread_->Invoke<void>(rtc::Bind(&ChannelManager::GetSupportedFormats_w, |
471 this, capturer, &formats)); | 453 this, capturer, &formats)); |
472 return formats; | 454 return formats; |
473 } | 455 } |
474 | 456 |
475 void ChannelManager::GetSupportedFormats_w( | 457 void ChannelManager::GetSupportedFormats_w( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 return worker_thread_->Invoke<bool>( | 564 return worker_thread_->Invoke<bool>( |
583 Bind(&MediaEngineInterface::StartRtcEventLog, media_engine_.get(), file)); | 565 Bind(&MediaEngineInterface::StartRtcEventLog, media_engine_.get(), file)); |
584 } | 566 } |
585 | 567 |
586 void ChannelManager::StopRtcEventLog() { | 568 void ChannelManager::StopRtcEventLog() { |
587 worker_thread_->Invoke<void>( | 569 worker_thread_->Invoke<void>( |
588 Bind(&MediaEngineInterface::StopRtcEventLog, media_engine_.get())); | 570 Bind(&MediaEngineInterface::StopRtcEventLog, media_engine_.get())); |
589 } | 571 } |
590 | 572 |
591 } // namespace cricket | 573 } // namespace cricket |
OLD | NEW |