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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/frame_buffer2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 18 matching lines...) Expand all
29 class Clock; 29 class Clock;
30 class VCMJitterEstimator; 30 class VCMJitterEstimator;
31 class VCMTiming; 31 class VCMTiming;
32 32
33 namespace video_coding { 33 namespace video_coding {
34 34
35 class FrameObject; 35 class FrameObject;
36 36
37 class FrameBuffer { 37 class FrameBuffer {
38 public: 38 public:
39 enum ReturnReason { kFrameFound, kTimeout, kStopped };
40
39 FrameBuffer(Clock* clock, 41 FrameBuffer(Clock* clock,
40 VCMJitterEstimator* jitter_estimator, 42 VCMJitterEstimator* jitter_estimator,
41 VCMTiming* timing); 43 VCMTiming* timing);
42 44
43 // Insert a frame into the frame buffer. 45 // Insert a frame into the frame buffer.
44 void InsertFrame(std::unique_ptr<FrameObject> frame); 46 void InsertFrame(std::unique_ptr<FrameObject> frame);
45 47
46 // Get the next frame for decoding. Will return at latest after 48 // Get the next frame for decoding. Will return at latest after
47 // |max_wait_time_ms|, with either a managed FrameObject or an empty 49 // |max_wait_time_ms|.
48 // unique ptr if there is no available frame for decoding. 50 // - If a frame is availiable within |max_wait_time_ms| it will return
49 std::unique_ptr<FrameObject> NextFrame(int64_t max_wait_time_ms); 51 // kFrameFound and set |frame_out| to the resulting frame.
52 // - If no frame is available after |max_wait_time_ms| it will return
53 // kTimeout.
54 // - If the FrameBuffer is stopped then it will return kStopped.
55 ReturnReason NextFrame(int64_t max_wait_time_ms,
56 std::unique_ptr<FrameObject>* frame_out);
50 57
51 // Tells the FrameBuffer which protection mode that is in use. Affects 58 // Tells the FrameBuffer which protection mode that is in use. Affects
52 // the frame timing. 59 // the frame timing.
53 // TODO(philipel): Remove this when new timing calculations has been 60 // TODO(philipel): Remove this when new timing calculations has been
54 // implemented. 61 // implemented.
55 void SetProtectionMode(VCMVideoProtection mode); 62 void SetProtectionMode(VCMVideoProtection mode);
56 63
57 // Start the frame buffer, has no effect if the frame buffer is started. 64 // Start the frame buffer, has no effect if the frame buffer is started.
58 // The frame buffer is started upon construction. 65 // The frame buffer is started upon construction.
59 void Start(); 66 void Start();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 bool stopped_ GUARDED_BY(crit_); 100 bool stopped_ GUARDED_BY(crit_);
94 VCMVideoProtection protection_mode_ GUARDED_BY(crit_); 101 VCMVideoProtection protection_mode_ GUARDED_BY(crit_);
95 102
96 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer); 103 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
97 }; 104 };
98 105
99 } // namespace video_coding 106 } // namespace video_coding
100 } // namespace webrtc 107 } // namespace webrtc
101 108
102 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_ 109 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_
OLDNEW
« 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