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

Unified Diff: remoting/client/frame_consumer.h

Issue 3335012: Add in a new FrameConsumer interface, Decode API, and a RectangleUpdateDecoder abstraction. (Closed)
Patch Set: Fix silly compile errors Created 10 years, 3 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/base/protocol/chromotocol.proto ('k') | remoting/client/rectangle_update_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/frame_consumer.h
diff --git a/remoting/client/frame_consumer.h b/remoting/client/frame_consumer.h
new file mode 100644
index 0000000000000000000000000000000000000000..05c4448db149cdcaac0d0d4f4c751f6b7edf0dd5
--- /dev/null
+++ b/remoting/client/frame_consumer.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 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_FRAME_CONSUMER_H_
+#define REMOTING_CLIENT_FRAME_CONSUMER_H_
+
+namespace remoting {
+
+class FrameConsumer {
+ public:
+ FrameConsumer() {}
+ virtual ~FrameConsumer() {}
+
+ // Request a frame be allocated from the FrameConsumer.
+ //
+ // If a frame cannot be allocated to fit the format, and height/width
+ // requirements, |frame_out| will be set to NULL.
+ //
+ // An allocated frame will have at least the width and height requested, but
+ // may be bigger. Query the retrun frame for the actual frame size, stride,
+ // etc.
+ //
+ // The AllocateFrame call is asynchronous. From invocation, until when the
+ // |done| callback is invoked, |frame_out| should be considered to be locked
+ // by the FrameConsumer, must remain a valid pointer, and should not be
+ // examined or modified. After |done| is called, the |frame_out| will
+ // contain a result of the allocation. If a frame could not be allocated,
+ // |frame_out| will be NULL.
+ //
+ // All frames retrieved via the AllocateFrame call must be released by a
+ // corresponding call ReleaseFrame(scoped_refptr<VideoFrame>* frame_out.
+ virtual void AllocateFrame(media::VideoFrame::Format format,
+ size_t width,
+ size_t height,
+ base::TimeDelta timestamp,
+ base::TimeDelta duration,
+ scoped_refptr<media::VideoFrame>* frame_out,
+ Task* done) = 0;
+
+ virtual void ReleaseFrame(media::VideoFrame* frame) = 0;
+
+ // OnPartialFrameOutput() is called every time at least one rectangle of
+ // output is produced. The |frame| is guaranteed to have valid data for
+ // every region included in the |rects| list.
+ //
+ // Both |frame| and |rects| are guaranteed to be valid until the |done|
+ // callback is invoked.
+ virtual void OnPartialFrameOutput(media::VideoFrame* frame,
+ UpdatedRects* rects,
+ Task* done) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FrameConsumer);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_FRAME_CONSUMER_H_
« no previous file with comments | « remoting/base/protocol/chromotocol.proto ('k') | remoting/client/rectangle_update_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698