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

Unified Diff: remoting/ios/bridge/frame_consumer_bridge.h

Issue 186733007: iOS Chromoting Client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
Index: remoting/ios/bridge/frame_consumer_bridge.h
diff --git a/remoting/ios/bridge/frame_consumer_bridge.h b/remoting/ios/bridge/frame_consumer_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..ebb1a92edbf32c7b754b05b28219d0a0e5b1708f
--- /dev/null
+++ b/remoting/ios/bridge/frame_consumer_bridge.h
@@ -0,0 +1,63 @@
+// Copyright 2014 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_IOS_BRIDGE_FRAME_CONSUMER_BRIDGE_H_
+#define REMOTING_IOS_BRIDGE_FRAME_CONSUMER_BRIDGE_H_
+
+#include <list>
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_vector.h"
+#include "remoting/client/frame_consumer.h"
+#include "remoting/client/frame_producer.h"
+
+#include "remoting/ios/bridge/frame_consumer_bridge_callback.h"
+
+namespace remoting {
+
+// 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.
+class FrameConsumerBridge : public FrameConsumer {
+ public:
+ // 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.
+ explicit FrameConsumerBridge(FrameConsumerBridgeCallback callback);
+
+ // This must be called once before the producer's source size is set.
+ void Initialize(FrameProducer* producer);
+
+ // FrameConsumer implementation.
+ virtual void ApplyBuffer(const webrtc::DesktopSize& view_size,
+ const webrtc::DesktopRect& clip_area,
+ webrtc::DesktopFrame* buffer,
+ const webrtc::DesktopRegion& region,
+ const webrtc::DesktopRegion& shape) OVERRIDE;
+ virtual void ReturnBuffer(webrtc::DesktopFrame* buffer) OVERRIDE;
+ virtual void SetSourceSize(const webrtc::DesktopSize& source_size,
+ const webrtc::DesktopVector& dpi) OVERRIDE;
+ virtual PixelFormat GetPixelFormat() OVERRIDE;
+
+ private:
+ // Allocates a new buffer of |view_size_|, and tells
+ // the producer to draw onto it.
+ void AllocateBuffer();
+
+ // Frees a frame buffer previously allocated by AllocateBuffer.
+ void FreeBuffer(webrtc::DesktopFrame* buffer);
+
+ // Variables are to be used from the display thread.
+
+ // Used to obtain task runner references and make calls to OBJ_C methods.
+ FrameConsumerBridgeCallback callback_;
+
+ FrameProducer* frame_producer_;
+ webrtc::DesktopSize view_size_;
+
+ // List of allocated image buffers.
+ ScopedVector<webrtc::DesktopFrame> buffers_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameConsumerBridge);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_IOS_BRIDGE_FRAME_CONSUMER_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698