[InsertableStreams] Fix IsKeyFrame() for video receiver delegate.

The RtpVideoStreamReceiverFrameTransformerDelegate::IsKeyFrame()
implementation was relying on the EncodedFrame::is_keyframe() API, which
checks the number of references to a frame. However the number of
references is not updated until after the frame is managed by the
receiver, after the frame has been transformed.
Update the delegate's IsKeyFrame() implementation to use the type of the
frame instead. The frame type is updated before transforming the frame,
on parsing the generic descriptor.

Bug: chromium:1068468
Change-Id: I84dadaecb1cd485262c2f1681dfa653d84693f69
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173025
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31024}
This commit is contained in:
Marina Ciocea 2020-04-07 17:23:02 +02:00 committed by Commit Bot
parent 16cc9efd54
commit 70ebbda74b

View File

@ -44,7 +44,9 @@ class TransformableVideoReceiverFrame
uint32_t GetTimestamp() const override { return frame_->Timestamp(); }
uint32_t GetSsrc() const override { return ssrc_; }
bool IsKeyFrame() const override { return frame_->is_keyframe(); }
bool IsKeyFrame() const override {
return frame_->FrameType() == VideoFrameType::kVideoFrameKey;
}
std::vector<uint8_t> GetAdditionalData() const override {
return RtpDescriptorAuthentication(frame_->GetRtpVideoHeader());