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

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: DecoderBufferSegment more description and change interface name 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
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
+ : public base::RefCountedThreadSafe<DecoderBufferSegment> {
+ public:
+ explicit DecoderBufferSegment(
miu 2016/09/08 01:07:34 This class should never be instantiated. It contai
erickung1 2016/09/13 03:52:53 Done.
+ const scoped_refptr<::media::DecoderBuffer>& decoder_buffer);
+
+ // Converts DecoderBufferSegment into byte array.
+ uint32_t ToBuffer(std::vector<uint8_t>* buffer);
+
+ // Converts byte array into DecoderBufferSegment.
+ static scoped_refptr<DecoderBufferSegment> FromBuffer(const uint8_t* data,
+ 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_

Powered by Google App Engine
This is Rietveld 408576698