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

Side by Side Diff: remoting/client/frame_consumer_proxy.cc

Issue 18233015: Abstract PPAPI's ImageData behind webrtc::DesktopFrame interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement Wez's final corrections Created 7 years, 5 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 | « remoting/client/frame_consumer_proxy.h ('k') | remoting/client/frame_producer.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 (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/client/frame_consumer_proxy.h" 5 #include "remoting/client/frame_consumer_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "ppapi/cpp/image_data.h" 10 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 FrameConsumerProxy::FrameConsumerProxy( 14 FrameConsumerProxy::FrameConsumerProxy(
15 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 15 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
16 : task_runner_(task_runner) { 16 : task_runner_(task_runner) {
17 } 17 }
18 18
19 void FrameConsumerProxy::ApplyBuffer(const SkISize& view_size, 19 void FrameConsumerProxy::ApplyBuffer(const SkISize& view_size,
20 const SkIRect& clip_area, 20 const SkIRect& clip_area,
21 pp::ImageData* buffer, 21 webrtc::DesktopFrame* buffer,
22 const SkRegion& region) { 22 const SkRegion& region) {
23 if (!task_runner_->BelongsToCurrentThread()) { 23 if (!task_runner_->BelongsToCurrentThread()) {
24 task_runner_->PostTask(FROM_HERE, base::Bind( 24 task_runner_->PostTask(FROM_HERE, base::Bind(
25 &FrameConsumerProxy::ApplyBuffer, this, 25 &FrameConsumerProxy::ApplyBuffer, this,
26 view_size, clip_area, buffer, region)); 26 view_size, clip_area, buffer, region));
27 return; 27 return;
28 } 28 }
29 29
30 if (frame_consumer_.get()) 30 if (frame_consumer_.get())
31 frame_consumer_->ApplyBuffer(view_size, clip_area, buffer, region); 31 frame_consumer_->ApplyBuffer(view_size, clip_area, buffer, region);
32 } 32 }
33 33
34 void FrameConsumerProxy::ReturnBuffer(pp::ImageData* buffer) { 34 void FrameConsumerProxy::ReturnBuffer(webrtc::DesktopFrame* buffer) {
35 if (!task_runner_->BelongsToCurrentThread()) { 35 if (!task_runner_->BelongsToCurrentThread()) {
36 task_runner_->PostTask(FROM_HERE, base::Bind( 36 task_runner_->PostTask(FROM_HERE, base::Bind(
37 &FrameConsumerProxy::ReturnBuffer, this, buffer)); 37 &FrameConsumerProxy::ReturnBuffer, this, buffer));
38 return; 38 return;
39 } 39 }
40 40
41 if (frame_consumer_.get()) 41 if (frame_consumer_.get())
42 frame_consumer_->ReturnBuffer(buffer); 42 frame_consumer_->ReturnBuffer(buffer);
43 } 43 }
44 44
(...skipping 13 matching lines...) Expand all
58 const base::WeakPtr<FrameConsumer>& frame_consumer) { 58 const base::WeakPtr<FrameConsumer>& frame_consumer) {
59 DCHECK(task_runner_->BelongsToCurrentThread()); 59 DCHECK(task_runner_->BelongsToCurrentThread());
60 DCHECK(frame_consumer_.get() == NULL); 60 DCHECK(frame_consumer_.get() == NULL);
61 frame_consumer_ = frame_consumer; 61 frame_consumer_ = frame_consumer;
62 } 62 }
63 63
64 FrameConsumerProxy::~FrameConsumerProxy() { 64 FrameConsumerProxy::~FrameConsumerProxy() {
65 } 65 }
66 66
67 } // namespace remoting 67 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/frame_consumer_proxy.h ('k') | remoting/client/frame_producer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698