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..c8eef3dbc6984d2369c992ee7508a7e728e935f7 |
--- /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 |
Wez
2013/07/16 02:18:12
Shouldn't this be something like e.g. JniFrameCons
solb
2013/07/16 18:00:57
Done.
|
+ : public FrameConsumer, |
+ public base::SupportsWeakPtr<FrameConsumerImpl> { |
Wez
2013/07/16 02:18:12
Use WeakPtrFactory rather than SupportsWeakPtr, pl
solb
2013/07/16 18:00:57
Done.
|
+ public: |
+ FrameConsumerImpl(); |
+ |
Wez
2013/07/16 02:18:12
No need for a blank line here.
solb
2013/07/16 18:00:57
Done.
|
+ ~FrameConsumerImpl(); |
Wez
2013/07/16 02:18:12
virtual
solb
2013/07/16 18:00:57
Thanks!
|
+ |
+ // This must be called once before the producer's source size is set. |
+ void set_frame_producer(FrameProducer* producer); |
+ |
+ // FrameConsumer implementation: |
Wez
2013/07/16 02:18:12
Here and everywhere else, please end sentences wit
solb
2013/07/16 18:00:57
Done.
|
+ 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: |
+ // These variables are to be used from the display thread. |
+ FrameProducer* frame_producer_; |
+ SkISize view_size_; |
+ SkIRect clip_area_; |
+ webrtc::DesktopFrame* buffer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FrameConsumerImpl); |
+}; |
+ |
+} // namespace remoting |
+ |
+#endif |