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

Unified Diff: media/remoting/rpc/decoder_buffer_segment.h

Issue 2261503002: Define remote playback proto buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add OWNERS file Created 4 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 | « media/remoting/proto/remoting_rpc_message.proto ('k') | media/remoting/rpc/decoder_buffer_segment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/rpc/decoder_buffer_segment.h
diff --git a/media/remoting/rpc/decoder_buffer_segment.h b/media/remoting/rpc/decoder_buffer_segment.h
new file mode 100644
index 0000000000000000000000000000000000000000..4510e220844d49861883fbda43d2b67ab2ea7ea2
--- /dev/null
+++ b/media/remoting/rpc/decoder_buffer_segment.h
@@ -0,0 +1,49 @@
+// Copyright 2016 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 MEDIA_REMOTING_RPC_DECODER_BUFFER_SEGMENT_H_
+#define MEDIA_REMOTING_RPC_DECODER_BUFFER_SEGMENT_H_
+
+#include <cstdint>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "media/base/decoder_buffer.h"
+#include "media/remoting/remoting_rpc_message.pb.h"
+
+namespace media {
+namespace remoting {
+
+class DecoderBufferSegment
xjz 2016/09/02 18:29:38 Can you add some comments briefly describe this cl
erickung1 2016/09/06 09:37:24 Done.
+ : public base::RefCountedThreadSafe<DecoderBufferSegment> {
+ public:
+ explicit DecoderBufferSegment(
+ const scoped_refptr<::media::DecoderBuffer>& decoder_buffer);
+
+ // Converts DecoderBufferSegment into byte array.
+ uint32_t ToBuffer(std::vector<uint8_t>* buffer);
xjz 2016/09/02 18:29:38 Suggest use a more meaningful name, and use std::s
erickung1 2016/09/06 09:37:24 change it to std::string Serialzie();
miu 2016/09/08 01:07:34 If this string is going to be passed to the Mojo i
+
+ // Converts byte array into DecoderBufferSegment.
+ static scoped_refptr<DecoderBufferSegment> FromBuffer(const uint8_t* data,
xjz 2016/09/02 18:29:38 This method creates a new object. Maybe name it Cr
erickung1 2016/09/06 09:37:24 Done.
+ uint32_t size);
+
+ scoped_refptr<::media::DecoderBuffer> decoder_buffer() {
+ return decoder_buffer_;
+ }
+
+ private:
+ friend class base::RefCountedThreadSafe<DecoderBufferSegment>;
+ ~DecoderBufferSegment();
+
+ scoped_refptr<::media::DecoderBuffer> decoder_buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(DecoderBufferSegment);
+};
+
+} // namespace remoting
+} // namespace media
+
+#endif // MEDIA_REMOTING_RPC_DECODER_BUFFER_SEGMENT_H_
« no previous file with comments | « media/remoting/proto/remoting_rpc_message.proto ('k') | media/remoting/rpc/decoder_buffer_segment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698