Index: media/base/decoder_buffer.h |
diff --git a/media/base/decoder_buffer.h b/media/base/decoder_buffer.h |
index 22c0544b31980580dd6e8d29c1608bb56ae44fdb..b799cfa150a68e66671a4ee42705bb77eb253c1a 100644 |
--- a/media/base/decoder_buffer.h |
+++ b/media/base/decoder_buffer.h |
@@ -26,7 +26,7 @@ class DecryptConfig; |
// |
// Also includes decoder specific functionality for decryption. |
// |
-// NOTE: It is illegal to call any method when IsEndOfStream() is true. |
+// NOTE: It is illegal to call any method when end_of_stream() is true. |
class MEDIA_EXPORT DecoderBuffer |
: public base::RefCountedThreadSafe<DecoderBuffer> { |
public: |
@@ -56,29 +56,76 @@ class MEDIA_EXPORT DecoderBuffer |
// Create a DecoderBuffer indicating we've reached end of stream. |
// |
- // Calling any method other than IsEndOfStream() on the resulting buffer |
+ // Calling any method other than end_of_stream() on the resulting buffer |
// is disallowed. |
static scoped_refptr<DecoderBuffer> CreateEOSBuffer(); |
- base::TimeDelta GetTimestamp() const; |
- void SetTimestamp(const base::TimeDelta& timestamp); |
+ base::TimeDelta timestamp() const { |
+ DCHECK(!end_of_stream()); |
+ return timestamp_; |
+ } |
- base::TimeDelta GetDuration() const; |
- void SetDuration(const base::TimeDelta& duration); |
+ void set_timestamp(const base::TimeDelta& timestamp) { |
+ DCHECK(!end_of_stream()); |
+ timestamp_ = timestamp; |
+ } |
- const uint8* GetData() const; |
- uint8* GetWritableData() const; |
- int GetDataSize() const; |
+ base::TimeDelta duration() const { |
+ DCHECK(!end_of_stream()); |
+ return duration_; |
+ } |
- const uint8* GetSideData() const; |
- int GetSideDataSize() const; |
+ void set_duration(const base::TimeDelta& duration) { |
+ DCHECK(!end_of_stream()); |
+ duration_ = duration; |
+ } |
+ |
+ |
+ const uint8* data() const { |
+ DCHECK(!end_of_stream()); |
+ return data_.get(); |
+ } |
+ |
+ uint8* writable_data() const { |
+ DCHECK(!end_of_stream()); |
+ return data_.get(); |
+ } |
+ |
scherkus (not reviewing)
2013/07/09 00:57:53
remove extra blank line
Ty Overby
2013/07/12 18:23:50
Done.
|
+ |
+ int data_size() const { |
+ DCHECK(!end_of_stream()); |
+ return size_; |
+ } |
+ |
+ |
scherkus (not reviewing)
2013/07/09 00:57:53
remove extra blank line
Ty Overby
2013/07/12 18:23:50
Done.
|
+ const uint8* side_data() const { |
+ DCHECK(!end_of_stream()); |
+ return side_data_.get(); |
+ } |
+ |
+ int side_data_size() const { |
+ DCHECK(!end_of_stream()); |
+ return side_data_size_; |
+ } |
+ |
scherkus (not reviewing)
2013/07/09 00:57:53
remove extra blank line
Ty Overby
2013/07/12 18:23:50
Done.
|
+ |
+ const DecryptConfig* decrypt_config() const { |
+ DCHECK(!end_of_stream()); |
+ return decrypt_config_.get(); |
+ } |
+ |
+ void set_decrypt_config(scoped_ptr<DecryptConfig> decrypt_config) { |
+ DCHECK(!end_of_stream()); |
+ decrypt_config_ = decrypt_config.Pass(); |
+ } |
- const DecryptConfig* GetDecryptConfig() const; |
- void SetDecryptConfig(scoped_ptr<DecryptConfig> decrypt_config); |
// If there's no data in this buffer, it represents end of stream. |
- bool IsEndOfStream() const; |
+ bool end_of_stream() const { |
+ return data_ == NULL; |
+ } |
+ |
scherkus (not reviewing)
2013/07/09 00:57:53
remove extra blank line
Ty Overby
2013/07/12 18:23:50
Done.
|
// Returns a human-readable string describing |*this|. |
std::string AsHumanReadableString(); |