OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // | ms delta | network timestamp ms delta | network2 time-| | 259 // | ms delta | network timestamp ms delta | network2 time-| |
260 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 260 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
261 // | stamp ms delta| | 261 // | stamp ms delta| |
262 // +-+-+-+-+-+-+-+-+ | 262 // +-+-+-+-+-+-+-+-+ |
263 | 263 |
264 constexpr RTPExtensionType VideoTimingExtension::kId; | 264 constexpr RTPExtensionType VideoTimingExtension::kId; |
265 constexpr uint8_t VideoTimingExtension::kValueSizeBytes; | 265 constexpr uint8_t VideoTimingExtension::kValueSizeBytes; |
266 constexpr const char* VideoTimingExtension::kUri; | 266 constexpr const char* VideoTimingExtension::kUri; |
267 | 267 |
268 bool VideoTimingExtension::Parse(rtc::ArrayView<const uint8_t> data, | 268 bool VideoTimingExtension::Parse(rtc::ArrayView<const uint8_t> data, |
269 VideoTiming* timing) { | 269 VideoSendTiming* timing) { |
270 RTC_DCHECK(timing); | 270 RTC_DCHECK(timing); |
271 if (data.size() != kValueSizeBytes) | 271 if (data.size() != kValueSizeBytes) |
272 return false; | 272 return false; |
273 timing->encode_start_delta_ms = | 273 timing->encode_start_delta_ms = |
274 ByteReader<uint16_t>::ReadBigEndian(data.data()); | 274 ByteReader<uint16_t>::ReadBigEndian(data.data()); |
275 timing->encode_finish_delta_ms = ByteReader<uint16_t>::ReadBigEndian( | 275 timing->encode_finish_delta_ms = ByteReader<uint16_t>::ReadBigEndian( |
276 data.data() + 2 * VideoTiming::kEncodeFinishDeltaIdx); | 276 data.data() + 2 * VideoSendTiming::kEncodeFinishDeltaIdx); |
277 timing->packetization_finish_delta_ms = ByteReader<uint16_t>::ReadBigEndian( | 277 timing->packetization_finish_delta_ms = ByteReader<uint16_t>::ReadBigEndian( |
278 data.data() + 2 * VideoTiming::kPacketizationFinishDeltaIdx); | 278 data.data() + 2 * VideoSendTiming::kPacketizationFinishDeltaIdx); |
279 timing->pacer_exit_delta_ms = ByteReader<uint16_t>::ReadBigEndian( | 279 timing->pacer_exit_delta_ms = ByteReader<uint16_t>::ReadBigEndian( |
280 data.data() + 2 * VideoTiming::kPacerExitDeltaIdx); | 280 data.data() + 2 * VideoSendTiming::kPacerExitDeltaIdx); |
281 timing->network_timstamp_delta_ms = ByteReader<uint16_t>::ReadBigEndian( | 281 timing->network_timstamp_delta_ms = ByteReader<uint16_t>::ReadBigEndian( |
282 data.data() + 2 * VideoTiming::kNetworkTimestampDeltaIdx); | 282 data.data() + 2 * VideoSendTiming::kNetworkTimestampDeltaIdx); |
283 timing->network2_timstamp_delta_ms = ByteReader<uint16_t>::ReadBigEndian( | 283 timing->network2_timstamp_delta_ms = ByteReader<uint16_t>::ReadBigEndian( |
284 data.data() + 2 * VideoTiming::kNetwork2TimestampDeltaIdx); | 284 data.data() + 2 * VideoSendTiming::kNetwork2TimestampDeltaIdx); |
285 timing->is_timing_frame = true; | 285 timing->is_timing_frame = true; |
286 return true; | 286 return true; |
287 } | 287 } |
288 | 288 |
289 bool VideoTimingExtension::Write(uint8_t* data, const VideoTiming& timing) { | 289 bool VideoTimingExtension::Write(uint8_t* data, const VideoSendTiming& timing) { |
290 ByteWriter<uint16_t>::WriteBigEndian(data, timing.encode_start_delta_ms); | 290 ByteWriter<uint16_t>::WriteBigEndian(data, timing.encode_start_delta_ms); |
291 ByteWriter<uint16_t>::WriteBigEndian( | 291 ByteWriter<uint16_t>::WriteBigEndian( |
292 data + 2 * VideoTiming::kEncodeFinishDeltaIdx, | 292 data + 2 * VideoSendTiming::kEncodeFinishDeltaIdx, |
293 timing.encode_finish_delta_ms); | 293 timing.encode_finish_delta_ms); |
294 ByteWriter<uint16_t>::WriteBigEndian( | 294 ByteWriter<uint16_t>::WriteBigEndian( |
295 data + 2 * VideoTiming::kPacketizationFinishDeltaIdx, | 295 data + 2 * VideoSendTiming::kPacketizationFinishDeltaIdx, |
296 timing.packetization_finish_delta_ms); | 296 timing.packetization_finish_delta_ms); |
297 ByteWriter<uint16_t>::WriteBigEndian( | 297 ByteWriter<uint16_t>::WriteBigEndian( |
298 data + 2 * VideoTiming::kPacerExitDeltaIdx, timing.pacer_exit_delta_ms); | 298 data + 2 * VideoSendTiming::kPacerExitDeltaIdx, |
| 299 timing.pacer_exit_delta_ms); |
299 ByteWriter<uint16_t>::WriteBigEndian( | 300 ByteWriter<uint16_t>::WriteBigEndian( |
300 data + 2 * VideoTiming::kNetworkTimestampDeltaIdx, 0); // reserved | 301 data + 2 * VideoSendTiming::kNetworkTimestampDeltaIdx, 0); // reserved |
301 ByteWriter<uint16_t>::WriteBigEndian( | 302 ByteWriter<uint16_t>::WriteBigEndian( |
302 data + 2 * VideoTiming::kNetwork2TimestampDeltaIdx, 0); // reserved | 303 data + 2 * VideoSendTiming::kNetwork2TimestampDeltaIdx, 0); // reserved |
303 return true; | 304 return true; |
304 } | 305 } |
305 | 306 |
306 bool VideoTimingExtension::Write(uint8_t* data, | 307 bool VideoTimingExtension::Write(uint8_t* data, |
307 uint16_t time_delta_ms, | 308 uint16_t time_delta_ms, |
308 uint8_t idx) { | 309 uint8_t idx) { |
309 RTC_DCHECK_LT(idx, 6); | 310 RTC_DCHECK_LT(idx, 6); |
310 ByteWriter<uint16_t>::WriteBigEndian(data + 2 * idx, time_delta_ms); | 311 ByteWriter<uint16_t>::WriteBigEndian(data + 2 * idx, time_delta_ms); |
311 return true; | 312 return true; |
312 } | 313 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 374 |
374 size_t RepairedRtpStreamId::ValueSize(const std::string& rsid) { | 375 size_t RepairedRtpStreamId::ValueSize(const std::string& rsid) { |
375 return RtpStreamId::ValueSize(rsid); | 376 return RtpStreamId::ValueSize(rsid); |
376 } | 377 } |
377 | 378 |
378 bool RepairedRtpStreamId::Write(uint8_t* data, const std::string& rsid) { | 379 bool RepairedRtpStreamId::Write(uint8_t* data, const std::string& rsid) { |
379 return RtpStreamId::Write(data, rsid); | 380 return RtpStreamId::Write(data, rsid); |
380 } | 381 } |
381 | 382 |
382 } // namespace webrtc | 383 } // namespace webrtc |
OLD | NEW |