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

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

Issue 1288063004: Simplify FrameConsumer interface. Remove FrameProducer interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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.h ('k') | remoting/client/frame_consumer_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // FrameConsumerProxy is used to allow a FrameConsumer on the UI thread to be
6 // invoked by a Decoder on the decoder thread. The Detach() method is used by
7 // the proxy's owner before tearing down the FrameConsumer, to prevent any
8 // further invokations reaching it.
9
10 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_
11 #define REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_
12
13 #include "base/memory/weak_ptr.h"
14 #include "remoting/client/frame_consumer.h"
15
16 namespace base {
17 class SingleThreadTaskRunner;
18 } // namespace base
19
20 namespace remoting {
21
22 class FrameConsumerProxy : public FrameConsumer {
23 public:
24 // Constructs a FrameConsumer proxy which can be passed to another thread,
25 // and will direct calls to |frame_consumer| on the thread from which the
26 // proxy was constructed.
27 FrameConsumerProxy(const base::WeakPtr<FrameConsumer>& frame_consumer);
28 ~FrameConsumerProxy() override;
29
30 // FrameConsumer implementation.
31 void ApplyBuffer(const webrtc::DesktopSize& view_size,
32 const webrtc::DesktopRect& clip_area,
33 webrtc::DesktopFrame* buffer,
34 const webrtc::DesktopRegion& region,
35 const webrtc::DesktopRegion* shape) override;
36 void ReturnBuffer(webrtc::DesktopFrame* buffer) override;
37 void SetSourceSize(const webrtc::DesktopSize& source_size,
38 const webrtc::DesktopVector& dpi) override;
39 PixelFormat GetPixelFormat() override;
40
41 private:
42 base::WeakPtr<FrameConsumer> frame_consumer_;
43
44 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
45 PixelFormat pixel_format_;
46
47 DISALLOW_COPY_AND_ASSIGN(FrameConsumerProxy);
48 };
49
50 } // namespace remoting
51
52 #endif // REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_
OLDNEW
« no previous file with comments | « remoting/client/frame_consumer.h ('k') | remoting/client/frame_consumer_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698