OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 #ifndef REMOTING_IOS_BRIDGE_FRAME_CONSUMER_BRIDGE_H_ | |
6 #define REMOTING_IOS_BRIDGE_FRAME_CONSUMER_BRIDGE_H_ | |
7 | |
8 #include <list> | |
9 | |
10 #include "base/compiler_specific.h" | |
11 #include "base/memory/scoped_vector.h" | |
12 #include "remoting/client/frame_consumer.h" | |
13 #include "remoting/client/frame_producer.h" | |
14 | |
15 #include "remoting/ios/bridge/frame_consumer_bridge_callback.h" | |
16 | |
17 namespace remoting { | |
18 | |
19 // FrameConsumer implementation that draws onto a byte buffer. | |
dcaiafa
2014/03/19 01:14:15
Description doesn't match functionality.
aboone
2014/03/21 16:42:07
Done.
| |
20 class FrameConsumerBridge : public FrameConsumer { | |
21 public: | |
22 // The instance does not take ownership of |objc_runtime|. | |
dcaiafa
2014/03/19 01:14:15
Comment doesn't match signature.
aboone
2014/03/21 16:42:07
Done.
| |
23 explicit FrameConsumerBridge(FrameConsumerBridgeCallback callback); | |
24 | |
25 // This must be called once before the producer's source size is set. | |
26 void Initialize(FrameProducer* producer); | |
27 | |
28 // FrameConsumer implementation. | |
29 virtual void ApplyBuffer(const webrtc::DesktopSize& view_size, | |
30 const webrtc::DesktopRect& clip_area, | |
31 webrtc::DesktopFrame* buffer, | |
32 const webrtc::DesktopRegion& region, | |
33 const webrtc::DesktopRegion& shape) OVERRIDE; | |
34 virtual void ReturnBuffer(webrtc::DesktopFrame* buffer) OVERRIDE; | |
35 virtual void SetSourceSize(const webrtc::DesktopSize& source_size, | |
36 const webrtc::DesktopVector& dpi) OVERRIDE; | |
37 virtual PixelFormat GetPixelFormat() OVERRIDE; | |
38 | |
39 private: | |
40 // Allocates a new buffer of |view_size_|, and tells | |
41 // the producer to draw onto it. | |
42 void AllocateBuffer(); | |
43 | |
44 // Frees a frame buffer previously allocated by AllocateBuffer. | |
45 void FreeBuffer(webrtc::DesktopFrame* buffer); | |
46 | |
47 // Variables are to be used from the display thread. | |
48 | |
49 // Used to obtain task runner references and make calls to OBJ_C methods. | |
50 FrameConsumerBridgeCallback callback_; | |
51 | |
52 FrameProducer* frame_producer_; | |
53 webrtc::DesktopSize view_size_; | |
54 | |
55 // List of allocated image buffers. | |
56 ScopedVector<webrtc::DesktopFrame> buffers_; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(FrameConsumerBridge); | |
59 }; | |
60 | |
61 } // namespace remoting | |
62 | |
63 #endif // REMOTING_IOS_BRIDGE_FRAME_CONSUMER_BRIDGE_H_ | |
OLD | NEW |