mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00

Bug: webrtc:12579 Change-Id: Ib7ecd624eb5c54abb77fe08440a014aa1e963865 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212860 Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33542}
33 lines
1 KiB
C++
33 lines
1 KiB
C++
/*
|
|
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "modules/video_coding/rtp_frame_id_only_ref_finder.h"
|
|
|
|
#include <utility>
|
|
|
|
#include "rtc_base/logging.h"
|
|
|
|
namespace webrtc {
|
|
|
|
RtpFrameReferenceFinder::ReturnVector RtpFrameIdOnlyRefFinder::ManageFrame(
|
|
std::unique_ptr<RtpFrameObject> frame,
|
|
int frame_id) {
|
|
frame->SetSpatialIndex(0);
|
|
frame->SetId(unwrapper_.Unwrap(frame_id & (kFrameIdLength - 1)));
|
|
frame->num_references =
|
|
frame->frame_type() == VideoFrameType::kVideoFrameKey ? 0 : 1;
|
|
frame->references[0] = frame->Id() - 1;
|
|
|
|
RtpFrameReferenceFinder::ReturnVector res;
|
|
res.push_back(std::move(frame));
|
|
return res;
|
|
}
|
|
|
|
} // namespace webrtc
|