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

Side by Side Diff: remoting/host/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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "remoting/host/video_frame_queue.h"
6
7 #include <algorithm>
8
9 #include "base/basictypes.h"
10 #include "remoting/host/video_frame.h"
11
12 namespace remoting {
13
14 VideoFrameQueue::VideoFrameQueue()
15 : current_(0),
16 previous_(NULL) {
17 SetAllFramesNeedUpdate();
18 }
19
20 VideoFrameQueue::~VideoFrameQueue() {
21 }
22
23 void VideoFrameQueue::DoneWithCurrentFrame() {
24 previous_ = current_frame();
25 current_ = (current_ + 1) % kQueueLength;
26 }
27
28 void VideoFrameQueue::ReplaceCurrentFrame(scoped_ptr<VideoFrame> frame) {
29 frames_[current_] = frame.Pass();
30 needs_update_[current_] = false;
31 }
32
33 void VideoFrameQueue::SetAllFramesNeedUpdate() {
34 std::fill(needs_update_, needs_update_ + arraysize(needs_update_), true);
35 previous_ = NULL;
36 }
37
38 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698