Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Unified Diff: webrtc/modules/video_coding/frame_buffer2.h

Issue 2302473002: FrameBuffer::NextFrame now return pair<frame, reason>. (Closed)
Patch Set: Comment fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/frame_buffer2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/frame_buffer2.h
diff --git a/webrtc/modules/video_coding/frame_buffer2.h b/webrtc/modules/video_coding/frame_buffer2.h
index 0af2bf952350bc76674f5f42dcbf8f86fff8e80e..d0f896133f116cecef7491070c1ebd6508ae28ff 100644
--- a/webrtc/modules/video_coding/frame_buffer2.h
+++ b/webrtc/modules/video_coding/frame_buffer2.h
@@ -36,6 +36,8 @@ class FrameObject;
class FrameBuffer {
public:
+ enum ReturnReason { kFrameFound, kTimeout, kStopped };
+
FrameBuffer(Clock* clock,
VCMJitterEstimator* jitter_estimator,
VCMTiming* timing);
@@ -44,9 +46,14 @@ class FrameBuffer {
void InsertFrame(std::unique_ptr<FrameObject> frame);
// Get the next frame for decoding. Will return at latest after
- // |max_wait_time_ms|, with either a managed FrameObject or an empty
- // unique ptr if there is no available frame for decoding.
- std::unique_ptr<FrameObject> NextFrame(int64_t max_wait_time_ms);
+ // |max_wait_time_ms|.
+ // - If a frame is availiable within |max_wait_time_ms| it will return
+ // kFrameFound and set |frame_out| to the resulting frame.
+ // - If no frame is available after |max_wait_time_ms| it will return
+ // kTimeout.
+ // - If the FrameBuffer is stopped then it will return kStopped.
+ ReturnReason NextFrame(int64_t max_wait_time_ms,
+ std::unique_ptr<FrameObject>* frame_out);
// Tells the FrameBuffer which protection mode that is in use. Affects
// the frame timing.
« no previous file with comments | « no previous file | webrtc/modules/video_coding/frame_buffer2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698