Merge mozilla-central to autoland. a=merge CLOSED TREE
[gecko.git] / third_party / libwebrtc / modules / video_coding / rtp_frame_id_only_ref_finder.cc
blob9f3d5bb296b9aa51b9bf5e04dc1fb5ef217529f1
1 /*
2 * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
11 #include "modules/video_coding/rtp_frame_id_only_ref_finder.h"
13 #include <utility>
15 #include "rtc_base/logging.h"
17 namespace webrtc {
19 RtpFrameReferenceFinder::ReturnVector RtpFrameIdOnlyRefFinder::ManageFrame(
20 std::unique_ptr<RtpFrameObject> frame,
21 int frame_id) {
22 frame->SetSpatialIndex(0);
23 frame->SetId(unwrapper_.Unwrap(frame_id & (kFrameIdLength - 1)));
24 frame->num_references =
25 frame->frame_type() == VideoFrameType::kVideoFrameKey ? 0 : 1;
26 frame->references[0] = frame->Id() - 1;
28 RtpFrameReferenceFinder::ReturnVector res;
29 res.push_back(std::move(frame));
30 return res;
33 } // namespace webrtc