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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 last_picture_id_ = frame->picture_id; | 200 last_picture_id_ = frame->picture_id; |
201 UpdateLastPictureIdWithPadding(frame->picture_id); | 201 UpdateLastPictureIdWithPadding(frame->picture_id); |
202 frame_callback_->OnCompleteFrame(std::move(frame)); | 202 frame_callback_->OnCompleteFrame(std::move(frame)); |
203 RetryStashedFrames(); | 203 RetryStashedFrames(); |
204 } | 204 } |
205 | 205 |
206 void RtpFrameReferenceFinder::ManageFrameVp8( | 206 void RtpFrameReferenceFinder::ManageFrameVp8( |
207 std::unique_ptr<RtpFrameObject> frame) { | 207 std::unique_ptr<RtpFrameObject> frame) { |
208 RTPVideoTypeHeader* rtp_codec_header = frame->GetCodecHeader(); | 208 rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader(); |
209 if (!rtp_codec_header) | 209 if (!rtp_codec_header) |
210 return; | 210 return; |
211 | 211 |
212 const RTPVideoHeaderVP8& codec_header = rtp_codec_header->VP8; | 212 const RTPVideoHeaderVP8& codec_header = rtp_codec_header->VP8; |
213 | 213 |
214 if (codec_header.pictureId == kNoPictureId || | 214 if (codec_header.pictureId == kNoPictureId || |
215 codec_header.temporalIdx == kNoTemporalIdx || | 215 codec_header.temporalIdx == kNoTemporalIdx || |
216 codec_header.tl0PicIdx == kNoTl0PicIdx) { | 216 codec_header.tl0PicIdx == kNoTl0PicIdx) { |
217 ManageFrameGeneric(std::move(frame), codec_header.pictureId); | 217 ManageFrameGeneric(std::move(frame), codec_header.pictureId); |
218 return; | 218 return; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 layer_info_it->second[layer]))); | 321 layer_info_it->second[layer]))); |
322 ++frame->num_references; | 322 ++frame->num_references; |
323 frame->references[layer] = layer_info_it->second[layer]; | 323 frame->references[layer] = layer_info_it->second[layer]; |
324 } | 324 } |
325 | 325 |
326 CompletedFrameVp8(std::move(frame)); | 326 CompletedFrameVp8(std::move(frame)); |
327 } | 327 } |
328 | 328 |
329 void RtpFrameReferenceFinder::CompletedFrameVp8( | 329 void RtpFrameReferenceFinder::CompletedFrameVp8( |
330 std::unique_ptr<RtpFrameObject> frame) { | 330 std::unique_ptr<RtpFrameObject> frame) { |
331 RTPVideoTypeHeader* rtp_codec_header = frame->GetCodecHeader(); | 331 rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader(); |
332 if (!rtp_codec_header) | 332 if (!rtp_codec_header) |
333 return; | 333 return; |
334 | 334 |
335 const RTPVideoHeaderVP8& codec_header = rtp_codec_header->VP8; | 335 const RTPVideoHeaderVP8& codec_header = rtp_codec_header->VP8; |
336 | 336 |
337 uint8_t tl0_pic_idx = codec_header.tl0PicIdx; | 337 uint8_t tl0_pic_idx = codec_header.tl0PicIdx; |
338 uint8_t temporal_index = codec_header.temporalIdx; | 338 uint8_t temporal_index = codec_header.temporalIdx; |
339 auto layer_info_it = layer_info_.find(tl0_pic_idx); | 339 auto layer_info_it = layer_info_.find(tl0_pic_idx); |
340 | 340 |
341 // Update this layer info and newer. | 341 // Update this layer info and newer. |
(...skipping 15 matching lines...) Expand all Loading... |
357 for (size_t i = 0; i < frame->num_references; ++i) | 357 for (size_t i = 0; i < frame->num_references; ++i) |
358 frame->references[i] = UnwrapPictureId(frame->references[i]); | 358 frame->references[i] = UnwrapPictureId(frame->references[i]); |
359 frame->picture_id = UnwrapPictureId(frame->picture_id); | 359 frame->picture_id = UnwrapPictureId(frame->picture_id); |
360 | 360 |
361 frame_callback_->OnCompleteFrame(std::move(frame)); | 361 frame_callback_->OnCompleteFrame(std::move(frame)); |
362 RetryStashedFrames(); | 362 RetryStashedFrames(); |
363 } | 363 } |
364 | 364 |
365 void RtpFrameReferenceFinder::ManageFrameVp9( | 365 void RtpFrameReferenceFinder::ManageFrameVp9( |
366 std::unique_ptr<RtpFrameObject> frame) { | 366 std::unique_ptr<RtpFrameObject> frame) { |
367 RTPVideoTypeHeader* rtp_codec_header = frame->GetCodecHeader(); | 367 rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader(); |
368 if (!rtp_codec_header) | 368 if (!rtp_codec_header) |
369 return; | 369 return; |
370 | 370 |
371 const RTPVideoHeaderVP9& codec_header = rtp_codec_header->VP9; | 371 const RTPVideoHeaderVP9& codec_header = rtp_codec_header->VP9; |
372 | 372 |
373 if (codec_header.picture_id == kNoPictureId || | 373 if (codec_header.picture_id == kNoPictureId || |
374 codec_header.temporal_idx == kNoTemporalIdx) { | 374 codec_header.temporal_idx == kNoTemporalIdx) { |
375 ManageFrameGeneric(std::move(frame), codec_header.picture_id); | 375 ManageFrameGeneric(std::move(frame), codec_header.picture_id); |
376 return; | 376 return; |
377 } | 377 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 if (AheadOf<uint16_t, kPicIdLength>(picture_id, unwrap_truncated)) | 579 if (AheadOf<uint16_t, kPicIdLength>(picture_id, unwrap_truncated)) |
580 last_unwrap_ = Add<1 << 16>(last_unwrap_, diff); | 580 last_unwrap_ = Add<1 << 16>(last_unwrap_, diff); |
581 else | 581 else |
582 last_unwrap_ = Subtract<1 << 16>(last_unwrap_, diff); | 582 last_unwrap_ = Subtract<1 << 16>(last_unwrap_, diff); |
583 | 583 |
584 return last_unwrap_; | 584 return last_unwrap_; |
585 } | 585 } |
586 | 586 |
587 } // namespace video_coding | 587 } // namespace video_coding |
588 } // namespace webrtc | 588 } // namespace webrtc |
OLD | NEW |