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

Unified Diff: remoting/host/encoder.h

Issue 2690003: Copy the (early prototype of) remoting in Chrome into the public tree.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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/host/differ_block_unittest.cc ('k') | remoting/host/encoder_verbatim.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/encoder.h
===================================================================
--- remoting/host/encoder.h (revision 0)
+++ remoting/host/encoder.h (revision 0)
@@ -0,0 +1,63 @@
+// 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_HOST_ENCODER_H_
+#define REMOTING_HOST_ENCODER_H_
+
+#include "base/basictypes.h"
+#include "base/task.h"
+#include "remoting/base/protocol/chromotocol.pb.h"
+#include "remoting/host/capturer.h"
+
+namespace media {
+
+class DataBuffer;
+
+} // namespace media
+
+namespace remoting {
+
+// A class to perform the task of encoding a continous stream of
+// images.
+// This class operates asynchronously to enable maximum throughput.
+class Encoder {
+ public:
+ virtual ~Encoder() {}
+
+ // Encode an image stored in |input_data|. |dirty_rects| contains
+ // regions of update since last encode.
+ //
+ // If |key_frame| is true, the encoder should not reference
+ // previous encode and encode the full frame.
+ //
+ // When encoded data is available, partial or full |data_available_task|
+ // is called, data can be read from |data| and size is |data_size|.
+ // After the last data available event and encode has completed,
+ // |encode_done| is set to true and |data_available_task| is deleted.
+ //
+ // Note that |input_data| and |stride| are arrays of 3 elements.
+ //
+ // Implementation has to ensure that when |data_available_task| is called
+ // output parameters are stable.
+ virtual void Encode(const DirtyRects& dirty_rects,
+ const uint8** input_data,
+ const int* strides,
+ bool key_frame,
+ chromotocol_pb::UpdateStreamPacketHeader* header,
+ scoped_refptr<media::DataBuffer>* output_data,
+ bool* encode_done,
+ Task* data_available_task) = 0;
+
+ // Set the dimension of the incoming images. Need to call this before
+ // calling Encode().
+ virtual void SetSize(int width, int height) = 0;
+
+ // Set the pixel format of the incoming images. Need to call this before
+ // calling Encode().
+ virtual void SetPixelFormat(chromotocol_pb::PixelFormat pixel_format) = 0;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_ENCODER_H_
Property changes on: remoting/host/encoder.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « remoting/host/differ_block_unittest.cc ('k') | remoting/host/encoder_verbatim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698