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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 CallStats* call_stats, | 114 CallStats* call_stats, |
115 CongestionController* congestion_controller, | 115 CongestionController* congestion_controller, |
116 BitrateAllocator* bitrate_allocator, | 116 BitrateAllocator* bitrate_allocator, |
117 const VideoSendStream::Config& config, | 117 const VideoSendStream::Config& config, |
118 const VideoEncoderConfig& encoder_config, | 118 const VideoEncoderConfig& encoder_config, |
119 const std::map<uint32_t, RtpState>& suspended_ssrcs) | 119 const std::map<uint32_t, RtpState>& suspended_ssrcs) |
120 : stats_proxy_(Clock::GetRealTimeClock(), config), | 120 : stats_proxy_(Clock::GetRealTimeClock(), |
| 121 config, |
| 122 encoder_config.content_type), |
121 transport_adapter_(config.send_transport), | 123 transport_adapter_(config.send_transport), |
122 encoded_frame_proxy_(config.post_encode_callback), | 124 encoded_frame_proxy_(config.post_encode_callback), |
123 config_(config), | 125 config_(config), |
124 suspended_ssrcs_(suspended_ssrcs), | 126 suspended_ssrcs_(suspended_ssrcs), |
125 module_process_thread_(module_process_thread), | 127 module_process_thread_(module_process_thread), |
126 call_stats_(call_stats), | 128 call_stats_(call_stats), |
127 congestion_controller_(congestion_controller), | 129 congestion_controller_(congestion_controller), |
128 encoder_feedback_(new EncoderStateFeedback()), | 130 encoder_feedback_(new EncoderStateFeedback()), |
129 use_config_bitrate_(true) { | 131 use_config_bitrate_(true) { |
130 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); | 132 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 430 |
429 if (!SetSendCodec(video_codec)) | 431 if (!SetSendCodec(video_codec)) |
430 return false; | 432 return false; |
431 | 433 |
432 // Clear stats for disabled layers. | 434 // Clear stats for disabled layers. |
433 for (size_t i = video_codec.numberOfSimulcastStreams; | 435 for (size_t i = video_codec.numberOfSimulcastStreams; |
434 i < config_.rtp.ssrcs.size(); ++i) { | 436 i < config_.rtp.ssrcs.size(); ++i) { |
435 stats_proxy_.OnInactiveSsrc(config_.rtp.ssrcs[i]); | 437 stats_proxy_.OnInactiveSsrc(config_.rtp.ssrcs[i]); |
436 } | 438 } |
437 | 439 |
| 440 stats_proxy_.SetContentType(config.content_type); |
| 441 |
438 RTC_DCHECK_GE(config.min_transmit_bitrate_bps, 0); | 442 RTC_DCHECK_GE(config.min_transmit_bitrate_bps, 0); |
439 vie_encoder_->SetMinTransmitBitrate(config.min_transmit_bitrate_bps / 1000); | 443 vie_encoder_->SetMinTransmitBitrate(config.min_transmit_bitrate_bps / 1000); |
440 | 444 |
441 encoder_config_ = config; | 445 encoder_config_ = config; |
442 use_config_bitrate_ = false; | 446 use_config_bitrate_ = false; |
443 return true; | 447 return true; |
444 } | 448 } |
445 | 449 |
446 bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { | 450 bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
447 return vie_channel_->ReceivedRTCPPacket(packet, length) == 0; | 451 return vie_channel_->ReceivedRTCPPacket(packet, length) == 0; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 vie_encoder_->SetSsrcs(used_ssrcs); | 575 vie_encoder_->SetSsrcs(used_ssrcs); |
572 | 576 |
573 // Restart the media flow | 577 // Restart the media flow |
574 vie_encoder_->Restart(); | 578 vie_encoder_->Restart(); |
575 | 579 |
576 return true; | 580 return true; |
577 } | 581 } |
578 | 582 |
579 } // namespace internal | 583 } // namespace internal |
580 } // namespace webrtc | 584 } // namespace webrtc |
OLD | NEW |