Index: remoting/client/jni/frame_consumer_impl.h |
diff --git a/remoting/client/jni/frame_consumer_impl.h b/remoting/client/jni/frame_consumer_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1ac0b31376b97ebabf134d217dd257992a00444d |
--- /dev/null |
+++ b/remoting/client/jni/frame_consumer_impl.h |
@@ -0,0 +1,54 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef REMOTING_CLIENT_JNI_FRAME_CONSUMER_IMPL_H_ |
+#define REMOTING_CLIENT_JNI_FRAME_CONSUMER_IMPL_H_ |
+ |
+#include "remoting/client/frame_consumer.h" |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/weak_ptr.h" |
+ |
+namespace webrtc { |
+class DesktopFrame; |
+} // namespace webrtc |
+ |
+namespace remoting { |
+class ChromotingJni; |
+class FrameProducer; |
+ |
+// FrameConsumer implementation that draws onto a JNI direct byte buffer. |
+class FrameConsumerImpl |
+ : public FrameConsumer, |
+ public base::SupportsWeakPtr<FrameConsumerImpl> { |
+ public: |
+ FrameConsumerImpl(); |
+ |
+ ~FrameConsumerImpl(); |
+ |
+ // This must be called once before the producer's source size is set. |
+ void set_frame_producer(FrameProducer* producer); |
+ |
+ // FrameConsumer implementation: |
+ virtual void ApplyBuffer(const SkISize& view_size, |
+ const SkIRect& clip_area, |
+ webrtc::DesktopFrame* buffer, |
+ const SkRegion& region) OVERRIDE; |
+ virtual void ReturnBuffer(webrtc::DesktopFrame* buffer) OVERRIDE; |
+ virtual void SetSourceSize(const SkISize& source_size, |
+ const SkIPoint& dpi) OVERRIDE; |
+ |
+ private: |
+ // State is to be used from the display thread. |
garykac
2013/07/16 01:28:20
This sounds odd. Can you clarify what you mean her
|
+ FrameProducer* frame_producer_; |
+ SkISize view_size_; |
+ SkIRect clip_area_; |
+ webrtc::DesktopFrame* buffer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FrameConsumerImpl); |
+}; |
+ |
+} // namespace remoting |
+ |
+#endif |