Use unique_ptr in GetNextFrame instead of release/delete

Bug: webrtc:13343
Change-Id: Iea86335dae5c0407f0fe6c91ccfe2f1eb13175b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236847
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35331}
This commit is contained in:
Evan Shrubsole
2021-11-10 11:41:14 +01:00
committed by WebRTC LUCI CQ
parent 1b320f8b7d
commit 0072c21934
3 changed files with 23 additions and 23 deletions

View File

@ -121,7 +121,8 @@ class FrameBuffer {
bool ValidReferences(const EncodedFrame& frame) const;
int64_t FindNextFrame(int64_t now_ms) RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
EncodedFrame* GetNextFrame() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
std::unique_ptr<EncodedFrame> GetNextFrame()
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
void StartWaitForNextFrameOnQueue() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
void CancelCallback() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
@ -155,8 +156,8 @@ class FrameBuffer {
// vector of frames, but until the decoding pipeline can support decoding
// multiple frames at the same time we combine all frames to one frame and
// return it. See bugs.webrtc.org/10064
EncodedFrame* CombineAndDeleteFrames(
const std::vector<EncodedFrame*>& frames) const;
std::unique_ptr<EncodedFrame> CombineAndDeleteFrames(
std::vector<std::unique_ptr<EncodedFrame>> frames) const;
RTC_NO_UNIQUE_ADDRESS SequenceChecker construction_checker_;
RTC_NO_UNIQUE_ADDRESS SequenceChecker callback_checker_;