OLD | NEW |
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 // FrameConsumerProxy is used to allow a FrameConsumer on the UI thread to be | 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 | 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 | 7 // the proxy's owner before tearing down the FrameConsumer, to prevent any |
8 // further invokations reaching it. | 8 // further invokations reaching it. |
9 | 9 |
10 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ | 10 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ |
(...skipping 12 matching lines...) Expand all Loading... |
23 : public base::RefCountedThreadSafe<FrameConsumerProxy>, | 23 : public base::RefCountedThreadSafe<FrameConsumerProxy>, |
24 public FrameConsumer { | 24 public FrameConsumer { |
25 public: | 25 public: |
26 // Constructs a proxy for |frame_consumer| which will trampoline invocations | 26 // Constructs a proxy for |frame_consumer| which will trampoline invocations |
27 // to |frame_consumer_message_loop|. | 27 // to |frame_consumer_message_loop|. |
28 FrameConsumerProxy(FrameConsumer* frame_consumer, | 28 FrameConsumerProxy(FrameConsumer* frame_consumer, |
29 base::MessageLoopProxy* frame_consumer_message_loop); | 29 base::MessageLoopProxy* frame_consumer_message_loop); |
30 virtual ~FrameConsumerProxy(); | 30 virtual ~FrameConsumerProxy(); |
31 | 31 |
32 // FrameConsumer implementation. | 32 // FrameConsumer implementation. |
33 virtual void AllocateFrame(media::VideoFrame::Format format, | 33 virtual void OnFrameReady(const SkISize& screen_size, |
34 const SkISize& size, | 34 SkISize* view_size_out, |
35 scoped_refptr<media::VideoFrame>* frame_out, | 35 SkIRect* clip_area_out, |
36 const base::Closure& done) OVERRIDE; | 36 scoped_ptr<pp::ImageData>* backing_store_out, |
37 virtual void ReleaseFrame(media::VideoFrame* frame) OVERRIDE; | 37 const base::Closure& done); |
38 virtual void OnPartialFrameOutput(media::VideoFrame* frame, | 38 virtual void OnPaintDone(scoped_ptr<pp::ImageData> backing_store, |
39 SkRegion* region, | 39 scoped_ptr<SkRegion> updated_region) OVERRIDE; |
40 const base::Closure& done) OVERRIDE; | |
41 | 40 |
42 // Detaches from |frame_consumer_|, ensuring no further calls reach it. | 41 // Detaches from |frame_consumer_|, ensuring no further calls reach it. |
43 // This must only be called from |frame_consumer_message_loop_|. | 42 // This must only be called from |frame_consumer_message_loop_|. |
44 void Detach(); | 43 void Detach(); |
45 | 44 |
46 private: | 45 private: |
47 FrameConsumer* frame_consumer_; | 46 FrameConsumer* frame_consumer_; |
48 | 47 |
49 scoped_refptr<base::MessageLoopProxy> frame_consumer_message_loop_; | 48 scoped_refptr<base::MessageLoopProxy> frame_consumer_message_loop_; |
50 | 49 |
51 DISALLOW_COPY_AND_ASSIGN(FrameConsumerProxy); | 50 DISALLOW_COPY_AND_ASSIGN(FrameConsumerProxy); |
52 }; | 51 }; |
53 | 52 |
54 } // namespace remoting | 53 } // namespace remoting |
55 | 54 |
56 #endif // REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ | 55 #endif // REMOTING_CLIENT_FRAME_CONSUMER_PROXY_H_ |
OLD | NEW |