OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 cricket::MediaType kind, | 149 cricket::MediaType kind, |
150 RtpTransportInterface* transport, | 150 RtpTransportInterface* transport, |
151 RtpTransportControllerAdapter* rtp_transport_controller) | 151 RtpTransportControllerAdapter* rtp_transport_controller) |
152 : kind_(kind), | 152 : kind_(kind), |
153 transport_(transport), | 153 transport_(transport), |
154 rtp_transport_controller_(rtp_transport_controller) {} | 154 rtp_transport_controller_(rtp_transport_controller) {} |
155 | 155 |
156 void OrtcRtpSenderAdapter::CreateInternalSender() { | 156 void OrtcRtpSenderAdapter::CreateInternalSender() { |
157 switch (kind_) { | 157 switch (kind_) { |
158 case cricket::MEDIA_TYPE_AUDIO: | 158 case cricket::MEDIA_TYPE_AUDIO: |
159 internal_sender_ = new AudioRtpSender( | 159 internal_sender_ = new rtc::RefCountedObject<AudioRtpSender>( |
160 rtp_transport_controller_->voice_channel(), nullptr); | 160 rtp_transport_controller_->voice_channel(), nullptr); |
161 break; | 161 break; |
162 case cricket::MEDIA_TYPE_VIDEO: | 162 case cricket::MEDIA_TYPE_VIDEO: |
163 internal_sender_ = | 163 internal_sender_ = new rtc::RefCountedObject<VideoRtpSender>( |
164 new VideoRtpSender(rtp_transport_controller_->video_channel()); | 164 rtp_transport_controller_->video_channel()); |
165 break; | 165 break; |
166 case cricket::MEDIA_TYPE_DATA: | 166 case cricket::MEDIA_TYPE_DATA: |
167 RTC_NOTREACHED(); | 167 RTC_NOTREACHED(); |
168 } | 168 } |
169 if (track_) { | 169 if (track_) { |
170 if (!internal_sender_->SetTrack(track_)) { | 170 if (!internal_sender_->SetTrack(track_)) { |
171 // Since we checked the track type when it was set, this should never | 171 // Since we checked the track type when it was set, this should never |
172 // happen... | 172 // happen... |
173 RTC_NOTREACHED(); | 173 RTC_NOTREACHED(); |
174 } | 174 } |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 } // namespace webrtc | 178 } // namespace webrtc |
OLD | NEW |