Index: webrtc/modules/video_coding/frame_buffer2.cc |
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc |
index dab783254684e2ff140ed598bd3fdc022f9dbd57..813b15bdb1c7c96afbb217e437139b8e2d54d350 100644 |
--- a/webrtc/modules/video_coding/frame_buffer2.cc |
+++ b/webrtc/modules/video_coding/frame_buffer2.cc |
@@ -52,7 +52,8 @@ FrameBuffer::FrameBuffer(Clock* clock, |
stopped_(false), |
protection_mode_(kProtectionNack) {} |
-std::unique_ptr<FrameObject> FrameBuffer::NextFrame(int64_t max_wait_time_ms) { |
+rtc::Optional<std::unique_ptr<FrameObject>> |
+FrameBuffer::NextFrame(int64_t max_wait_time_ms) { |
int64_t latest_return_time = clock_->TimeInMilliseconds() + max_wait_time_ms; |
int64_t now = clock_->TimeInMilliseconds(); |
int64_t wait_ms = max_wait_time_ms; |
@@ -63,7 +64,7 @@ std::unique_ptr<FrameObject> FrameBuffer::NextFrame(int64_t max_wait_time_ms) { |
rtc::CritScope lock(&crit_); |
frame_inserted_event_.Reset(); |
if (stopped_) |
- return std::unique_ptr<FrameObject>(); |
+ return rtc::Optional<std::unique_ptr<FrameObject>>(); |
now = clock_->TimeInMilliseconds(); |
wait_ms = max_wait_time_ms; |
@@ -115,9 +116,9 @@ std::unique_ptr<FrameObject> FrameBuffer::NextFrame(int64_t max_wait_time_ms) { |
decoded_frames_.insert(next_frame_it->first); |
std::unique_ptr<FrameObject> frame = std::move(next_frame_it->second); |
frames_.erase(frames_.begin(), ++next_frame_it); |
- return frame; |
+ return rtc::Optional<std::unique_ptr<FrameObject>>(std::move(frame)); |
} else { |
- return std::unique_ptr<FrameObject>(); |
+ return rtc::Optional<std::unique_ptr<FrameObject>>(nullptr); |
} |
} |
} |