OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 RTC_DCHECK(!rtp_modules_.empty()); | 123 RTC_DCHECK(!rtp_modules_.empty()); |
124 if (!active_) | 124 if (!active_) |
125 return Result(Result::ERROR_SEND_FAILED); | 125 return Result(Result::ERROR_SEND_FAILED); |
126 | 126 |
127 RTPVideoHeader rtp_video_header; | 127 RTPVideoHeader rtp_video_header; |
128 memset(&rtp_video_header, 0, sizeof(RTPVideoHeader)); | 128 memset(&rtp_video_header, 0, sizeof(RTPVideoHeader)); |
129 if (codec_specific_info) | 129 if (codec_specific_info) |
130 CopyCodecSpecific(codec_specific_info, &rtp_video_header); | 130 CopyCodecSpecific(codec_specific_info, &rtp_video_header); |
131 rtp_video_header.rotation = encoded_image.rotation_; | 131 rtp_video_header.rotation = encoded_image.rotation_; |
132 rtp_video_header.content_type = encoded_image.content_type_; | 132 rtp_video_header.content_type = encoded_image.content_type_; |
| 133 if (encoded_image.timing_.is_timing_frame) { |
| 134 rtp_video_header.video_timing.encode_start_ms_delta = |
| 135 VideoTiming::GetDeltaMs(encoded_image.capture_time_ms_, |
| 136 encoded_image.timing_.encode_start_ms); |
| 137 rtp_video_header.video_timing.encode_finish_ms_delta = |
| 138 VideoTiming::GetDeltaMs(encoded_image.capture_time_ms_, |
| 139 encoded_image.timing_.encode_finish_ms); |
| 140 rtp_video_header.video_timing.packetization_finish_ms_delta = 0; |
| 141 rtp_video_header.video_timing.pacer_exit_ms_delta = 0; |
| 142 rtp_video_header.video_timing.network_timstamp_ms_delta = 0; |
| 143 rtp_video_header.video_timing.is_timing_frame = true; |
| 144 } else { |
| 145 rtp_video_header.video_timing.is_timing_frame = false; |
| 146 } |
133 rtp_video_header.playout_delay = encoded_image.playout_delay_; | 147 rtp_video_header.playout_delay = encoded_image.playout_delay_; |
134 | 148 |
135 int stream_index = rtp_video_header.simulcastIdx; | 149 int stream_index = rtp_video_header.simulcastIdx; |
136 RTC_DCHECK_LT(stream_index, rtp_modules_.size()); | 150 RTC_DCHECK_LT(stream_index, rtp_modules_.size()); |
137 uint32_t frame_id; | 151 uint32_t frame_id; |
138 bool send_result = rtp_modules_[stream_index]->SendOutgoingData( | 152 bool send_result = rtp_modules_[stream_index]->SendOutgoingData( |
139 encoded_image._frameType, payload_type_, encoded_image._timeStamp, | 153 encoded_image._frameType, payload_type_, encoded_image._timeStamp, |
140 encoded_image.capture_time_ms_, encoded_image._buffer, | 154 encoded_image.capture_time_ms_, encoded_image._buffer, |
141 encoded_image._length, fragmentation, &rtp_video_header, &frame_id); | 155 encoded_image._length, fragmentation, &rtp_video_header, &frame_id); |
142 if (!send_result) | 156 if (!send_result) |
(...skipping 16 matching lines...) Expand all Loading... |
159 BitrateAllocation layer_bitrate; | 173 BitrateAllocation layer_bitrate; |
160 for (int tl = 0; tl < kMaxTemporalStreams; ++tl) | 174 for (int tl = 0; tl < kMaxTemporalStreams; ++tl) |
161 layer_bitrate.SetBitrate(0, tl, bitrate.GetBitrate(si, tl)); | 175 layer_bitrate.SetBitrate(0, tl, bitrate.GetBitrate(si, tl)); |
162 rtp_modules_[si]->SetVideoBitrateAllocation(layer_bitrate); | 176 rtp_modules_[si]->SetVideoBitrateAllocation(layer_bitrate); |
163 } | 177 } |
164 } | 178 } |
165 } | 179 } |
166 } | 180 } |
167 | 181 |
168 } // namespace webrtc | 182 } // namespace webrtc |
OLD | NEW |