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

Unified Diff: media/base/encoded_bitstream_buffer.h

Issue 12379011: Interfaces for encoded video sources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Client to be accessed through WeakPtr Created 7 years, 10 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 | « no previous file | media/base/encoded_bitstream_buffer.cc » ('j') | media/base/encoded_bitstream_buffer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/encoded_bitstream_buffer.h
diff --git a/media/base/encoded_bitstream_buffer.h b/media/base/encoded_bitstream_buffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..d969c2d4b6ecebcbdde74af6d79c70bb99975296
--- /dev/null
+++ b/media/base/encoded_bitstream_buffer.h
@@ -0,0 +1,74 @@
+// Copyright (c) 2013 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_BASE_ENCODED_BITSTREAM_BUFFER_H_
+#define MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_
+
+#include <ostream>
+
+#include "base/memory/ref_counted.h"
+#include "base/time.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+// General encoded video bitstream buffer.
+class EncodedBitstreamBuffer :
wjia(left Chromium) 2013/02/28 18:46:26 add MEDIA_EXPORT if this will be used outside medi
vmr 2013/03/01 14:24:00 Done.
+ public base::RefCountedThreadSafe<EncodedBitstreamBuffer> {
+ public:
+ // Constructor that allocates empty buffer of |size|.
+ EncodedBitstreamBuffer(size_t size, base::Time timestamp, int temporal_layer);
+ // Constructor that copies |size| bytes of data from |ptr| into newly
+ // allocated buffer.
+ EncodedBitstreamBuffer(uint8* ptr, size_t size, base::Time timestamp,
+ int temporal_layer);
wjia(left Chromium) 2013/02/28 18:46:26 For function declarations and definitions, put eac
vmr 2013/03/01 14:24:00 Done.
+
+ // Accessors for properties.
+ uint8* ptr() const;
+ size_t size() const;
+ bool key_frame() const;
+ bool altref_frame() const;
+ bool golden_frame() const;
+ base::Time timestamp() const;
+ int temporal_layer() const;
+ bool droppable() const;
+ bool layer_sync() const;
+
+ // Setters for properties.
+ void MarkKeyFrame();
+ void MarkAltRef();
+ void MarkGolden();
+ void MarkDroppable();
+ void MarkLayerSync();
+
+ protected:
+ virtual ~EncodedBitstreamBuffer(); // Destructor. Will deallocate the buffers.
+ friend class base::RefCountedThreadSafe<EncodedBitstreamBuffer>;
+
+ private:
+ uint8* ptr_;
wjia(left Chromium) 2013/02/28 18:46:26 use scoped_ptr<uint8[]>. how about changing name t
vmr 2013/03/01 14:24:00 Done.
+ size_t size_;
+ base::Time timestamp_;
+ bool key_frame_;
+ int temporal_layer_;
+ bool altref_frame_;
+ bool golden_frame_;
+ // Determines whether the buffer is droppable. With droppable buffers decoding
+ // can be skipped without affecting the decoding of subsequent buffers.
+ bool droppable_;
+ // For temporal base layer, the field must be set to 0 only if it only depends
+ // on previous key frame. For temporal enhancement layers the layer sync must
+ // be set to true, if the buffer depends only on the previous temporal base
+ // layer buffer.
+ bool layer_sync_;
+ DISALLOW_COPY_AND_ASSIGN(EncodedBitstreamBuffer);
+};
+
+} // namespace media
+
+// Pretty print operator for the EncodedBitstreamBuffer.
+std::ostream& operator<<(std::ostream& output,
+ const media::EncodedBitstreamBuffer& b);
wjia(left Chromium) 2013/02/28 18:46:26 Is this for debugging purpose?
vmr 2013/03/01 14:24:00 Yes, debug/logging to see the key properties withi
+
+#endif // MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_
« no previous file with comments | « no previous file | media/base/encoded_bitstream_buffer.cc » ('j') | media/base/encoded_bitstream_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698