| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 ~MediaController() override { | 49 ~MediaController() override { |
| 50 worker_thread_->Invoke<void>( | 50 worker_thread_->Invoke<void>( |
| 51 rtc::Bind(&MediaController::Destruct_w, this)); | 51 rtc::Bind(&MediaController::Destruct_w, this)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 webrtc::Call* call_w() override { | 54 webrtc::Call* call_w() override { |
| 55 RTC_DCHECK(worker_thread_->IsCurrent()); | 55 RTC_DCHECK(worker_thread_->IsCurrent()); |
| 56 return call_.get(); | 56 return call_.get(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void OnPacketSent(const webrtc::SentPacket& sent_packet) override { |
| 60 call_->OnPacketSent(sent_packet); |
| 61 } |
| 62 |
| 59 private: | 63 private: |
| 60 void Construct_w(webrtc::VoiceEngine* voice_engine) { | 64 void Construct_w(webrtc::VoiceEngine* voice_engine) { |
| 61 RTC_DCHECK(worker_thread_->IsCurrent()); | 65 RTC_DCHECK(worker_thread_->IsCurrent()); |
| 62 webrtc::Call::Config config; | 66 webrtc::Call::Config config; |
| 63 config.voice_engine = voice_engine; | 67 config.voice_engine = voice_engine; |
| 64 config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 68 config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
| 65 config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 69 config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
| 66 config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 70 config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
| 67 call_.reset(webrtc::Call::Create(config)); | 71 call_.reset(webrtc::Call::Create(config)); |
| 68 } | 72 } |
| 69 void Destruct_w() { | 73 void Destruct_w() { |
| 70 RTC_DCHECK(worker_thread_->IsCurrent()); | 74 RTC_DCHECK(worker_thread_->IsCurrent()); |
| 71 call_.reset(nullptr); | 75 call_.reset(nullptr); |
| 72 } | 76 } |
| 73 | 77 |
| 74 rtc::Thread* worker_thread_; | 78 rtc::Thread* worker_thread_; |
| 75 rtc::scoped_ptr<webrtc::Call> call_; | 79 rtc::scoped_ptr<webrtc::Call> call_; |
| 76 | 80 |
| 77 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaController); | 81 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaController); |
| 78 }; | 82 }; |
| 79 } // namespace { | 83 } // namespace { |
| 80 | 84 |
| 81 namespace webrtc { | 85 namespace webrtc { |
| 82 | 86 |
| 83 MediaControllerInterface* MediaControllerInterface::Create( | 87 MediaControllerInterface* MediaControllerInterface::Create( |
| 84 rtc::Thread* worker_thread, webrtc::VoiceEngine* voice_engine) { | 88 rtc::Thread* worker_thread, webrtc::VoiceEngine* voice_engine) { |
| 85 return new MediaController(worker_thread, voice_engine); | 89 return new MediaController(worker_thread, voice_engine); |
| 86 } | 90 } |
| 87 } // namespace webrtc | 91 } // namespace webrtc |
| OLD | NEW |