| OLD | NEW |
| (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 | |
| OLD | NEW |