| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_DECODER_BUFFER_H_ | 5 #ifndef MEDIA_BASE_DECODER_BUFFER_H_ |
| 6 #define MEDIA_BASE_DECODER_BUFFER_H_ | 6 #define MEDIA_BASE_DECODER_BUFFER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Returns a human-readable string describing |*this|. | 83 // Returns a human-readable string describing |*this|. |
| 84 std::string AsHumanReadableString(); | 84 std::string AsHumanReadableString(); |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 friend class base::RefCountedThreadSafe<DecoderBuffer>; | 87 friend class base::RefCountedThreadSafe<DecoderBuffer>; |
| 88 | 88 |
| 89 // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer | 89 // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer |
| 90 // will be padded and aligned as necessary. If |data| is NULL then |data_| is | 90 // will be padded and aligned as necessary. If |data| is NULL then |data_| is |
| 91 // set to NULL and |buffer_size_| to 0. | 91 // set to NULL and |buffer_size_| to 0. |
| 92 DecoderBuffer(const uint8* data, int size); | |
| 93 DecoderBuffer(const uint8* data, int size, | 92 DecoderBuffer(const uint8* data, int size, |
| 94 const uint8* side_data, int side_data_size); | 93 const uint8* side_data, int side_data_size); |
| 95 virtual ~DecoderBuffer(); | 94 virtual ~DecoderBuffer(); |
| 96 | 95 |
| 97 private: | 96 private: |
| 98 base::TimeDelta timestamp_; | 97 base::TimeDelta timestamp_; |
| 99 base::TimeDelta duration_; | 98 base::TimeDelta duration_; |
| 100 | 99 |
| 101 int size_; | 100 int size_; |
| 102 scoped_ptr<uint8, base::ScopedPtrAlignedFree> data_; | 101 scoped_ptr<uint8, base::ScopedPtrAlignedFree> data_; |
| 103 int side_data_size_; | 102 int side_data_size_; |
| 104 scoped_ptr<uint8, base::ScopedPtrAlignedFree> side_data_; | 103 scoped_ptr<uint8, base::ScopedPtrAlignedFree> side_data_; |
| 105 scoped_ptr<DecryptConfig> decrypt_config_; | 104 scoped_ptr<DecryptConfig> decrypt_config_; |
| 106 | 105 |
| 107 // Constructor helper method for memory allocations. | 106 // Constructor helper method for memory allocations. |
| 108 void Initialize(); | 107 void Initialize(); |
| 109 | 108 |
| 110 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); | 109 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); |
| 111 }; | 110 }; |
| 112 | 111 |
| 113 } // namespace media | 112 } // namespace media |
| 114 | 113 |
| 115 #endif // MEDIA_BASE_DECODER_BUFFER_H_ | 114 #endif // MEDIA_BASE_DECODER_BUFFER_H_ |
| OLD | NEW |