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

Side by Side Diff: remoting/client/jni/jni_frame_consumer.cc

Issue 136763009: Add VideoProcessor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « remoting/client/jni/jni_frame_consumer.h ('k') | remoting/client/plugin/chromoting_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/client/jni/jni_frame_consumer.h" 5 #include "remoting/client/jni/jni_frame_consumer.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 27 matching lines...) Expand all
38 STLDeleteElements(&buffers_); 38 STLDeleteElements(&buffers_);
39 } 39 }
40 40
41 void JniFrameConsumer::set_frame_producer(FrameProducer* producer) { 41 void JniFrameConsumer::set_frame_producer(FrameProducer* producer) {
42 frame_producer_ = producer; 42 frame_producer_ = producer;
43 } 43 }
44 44
45 void JniFrameConsumer::ApplyBuffer(const webrtc::DesktopSize& view_size, 45 void JniFrameConsumer::ApplyBuffer(const webrtc::DesktopSize& view_size,
46 const webrtc::DesktopRect& clip_area, 46 const webrtc::DesktopRect& clip_area,
47 webrtc::DesktopFrame* buffer, 47 webrtc::DesktopFrame* buffer,
48 const webrtc::DesktopRegion& region) { 48 const webrtc::DesktopRegion& region,
49 const webrtc::DesktopRegion& shape) {
49 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread()); 50 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread());
50 51
51 if (bitmap_->size().width() != buffer->size().width() || 52 if (bitmap_->size().width() != buffer->size().width() ||
52 bitmap_->size().height() != buffer->size().height()) { 53 bitmap_->size().height() != buffer->size().height()) {
53 // Drop the frame, since the data belongs to the previous generation, 54 // Drop the frame, since the data belongs to the previous generation,
54 // before SetSourceSize() called SetOutputSizeAndClip(). 55 // before SetSourceSize() called SetOutputSizeAndClip().
55 FreeBuffer(buffer); 56 FreeBuffer(buffer);
56 return; 57 return;
57 } 58 }
58 59
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 125 }
125 126
126 void JniFrameConsumer::FreeBuffer(webrtc::DesktopFrame* buffer) { 127 void JniFrameConsumer::FreeBuffer(webrtc::DesktopFrame* buffer) {
127 DCHECK(std::find(buffers_.begin(), buffers_.end(), buffer) != buffers_.end()); 128 DCHECK(std::find(buffers_.begin(), buffers_.end(), buffer) != buffers_.end());
128 129
129 buffers_.remove(buffer); 130 buffers_.remove(buffer);
130 delete buffer; 131 delete buffer;
131 } 132 }
132 133
133 } // namespace remoting 134 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/jni_frame_consumer.h ('k') | remoting/client/plugin/chromoting_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698