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

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, 7 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/ios/bridge/client_proxy_unittest.mm ('k') | remoting/ios/bridge/frame_consumer_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..70eca2f0de91a7456272bb21851f1ee758b57dde
--- /dev/null
+++ b/remoting/ios/bridge/frame_consumer_bridge.h
@@ -0,0 +1,65 @@
+// 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/callback.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_vector.h"
+#include "base/memory/weak_ptr.h"
+#include "remoting/client/frame_consumer.h"
+#include "remoting/client/frame_producer.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
+
+namespace remoting {
+
+class FrameConsumerBridge : public base::SupportsWeakPtr<FrameConsumerBridge>,
+ public FrameConsumer {
+ public:
+ typedef base::Callback<void(const webrtc::DesktopSize& view_size,
+ webrtc::DesktopFrame* buffer,
+ const webrtc::DesktopRegion& region)>
+ OnFrameCallback;
+
+ // A callback is provided to return frame updates asynchronously.
+ explicit FrameConsumerBridge(OnFrameCallback callback);
+
+ virtual ~FrameConsumerBridge();
+ // This must be called before any other functional use.
+ 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. This can be called as soon as the producer is known, but is not
+ // required until ready to receive frames.
+ void DrawWithNewBuffer();
+
+ OnFrameCallback 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_
« no previous file with comments | « remoting/ios/bridge/client_proxy_unittest.mm ('k') | remoting/ios/bridge/frame_consumer_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698