Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: webrtc/modules/video_coding/rtp_frame_reference_finder.cc

Issue 3009833002: Avoid calling RtpFrameObject::GetCodecHeader twice in the RtpFrameReferenceFinder. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/video_coding/rtp_frame_reference_finder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/rtp_frame_reference_finder.cc
diff --git a/webrtc/modules/video_coding/rtp_frame_reference_finder.cc b/webrtc/modules/video_coding/rtp_frame_reference_finder.cc
index 8d74c363c511b07420f961e75f93e152c8df71df..52947cb2d077a5bef2fd458bd0ae3a46eb5f1498 100644
--- a/webrtc/modules/video_coding/rtp_frame_reference_finder.cc
+++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.cc
@@ -285,7 +285,7 @@ RtpFrameReferenceFinder::FrameDecision RtpFrameReferenceFinder::ManageFrameVp8(
if (frame->frame_type() == kVideoFrameKey) {
frame->num_references = 0;
layer_info_[codec_header.tl0PicIdx].fill(-1);
- UpdateLayerInfoVp8(frame);
+ UpdateLayerInfoVp8(frame, codec_header);
return kHandOff;
}
@@ -307,7 +307,7 @@ RtpFrameReferenceFinder::FrameDecision RtpFrameReferenceFinder::ManageFrameVp8(
.first;
frame->num_references = 1;
frame->references[0] = layer_info_it->second[0];
- UpdateLayerInfoVp8(frame);
+ UpdateLayerInfoVp8(frame, codec_header);
return kHandOff;
}
@@ -316,7 +316,7 @@ RtpFrameReferenceFinder::FrameDecision RtpFrameReferenceFinder::ManageFrameVp8(
frame->num_references = 1;
frame->references[0] = layer_info_it->second[0];
- UpdateLayerInfoVp8(frame);
+ UpdateLayerInfoVp8(frame, codec_header);
return kHandOff;
}
@@ -359,15 +359,13 @@ RtpFrameReferenceFinder::FrameDecision RtpFrameReferenceFinder::ManageFrameVp8(
frame->references[layer] = layer_info_it->second[layer];
}
- UpdateLayerInfoVp8(frame);
+ UpdateLayerInfoVp8(frame, codec_header);
return kHandOff;
}
-void RtpFrameReferenceFinder::UpdateLayerInfoVp8(RtpFrameObject* frame) {
- rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader();
- RTC_DCHECK(rtp_codec_header);
- const RTPVideoHeaderVP8& codec_header = rtp_codec_header->VP8;
-
+void RtpFrameReferenceFinder::UpdateLayerInfoVp8(
+ RtpFrameObject* frame,
+ const RTPVideoHeaderVP8& codec_header) {
uint8_t tl0_pic_idx = codec_header.tl0PicIdx;
uint8_t temporal_index = codec_header.temporalIdx;
auto layer_info_it = layer_info_.find(tl0_pic_idx);
@@ -394,7 +392,9 @@ void RtpFrameReferenceFinder::UpdateLayerInfoVp8(RtpFrameObject* frame) {
RtpFrameReferenceFinder::FrameDecision RtpFrameReferenceFinder::ManageFrameVp9(
RtpFrameObject* frame) {
rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader();
- RTC_DCHECK(rtp_codec_header);
+ if (!rtp_codec_header)
philipel 2017/08/30 08:54:37 I thought I had made this change at some earlier p
+ return kDrop;
+
const RTPVideoHeaderVP9& codec_header = rtp_codec_header->VP9;
if (codec_header.picture_id == kNoPictureId ||
« no previous file with comments | « webrtc/modules/video_coding/rtp_frame_reference_finder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698