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

Unified Diff: remoting/client/jni/frame_consumer_impl.h

Issue 19297003: Add support for drawing video onto a Java ByteBuffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.cc ('k') | remoting/client/jni/frame_consumer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.cc ('k') | remoting/client/jni/frame_consumer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698