Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_ | |
| 6 #define MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_ | |
| 7 | |
| 8 #include <ostream> | |
| 9 | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "base/time.h" | |
| 12 #include "media/base/media_export.h" | |
| 13 | |
| 14 namespace media { | |
| 15 | |
| 16 // General encoded video bitstream buffer. | |
| 17 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.
| |
| 18 public base::RefCountedThreadSafe<EncodedBitstreamBuffer> { | |
| 19 public: | |
| 20 // Constructor that allocates empty buffer of |size|. | |
| 21 EncodedBitstreamBuffer(size_t size, base::Time timestamp, int temporal_layer); | |
| 22 // Constructor that copies |size| bytes of data from |ptr| into newly | |
| 23 // allocated buffer. | |
| 24 EncodedBitstreamBuffer(uint8* ptr, size_t size, base::Time timestamp, | |
| 25 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.
| |
| 26 | |
| 27 // Accessors for properties. | |
| 28 uint8* ptr() const; | |
| 29 size_t size() const; | |
| 30 bool key_frame() const; | |
| 31 bool altref_frame() const; | |
| 32 bool golden_frame() const; | |
| 33 base::Time timestamp() const; | |
| 34 int temporal_layer() const; | |
| 35 bool droppable() const; | |
| 36 bool layer_sync() const; | |
| 37 | |
| 38 // Setters for properties. | |
| 39 void MarkKeyFrame(); | |
| 40 void MarkAltRef(); | |
| 41 void MarkGolden(); | |
| 42 void MarkDroppable(); | |
| 43 void MarkLayerSync(); | |
| 44 | |
| 45 protected: | |
| 46 virtual ~EncodedBitstreamBuffer(); // Destructor. Will deallocate the buffers. | |
| 47 friend class base::RefCountedThreadSafe<EncodedBitstreamBuffer>; | |
| 48 | |
| 49 private: | |
| 50 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.
| |
| 51 size_t size_; | |
| 52 base::Time timestamp_; | |
| 53 bool key_frame_; | |
| 54 int temporal_layer_; | |
| 55 bool altref_frame_; | |
| 56 bool golden_frame_; | |
| 57 // Determines whether the buffer is droppable. With droppable buffers decoding | |
| 58 // can be skipped without affecting the decoding of subsequent buffers. | |
| 59 bool droppable_; | |
| 60 // For temporal base layer, the field must be set to 0 only if it only depends | |
| 61 // on previous key frame. For temporal enhancement layers the layer sync must | |
| 62 // be set to true, if the buffer depends only on the previous temporal base | |
| 63 // layer buffer. | |
| 64 bool layer_sync_; | |
| 65 DISALLOW_COPY_AND_ASSIGN(EncodedBitstreamBuffer); | |
| 66 }; | |
| 67 | |
| 68 } // namespace media | |
| 69 | |
| 70 // Pretty print operator for the EncodedBitstreamBuffer. | |
| 71 std::ostream& operator<<(std::ostream& output, | |
| 72 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
| |
| 73 | |
| 74 #endif // MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_ | |
| OLD | NEW |