| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 : "off"); | 105 : "off"); |
| 106 ss << '}'; | 106 ss << '}'; |
| 107 return ss.str(); | 107 return ss.str(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 namespace internal { | 110 namespace internal { |
| 111 VideoSendStream::VideoSendStream( | 111 VideoSendStream::VideoSendStream( |
| 112 int num_cpu_cores, | 112 int num_cpu_cores, |
| 113 ProcessThread* module_process_thread, | 113 ProcessThread* module_process_thread, |
| 114 ChannelGroup* channel_group, | 114 ChannelGroup* channel_group, |
| 115 int channel_id, | |
| 116 const VideoSendStream::Config& config, | 115 const VideoSendStream::Config& config, |
| 117 const VideoEncoderConfig& encoder_config, | 116 const VideoEncoderConfig& encoder_config, |
| 118 const std::map<uint32_t, RtpState>& suspended_ssrcs) | 117 const std::map<uint32_t, RtpState>& suspended_ssrcs) |
| 119 : transport_adapter_(config.send_transport), | 118 : transport_adapter_(config.send_transport), |
| 120 encoded_frame_proxy_(config.post_encode_callback), | 119 encoded_frame_proxy_(config.post_encode_callback), |
| 121 config_(config), | 120 config_(config), |
| 122 suspended_ssrcs_(suspended_ssrcs), | 121 suspended_ssrcs_(suspended_ssrcs), |
| 123 module_process_thread_(module_process_thread), | 122 module_process_thread_(module_process_thread), |
| 124 channel_group_(channel_group), | 123 channel_group_(channel_group), |
| 125 use_config_bitrate_(true), | 124 use_config_bitrate_(true), |
| 126 stats_proxy_(Clock::GetRealTimeClock(), config) { | 125 stats_proxy_(Clock::GetRealTimeClock(), config) { |
| 127 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); | 126 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); |
| 128 RTC_DCHECK(!config_.rtp.ssrcs.empty()); | 127 RTC_DCHECK(!config_.rtp.ssrcs.empty()); |
| 129 | 128 |
| 130 // Set up Call-wide sequence numbers, if configured for this send stream. | 129 // Set up Call-wide sequence numbers, if configured for this send stream. |
| 131 TransportFeedbackObserver* transport_feedback_observer = nullptr; | 130 TransportFeedbackObserver* transport_feedback_observer = nullptr; |
| 132 for (const RtpExtension& extension : config.rtp.extensions) { | 131 for (const RtpExtension& extension : config.rtp.extensions) { |
| 133 if (extension.name == RtpExtension::kTransportSequenceNumber) { | 132 if (extension.name == RtpExtension::kTransportSequenceNumber) { |
| 134 transport_feedback_observer = | 133 transport_feedback_observer = |
| 135 channel_group_->GetTransportFeedbackObserver(); | 134 channel_group_->GetTransportFeedbackObserver(); |
| 136 break; | 135 break; |
| 137 } | 136 } |
| 138 } | 137 } |
| 139 | 138 |
| 140 const std::vector<uint32_t>& ssrcs = config.rtp.ssrcs; | 139 const std::vector<uint32_t>& ssrcs = config.rtp.ssrcs; |
| 141 | 140 |
| 142 vie_encoder_.reset(new ViEEncoder( | 141 vie_encoder_.reset(new ViEEncoder( |
| 143 channel_id, num_cpu_cores, module_process_thread_, &stats_proxy_, | 142 num_cpu_cores, module_process_thread_, &stats_proxy_, |
| 144 config.pre_encode_callback, channel_group_->pacer(), | 143 config.pre_encode_callback, channel_group_->pacer(), |
| 145 channel_group_->bitrate_allocator())); | 144 channel_group_->bitrate_allocator())); |
| 146 RTC_CHECK(vie_encoder_->Init()); | 145 RTC_CHECK(vie_encoder_->Init()); |
| 147 | 146 |
| 148 vie_channel_.reset(new ViEChannel( | 147 vie_channel_.reset(new ViEChannel( |
| 149 num_cpu_cores, config.send_transport, module_process_thread_, | 148 num_cpu_cores, config.send_transport, module_process_thread_, |
| 150 channel_group_->GetRtcpIntraFrameObserver(), | 149 channel_group_->GetRtcpIntraFrameObserver(), |
| 151 channel_group_->GetBitrateController()->CreateRtcpBandwidthObserver(), | 150 channel_group_->GetBitrateController()->CreateRtcpBandwidthObserver(), |
| 152 transport_feedback_observer, | 151 transport_feedback_observer, |
| 153 channel_group_->GetRemoteBitrateEstimator(false), | 152 channel_group_->GetRemoteBitrateEstimator(false), |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 vie_channel_->IsSendingFecEnabled()); | 546 vie_channel_->IsSendingFecEnabled()); |
| 548 | 547 |
| 549 // Restart the media flow | 548 // Restart the media flow |
| 550 vie_encoder_->Restart(); | 549 vie_encoder_->Restart(); |
| 551 | 550 |
| 552 return true; | 551 return true; |
| 553 } | 552 } |
| 554 | 553 |
| 555 } // namespace internal | 554 } // namespace internal |
| 556 } // namespace webrtc | 555 } // namespace webrtc |
| OLD | NEW |