• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
3  *
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  */
10 
11 #include "modules/video_coding/rtp_frame_id_only_ref_finder.h"
12 
13 #include <utility>
14 
15 #include "rtc_base/logging.h"
16 
17 namespace webrtc {
18 
ManageFrame(std::unique_ptr<RtpFrameObject> frame,int frame_id)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;
27 
28   RtpFrameReferenceFinder::ReturnVector res;
29   res.push_back(std::move(frame));
30   return res;
31 }
32 
33 }  // namespace webrtc
34