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

Side by Side Diff: webrtc/modules/video_coding/frame_buffer2.h

Issue 2302473002: FrameBuffer::NextFrame now return pair<frame, reason>. (Closed)
Patch Set: Feedback fixes. 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 {
40 kFrameFound,
41 kTimeout,
42 kStopped
43 };
44
39 FrameBuffer(Clock* clock, 45 FrameBuffer(Clock* clock,
40 VCMJitterEstimator* jitter_estimator, 46 VCMJitterEstimator* jitter_estimator,
41 VCMTiming* timing); 47 VCMTiming* timing);
42 48
43 // Insert a frame into the frame buffer. 49 // Insert a frame into the frame buffer.
44 void InsertFrame(std::unique_ptr<FrameObject> frame); 50 void InsertFrame(std::unique_ptr<FrameObject> frame);
45 51
46 // Get the next frame for decoding. Will return at latest after 52 // Get the next frame for decoding. Will return at latest after
47 // |max_wait_time_ms|, with either a managed FrameObject or an empty 53 // |max_wait_time_ms|.
48 // unique ptr if there is no available frame for decoding. 54 // - 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); 55 // {non-null unique ptr, kFrameFound}
56 // - If no frame is available after |max_wait_time_ms| it will return
57 // {null unique ptr, kTimeout}
58 // - If the FrameBuffer is stopped then it will return
59 // {null unique ptr, kStopped}
60 std::pair<std::unique_ptr<FrameObject>, ReturnReason>
mflodman 2016/09/02 12:05:57 I'm not a big fan of returning a pair like this, w
philipel 2016/09/02 12:41:31 The idea was to follow the stl style where pair<ob
61 NextFrame(int64_t max_wait_time_ms);
50 62
51 // Tells the FrameBuffer which protection mode that is in use. Affects 63 // Tells the FrameBuffer which protection mode that is in use. Affects
52 // the frame timing. 64 // the frame timing.
53 // TODO(philipel): Remove this when new timing calculations has been 65 // TODO(philipel): Remove this when new timing calculations has been
54 // implemented. 66 // implemented.
55 void SetProtectionMode(VCMVideoProtection mode); 67 void SetProtectionMode(VCMVideoProtection mode);
56 68
57 // Start the frame buffer, has no effect if the frame buffer is started. 69 // Start the frame buffer, has no effect if the frame buffer is started.
58 // The frame buffer is started upon construction. 70 // The frame buffer is started upon construction.
59 void Start(); 71 void Start();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 bool stopped_ GUARDED_BY(crit_); 105 bool stopped_ GUARDED_BY(crit_);
94 VCMVideoProtection protection_mode_ GUARDED_BY(crit_); 106 VCMVideoProtection protection_mode_ GUARDED_BY(crit_);
95 107
96 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer); 108 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
97 }; 109 };
98 110
99 } // namespace video_coding 111 } // namespace video_coding
100 } // namespace webrtc 112 } // namespace webrtc
101 113
102 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_ 114 #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