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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 int64_t first_frame_offset_ms) | 712 int64_t first_frame_offset_ms) |
713 : kMaxPayloadSizeBytes(1200), | 713 : kMaxPayloadSizeBytes(1200), |
714 kTimestampBase(0xff80ff00ul), | 714 kTimestampBase(0xff80ff00ul), |
715 frame_period_ms_(1000.0 / fps), | 715 frame_period_ms_(1000.0 / fps), |
716 bits_per_second_(1000 * kbps), | 716 bits_per_second_(1000 * kbps), |
717 frame_size_bytes_(bits_per_second_ / 8 / fps), | 717 frame_size_bytes_(bits_per_second_ / 8 / fps), |
718 flow_id_(flow_id), | 718 flow_id_(flow_id), |
719 next_frame_ms_(first_frame_offset_ms), | 719 next_frame_ms_(first_frame_offset_ms), |
720 next_frame_rand_ms_(0), | 720 next_frame_rand_ms_(0), |
721 now_ms_(0), | 721 now_ms_(0), |
722 prototype_header_(), | 722 prototype_header_() { |
723 start_plotting_ms_(first_frame_offset_ms) { | |
724 memset(&prototype_header_, 0, sizeof(prototype_header_)); | 723 memset(&prototype_header_, 0, sizeof(prototype_header_)); |
725 prototype_header_.ssrc = ssrc; | 724 prototype_header_.ssrc = ssrc; |
726 prototype_header_.sequenceNumber = 0xf000u; | 725 prototype_header_.sequenceNumber = 0xf000u; |
727 } | 726 } |
728 | 727 |
729 uint32_t VideoSource::NextFrameSize() { | 728 uint32_t VideoSource::NextFrameSize() { |
730 return frame_size_bytes_; | 729 return frame_size_bytes_; |
731 } | 730 } |
732 | 731 |
733 int64_t VideoSource::GetTimeUntilNextFrameMs() const { | 732 int64_t VideoSource::GetTimeUntilNextFrameMs() const { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, | 843 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, |
845 uint32_t remaining_payload) { | 844 uint32_t remaining_payload) { |
846 uint32_t fragments = | 845 uint32_t fragments = |
847 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; | 846 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; |
848 uint32_t avg_size = (frame_size + fragments - 1) / fragments; | 847 uint32_t avg_size = (frame_size + fragments - 1) / fragments; |
849 return std::min(avg_size, remaining_payload); | 848 return std::min(avg_size, remaining_payload); |
850 } | 849 } |
851 } // namespace bwe | 850 } // namespace bwe |
852 } // namespace testing | 851 } // namespace testing |
853 } // namespace webrtc | 852 } // namespace webrtc |
OLD | NEW |