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 29 matching lines...) Expand all Loading... | |
40 | 40 |
41 class MediaController : public webrtc::MediaControllerInterface, | 41 class MediaController : public webrtc::MediaControllerInterface, |
42 public sigslot::has_slots<> { | 42 public sigslot::has_slots<> { |
43 public: | 43 public: |
44 MediaController(rtc::Thread* worker_thread, | 44 MediaController(rtc::Thread* worker_thread, |
45 cricket::ChannelManager* channel_manager) | 45 cricket::ChannelManager* channel_manager) |
46 : worker_thread_(worker_thread), channel_manager_(channel_manager) { | 46 : worker_thread_(worker_thread), channel_manager_(channel_manager) { |
47 RTC_DCHECK(nullptr != worker_thread); | 47 RTC_DCHECK(nullptr != worker_thread); |
48 worker_thread_->Invoke<void>( | 48 worker_thread_->Invoke<void>( |
49 rtc::Bind(&MediaController::Construct_w, this, | 49 rtc::Bind(&MediaController::Construct_w, this, |
50 channel_manager_->media_engine()->GetVoE())); | 50 channel_manager_->media_engine()->GetAudioState())); |
tommi
2015/11/02 13:46:53
Since we're passing pointers between threads, we c
the sun
2015/11/03 12:41:07
Well, given how things were being configured, the
| |
51 } | 51 } |
52 ~MediaController() override { | 52 ~MediaController() override { |
53 worker_thread_->Invoke<void>( | 53 worker_thread_->Invoke<void>( |
54 rtc::Bind(&MediaController::Destruct_w, this)); | 54 rtc::Bind(&MediaController::Destruct_w, this)); |
55 } | 55 } |
56 | 56 |
57 webrtc::Call* call_w() override { | 57 webrtc::Call* call_w() override { |
58 RTC_DCHECK(worker_thread_->IsCurrent()); | 58 RTC_DCHECK(worker_thread_->IsCurrent()); |
59 return call_.get(); | 59 return call_.get(); |
60 } | 60 } |
61 | 61 |
62 cricket::ChannelManager* channel_manager() const override { | 62 cricket::ChannelManager* channel_manager() const override { |
63 return channel_manager_; | 63 return channel_manager_; |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 void Construct_w(webrtc::VoiceEngine* voice_engine) { | 67 void Construct_w(rtc::linked_ptr<webrtc::AudioState> audio_state) { |
68 RTC_DCHECK(worker_thread_->IsCurrent()); | 68 RTC_DCHECK(worker_thread_->IsCurrent()); |
69 webrtc::Call::Config config; | 69 webrtc::Call::Config config; |
70 config.voice_engine = voice_engine; | 70 config.audio_state = audio_state; |
71 config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 71 config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
72 config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 72 config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
73 config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 73 config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
74 call_.reset(webrtc::Call::Create(config)); | 74 call_.reset(webrtc::Call::Create(config)); |
75 } | 75 } |
76 void Destruct_w() { | 76 void Destruct_w() { |
77 RTC_DCHECK(worker_thread_->IsCurrent()); | 77 RTC_DCHECK(worker_thread_->IsCurrent()); |
78 call_.reset(); | 78 call_.reset(); |
79 } | 79 } |
80 | 80 |
81 rtc::Thread* const worker_thread_; | 81 rtc::Thread* const worker_thread_; |
82 cricket::ChannelManager* const channel_manager_; | 82 cricket::ChannelManager* const channel_manager_; |
83 rtc::scoped_ptr<webrtc::Call> call_; | 83 rtc::scoped_ptr<webrtc::Call> call_; |
84 | 84 |
85 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaController); | 85 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaController); |
86 }; | 86 }; |
87 } // namespace { | 87 } // namespace { |
88 | 88 |
89 namespace webrtc { | 89 namespace webrtc { |
90 | 90 |
91 MediaControllerInterface* MediaControllerInterface::Create( | 91 MediaControllerInterface* MediaControllerInterface::Create( |
92 rtc::Thread* worker_thread, | 92 rtc::Thread* worker_thread, |
93 cricket::ChannelManager* channel_manager) { | 93 cricket::ChannelManager* channel_manager) { |
94 return new MediaController(worker_thread, channel_manager); | 94 return new MediaController(worker_thread, channel_manager); |
95 } | 95 } |
96 } // namespace webrtc | 96 } // namespace webrtc |
OLD | NEW |