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) { | 133 if (encoded_image.timing_.flags != TimingFrameFlags::kInvalid) { |
134 rtp_video_header.video_timing.encode_start_delta_ms = | 134 rtp_video_header.video_timing.encode_start_delta_ms = |
135 VideoSendTiming::GetDeltaCappedMs( | 135 VideoSendTiming::GetDeltaCappedMs( |
136 encoded_image.capture_time_ms_, | 136 encoded_image.capture_time_ms_, |
137 encoded_image.timing_.encode_start_ms); | 137 encoded_image.timing_.encode_start_ms); |
138 rtp_video_header.video_timing.encode_finish_delta_ms = | 138 rtp_video_header.video_timing.encode_finish_delta_ms = |
139 VideoSendTiming::GetDeltaCappedMs( | 139 VideoSendTiming::GetDeltaCappedMs( |
140 encoded_image.capture_time_ms_, | 140 encoded_image.capture_time_ms_, |
141 encoded_image.timing_.encode_finish_ms); | 141 encoded_image.timing_.encode_finish_ms); |
142 rtp_video_header.video_timing.packetization_finish_delta_ms = 0; | 142 rtp_video_header.video_timing.packetization_finish_delta_ms = 0; |
143 rtp_video_header.video_timing.pacer_exit_delta_ms = 0; | 143 rtp_video_header.video_timing.pacer_exit_delta_ms = 0; |
144 rtp_video_header.video_timing.network_timstamp_delta_ms = 0; | 144 rtp_video_header.video_timing.network_timstamp_delta_ms = 0; |
145 rtp_video_header.video_timing.network2_timstamp_delta_ms = 0; | 145 rtp_video_header.video_timing.network2_timstamp_delta_ms = 0; |
146 rtp_video_header.video_timing.is_timing_frame = true; | |
147 } else { | |
148 rtp_video_header.video_timing.is_timing_frame = false; | |
149 } | 146 } |
| 147 rtp_video_header.video_timing.flags = encoded_image.timing_.flags; |
150 rtp_video_header.playout_delay = encoded_image.playout_delay_; | 148 rtp_video_header.playout_delay = encoded_image.playout_delay_; |
151 | 149 |
152 int stream_index = rtp_video_header.simulcastIdx; | 150 int stream_index = rtp_video_header.simulcastIdx; |
153 RTC_DCHECK_LT(stream_index, rtp_modules_.size()); | 151 RTC_DCHECK_LT(stream_index, rtp_modules_.size()); |
154 uint32_t frame_id; | 152 uint32_t frame_id; |
155 bool send_result = rtp_modules_[stream_index]->SendOutgoingData( | 153 bool send_result = rtp_modules_[stream_index]->SendOutgoingData( |
156 encoded_image._frameType, payload_type_, encoded_image._timeStamp, | 154 encoded_image._frameType, payload_type_, encoded_image._timeStamp, |
157 encoded_image.capture_time_ms_, encoded_image._buffer, | 155 encoded_image.capture_time_ms_, encoded_image._buffer, |
158 encoded_image._length, fragmentation, &rtp_video_header, &frame_id); | 156 encoded_image._length, fragmentation, &rtp_video_header, &frame_id); |
159 if (!send_result) | 157 if (!send_result) |
(...skipping 20 matching lines...) Expand all Loading... |
180 BitrateAllocation layer_bitrate; | 178 BitrateAllocation layer_bitrate; |
181 for (int tl = 0; tl < kMaxTemporalStreams; ++tl) | 179 for (int tl = 0; tl < kMaxTemporalStreams; ++tl) |
182 layer_bitrate.SetBitrate(0, tl, bitrate.GetBitrate(si, tl)); | 180 layer_bitrate.SetBitrate(0, tl, bitrate.GetBitrate(si, tl)); |
183 rtp_modules_[si]->SetVideoBitrateAllocation(layer_bitrate); | 181 rtp_modules_[si]->SetVideoBitrateAllocation(layer_bitrate); |
184 } | 182 } |
185 } | 183 } |
186 } | 184 } |
187 } | 185 } |
188 | 186 |
189 } // namespace webrtc | 187 } // namespace webrtc |
OLD | NEW |