OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return InitializeChannel(&channel_owner); | 387 return InitializeChannel(&channel_owner); |
388 } | 388 } |
389 | 389 |
390 int VoEBaseImpl::CreateChannel(const Config& config) { | 390 int VoEBaseImpl::CreateChannel(const Config& config) { |
391 CriticalSectionScoped cs(shared_->crit_sec()); | 391 CriticalSectionScoped cs(shared_->crit_sec()); |
392 if (!shared_->statistics().Initialized()) { | 392 if (!shared_->statistics().Initialized()) { |
393 shared_->SetLastError(VE_NOT_INITED, kTraceError); | 393 shared_->SetLastError(VE_NOT_INITED, kTraceError); |
394 return -1; | 394 return -1; |
395 } | 395 } |
396 voe::ChannelOwner channel_owner = | 396 voe::ChannelOwner channel_owner = |
397 shared_->channel_manager().CreateChannel(config); | 397 shared_->channel_manager().CreateChannel(config, shared_->event_log()); |
398 return InitializeChannel(&channel_owner); | 398 return InitializeChannel(&channel_owner); |
399 } | 399 } |
400 | 400 |
401 int VoEBaseImpl::InitializeChannel(voe::ChannelOwner* channel_owner) { | 401 int VoEBaseImpl::InitializeChannel(voe::ChannelOwner* channel_owner) { |
402 if (channel_owner->channel()->SetEngineInformation( | 402 if (channel_owner->channel()->SetEngineInformation( |
403 shared_->statistics(), *shared_->output_mixer(), | 403 shared_->statistics(), *shared_->output_mixer(), |
404 *shared_->transmit_mixer(), *shared_->process_thread(), | 404 *shared_->transmit_mixer(), *shared_->process_thread(), |
405 *shared_->audio_device(), voiceEngineObserverPtr_, | 405 *shared_->audio_device(), voiceEngineObserverPtr_, |
406 &callbackCritSect_) != 0) { | 406 &callbackCritSect_) != 0) { |
407 shared_->SetLastError( | 407 shared_->SetLastError( |
408 VE_CHANNEL_NOT_CREATED, kTraceError, | 408 VE_CHANNEL_NOT_CREATED, kTraceError, |
409 "CreateChannel() failed to associate engine and channel." | 409 "CreateChannel() failed to associate engine and channel." |
410 " Destroying channel."); | 410 " Destroying channel."); |
411 shared_->channel_manager().DestroyChannel( | 411 shared_->channel_manager().DestroyChannel( |
412 channel_owner->channel()->ChannelId()); | 412 channel_owner->channel()->ChannelId()); |
413 return -1; | 413 return -1; |
414 } else if (channel_owner->channel()->Init() != 0) { | 414 } else if (channel_owner->channel()->Init() != 0) { |
415 shared_->SetLastError( | 415 shared_->SetLastError( |
416 VE_CHANNEL_NOT_CREATED, kTraceError, | 416 VE_CHANNEL_NOT_CREATED, kTraceError, |
417 "CreateChannel() failed to initialize channel. Destroying" | 417 "CreateChannel() failed to initialize channel. Destroying" |
418 " channel."); | 418 " channel."); |
419 shared_->channel_manager().DestroyChannel( | 419 shared_->channel_manager().DestroyChannel( |
420 channel_owner->channel()->ChannelId()); | 420 channel_owner->channel()->ChannelId()); |
421 return -1; | 421 return -1; |
422 } | 422 } |
423 | |
424 return channel_owner->channel()->ChannelId(); | 423 return channel_owner->channel()->ChannelId(); |
425 } | 424 } |
426 | 425 |
427 int VoEBaseImpl::DeleteChannel(int channel) { | 426 int VoEBaseImpl::DeleteChannel(int channel) { |
428 CriticalSectionScoped cs(shared_->crit_sec()); | 427 CriticalSectionScoped cs(shared_->crit_sec()); |
429 if (!shared_->statistics().Initialized()) { | 428 if (!shared_->statistics().Initialized()) { |
430 shared_->SetLastError(VE_NOT_INITED, kTraceError); | 429 shared_->SetLastError(VE_NOT_INITED, kTraceError); |
431 return -1; | 430 return -1; |
432 } | 431 } |
433 | 432 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, | 863 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, |
865 "AssociateSendChannel() failed to locate accociate_send_channel"); | 864 "AssociateSendChannel() failed to locate accociate_send_channel"); |
866 return -1; | 865 return -1; |
867 } | 866 } |
868 | 867 |
869 channel_ptr->set_associate_send_channel(ch); | 868 channel_ptr->set_associate_send_channel(ch); |
870 return 0; | 869 return 0; |
871 } | 870 } |
872 | 871 |
873 } // namespace webrtc | 872 } // namespace webrtc |
OLD | NEW |