| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // | 59 // |
| 60 // Calling any method other than end_of_stream() on the resulting buffer | 60 // Calling any method other than end_of_stream() on the resulting buffer |
| 61 // is disallowed. | 61 // is disallowed. |
| 62 static scoped_refptr<DecoderBuffer> CreateEOSBuffer(); | 62 static scoped_refptr<DecoderBuffer> CreateEOSBuffer(); |
| 63 | 63 |
| 64 base::TimeDelta timestamp() const { | 64 base::TimeDelta timestamp() const { |
| 65 DCHECK(!end_of_stream()); | 65 DCHECK(!end_of_stream()); |
| 66 return timestamp_; | 66 return timestamp_; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void set_timestamp(const base::TimeDelta& timestamp) { | 69 // TODO(dalecurtis): This should be renamed at some point, but to avoid a yak |
| 70 DCHECK(!end_of_stream()); | 70 // shave keep as a virtual with hacker_style() for now. |
| 71 timestamp_ = timestamp; | 71 virtual void set_timestamp(base::TimeDelta timestamp); |
| 72 } | |
| 73 | 72 |
| 74 base::TimeDelta duration() const { | 73 base::TimeDelta duration() const { |
| 75 DCHECK(!end_of_stream()); | 74 DCHECK(!end_of_stream()); |
| 76 return duration_; | 75 return duration_; |
| 77 } | 76 } |
| 78 | 77 |
| 79 void set_duration(const base::TimeDelta& duration) { | 78 void set_duration(base::TimeDelta duration) { |
| 80 DCHECK(!end_of_stream()); | 79 DCHECK(!end_of_stream()); |
| 81 duration_ = duration; | 80 duration_ = duration; |
| 82 } | 81 } |
| 83 | 82 |
| 84 const uint8* data() const { | 83 const uint8* data() const { |
| 85 DCHECK(!end_of_stream()); | 84 DCHECK(!end_of_stream()); |
| 86 return data_.get(); | 85 return data_.get(); |
| 87 } | 86 } |
| 88 | 87 |
| 89 uint8* writable_data() const { | 88 uint8* writable_data() const { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 177 |
| 179 // Constructor helper method for memory allocations. | 178 // Constructor helper method for memory allocations. |
| 180 void Initialize(); | 179 void Initialize(); |
| 181 | 180 |
| 182 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); | 181 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); |
| 183 }; | 182 }; |
| 184 | 183 |
| 185 } // namespace media | 184 } // namespace media |
| 186 | 185 |
| 187 #endif // MEDIA_BASE_DECODER_BUFFER_H_ | 186 #endif // MEDIA_BASE_DECODER_BUFFER_H_ |
| OLD | NEW |