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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 RTC_DCHECK_GT(streams[i].width, 0u); | 393 RTC_DCHECK_GT(streams[i].width, 0u); |
394 RTC_DCHECK_GT(streams[i].height, 0u); | 394 RTC_DCHECK_GT(streams[i].height, 0u); |
395 RTC_DCHECK_GT(streams[i].max_framerate, 0); | 395 RTC_DCHECK_GT(streams[i].max_framerate, 0); |
396 // Different framerates not supported per stream at the moment. | 396 // Different framerates not supported per stream at the moment. |
397 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); | 397 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); |
398 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); | 398 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); |
399 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); | 399 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); |
400 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); | 400 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); |
401 RTC_DCHECK_GE(streams[i].max_qp, 0); | 401 RTC_DCHECK_GE(streams[i].max_qp, 0); |
402 | 402 |
403 sim_stream->width = static_cast<unsigned short>(streams[i].width); | 403 sim_stream->width = static_cast<uint16_t>(streams[i].width); |
404 sim_stream->height = static_cast<unsigned short>(streams[i].height); | 404 sim_stream->height = static_cast<uint16_t>(streams[i].height); |
405 sim_stream->minBitrate = streams[i].min_bitrate_bps / 1000; | 405 sim_stream->minBitrate = streams[i].min_bitrate_bps / 1000; |
406 sim_stream->targetBitrate = streams[i].target_bitrate_bps / 1000; | 406 sim_stream->targetBitrate = streams[i].target_bitrate_bps / 1000; |
407 sim_stream->maxBitrate = streams[i].max_bitrate_bps / 1000; | 407 sim_stream->maxBitrate = streams[i].max_bitrate_bps / 1000; |
408 sim_stream->qpMax = streams[i].max_qp; | 408 sim_stream->qpMax = streams[i].max_qp; |
409 sim_stream->numberOfTemporalLayers = static_cast<unsigned char>( | 409 sim_stream->numberOfTemporalLayers = static_cast<unsigned char>( |
410 streams[i].temporal_layer_thresholds_bps.size() + 1); | 410 streams[i].temporal_layer_thresholds_bps.size() + 1); |
411 | 411 |
412 video_codec.width = std::max(video_codec.width, | 412 video_codec.width = std::max(video_codec.width, |
413 static_cast<unsigned short>(streams[i].width)); | 413 static_cast<uint16_t>(streams[i].width)); |
414 video_codec.height = std::max( | 414 video_codec.height = std::max( |
415 video_codec.height, static_cast<unsigned short>(streams[i].height)); | 415 video_codec.height, static_cast<uint16_t>(streams[i].height)); |
416 video_codec.minBitrate = | 416 video_codec.minBitrate = |
417 std::min(video_codec.minBitrate, | 417 std::min(static_cast<uint16_t>(video_codec.minBitrate), |
418 static_cast<unsigned int>(streams[i].min_bitrate_bps / 1000)); | 418 static_cast<uint16_t>(streams[i].min_bitrate_bps / 1000)); |
419 video_codec.maxBitrate += streams[i].max_bitrate_bps / 1000; | 419 video_codec.maxBitrate += streams[i].max_bitrate_bps / 1000; |
420 video_codec.qpMax = std::max(video_codec.qpMax, | 420 video_codec.qpMax = std::max(video_codec.qpMax, |
421 static_cast<unsigned int>(streams[i].max_qp)); | 421 static_cast<unsigned int>(streams[i].max_qp)); |
422 } | 422 } |
423 | 423 |
424 // Set to zero to not update the bitrate controller from ViEEncoder, as | 424 // Set to zero to not update the bitrate controller from ViEEncoder, as |
425 // the bitrate controller is already set from Call. | 425 // the bitrate controller is already set from Call. |
426 video_codec.startBitrate = 0; | 426 video_codec.startBitrate = 0; |
427 | 427 |
428 RTC_DCHECK_GT(streams[0].max_framerate, 0); | 428 RTC_DCHECK_GT(streams[0].max_framerate, 0); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 493 |
494 RTC_DCHECK_GE(config_.rtp.rtx.payload_type, 0); | 494 RTC_DCHECK_GE(config_.rtp.rtx.payload_type, 0); |
495 vie_channel_->SetRtxSendPayloadType(config_.rtp.rtx.payload_type, | 495 vie_channel_->SetRtxSendPayloadType(config_.rtp.rtx.payload_type, |
496 config_.encoder_settings.payload_type); | 496 config_.encoder_settings.payload_type); |
497 } | 497 } |
498 | 498 |
499 std::map<uint32_t, RtpState> VideoSendStream::GetRtpStates() const { | 499 std::map<uint32_t, RtpState> VideoSendStream::GetRtpStates() const { |
500 std::map<uint32_t, RtpState> rtp_states; | 500 std::map<uint32_t, RtpState> rtp_states; |
501 for (size_t i = 0; i < config_.rtp.ssrcs.size(); ++i) { | 501 for (size_t i = 0; i < config_.rtp.ssrcs.size(); ++i) { |
502 uint32_t ssrc = config_.rtp.ssrcs[i]; | 502 uint32_t ssrc = config_.rtp.ssrcs[i]; |
503 rtp_states[ssrc] = vie_channel_->GetRtpStateForSsrc( ssrc); | 503 rtp_states[ssrc] = vie_channel_->GetRtpStateForSsrc(ssrc); |
504 } | 504 } |
505 | 505 |
506 for (size_t i = 0; i < config_.rtp.rtx.ssrcs.size(); ++i) { | 506 for (size_t i = 0; i < config_.rtp.rtx.ssrcs.size(); ++i) { |
507 uint32_t ssrc = config_.rtp.rtx.ssrcs[i]; | 507 uint32_t ssrc = config_.rtp.rtx.ssrcs[i]; |
508 rtp_states[ssrc] = vie_channel_->GetRtpStateForSsrc(ssrc); | 508 rtp_states[ssrc] = vie_channel_->GetRtpStateForSsrc(ssrc); |
509 } | 509 } |
510 | 510 |
511 return rtp_states; | 511 return rtp_states; |
512 } | 512 } |
513 | 513 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 vie_encoder_->SetSsrcs(used_ssrcs); | 575 vie_encoder_->SetSsrcs(used_ssrcs); |
576 | 576 |
577 // Restart the media flow | 577 // Restart the media flow |
578 vie_encoder_->Restart(); | 578 vie_encoder_->Restart(); |
579 | 579 |
580 return true; | 580 return true; |
581 } | 581 } |
582 | 582 |
583 } // namespace internal | 583 } // namespace internal |
584 } // namespace webrtc | 584 } // namespace webrtc |
OLD | NEW |