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

Side by Side Diff: remoting/capturer/video_frame_queue.cc

Issue 11470028: Move screen capturers to remoting/capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/video_frame_queue.h" 5 #include "remoting/capturer/video_frame_queue.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "remoting/host/video_frame.h" 10 #include "remoting/capturer/video_frame.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 VideoFrameQueue::VideoFrameQueue() 14 VideoFrameQueue::VideoFrameQueue()
15 : current_(0), 15 : current_(0),
16 previous_(NULL) { 16 previous_(NULL) {
17 SetAllFramesNeedUpdate(); 17 SetAllFramesNeedUpdate();
18 } 18 }
19 19
20 VideoFrameQueue::~VideoFrameQueue() { 20 VideoFrameQueue::~VideoFrameQueue() {
21 } 21 }
22 22
23 void VideoFrameQueue::DoneWithCurrentFrame() { 23 void VideoFrameQueue::DoneWithCurrentFrame() {
24 previous_ = current_frame(); 24 previous_ = current_frame();
25 current_ = (current_ + 1) % kQueueLength; 25 current_ = (current_ + 1) % kQueueLength;
26 } 26 }
27 27
28 void VideoFrameQueue::ReplaceCurrentFrame(scoped_ptr<VideoFrame> frame) { 28 void VideoFrameQueue::ReplaceCurrentFrame(scoped_ptr<VideoFrame> frame) {
29 frames_[current_] = frame.Pass(); 29 frames_[current_] = frame.Pass();
30 needs_update_[current_] = false; 30 needs_update_[current_] = false;
31 } 31 }
32 32
33 void VideoFrameQueue::SetAllFramesNeedUpdate() { 33 void VideoFrameQueue::SetAllFramesNeedUpdate() {
34 std::fill(needs_update_, needs_update_ + arraysize(needs_update_), true); 34 std::fill(needs_update_, needs_update_ + arraysize(needs_update_), true);
35 previous_ = NULL; 35 previous_ = NULL;
36 } 36 }
37 37
38 } // namespace remoting 38 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698