diff options
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/data_buffer.h | 2 | ||||
-rw-r--r-- | media/base/decoder_buffer.cc | 22 | ||||
-rw-r--r-- | media/base/decoder_buffer.h | 13 | ||||
-rw-r--r-- | media/base/stream_parser_buffer.cc | 4 |
4 files changed, 3 insertions, 38 deletions
diff --git a/media/base/data_buffer.h b/media/base/data_buffer.h index 5c02dd6..76215c8 100644 --- a/media/base/data_buffer.h +++ b/media/base/data_buffer.h @@ -17,8 +17,6 @@ namespace media { // // Unlike DecoderBuffer, allocations are assumed to be allocated with the // default memory allocator (i.e., new uint8[]). -// -// NOTE: It is illegal to call any method when IsEndOfStream() is true. class MEDIA_EXPORT DataBuffer : public base::RefCountedThreadSafe<DataBuffer> { public: // Allocates buffer of size |buffer_size| >= 0. diff --git a/media/base/decoder_buffer.cc b/media/base/decoder_buffer.cc index 03f9bbb..a07ffac 100644 --- a/media/base/decoder_buffer.cc +++ b/media/base/decoder_buffer.cc @@ -48,47 +48,38 @@ scoped_refptr<DecoderBuffer> DecoderBuffer::CreateEOSBuffer() { } base::TimeDelta DecoderBuffer::GetTimestamp() const { - DCHECK(!IsEndOfStream()); return timestamp_; } void DecoderBuffer::SetTimestamp(const base::TimeDelta& timestamp) { - DCHECK(!IsEndOfStream()); timestamp_ = timestamp; } base::TimeDelta DecoderBuffer::GetDuration() const { - DCHECK(!IsEndOfStream()); return duration_; } void DecoderBuffer::SetDuration(const base::TimeDelta& duration) { - DCHECK(!IsEndOfStream()); duration_ = duration; } const uint8* DecoderBuffer::GetData() const { - DCHECK(!IsEndOfStream()); return data_.get(); } uint8* DecoderBuffer::GetWritableData() const { - DCHECK(!IsEndOfStream()); return data_.get(); } int DecoderBuffer::GetDataSize() const { - DCHECK(!IsEndOfStream()); return size_; } const DecryptConfig* DecoderBuffer::GetDecryptConfig() const { - DCHECK(!IsEndOfStream()); return decrypt_config_.get(); } void DecoderBuffer::SetDecryptConfig(scoped_ptr<DecryptConfig> decrypt_config) { - DCHECK(!IsEndOfStream()); decrypt_config_ = decrypt_config.Pass(); } @@ -96,17 +87,4 @@ bool DecoderBuffer::IsEndOfStream() const { return data_ == NULL; } -std::string DecoderBuffer::AsHumanReadableString() { - if (IsEndOfStream()) { - return "end of stream"; - } - - std::ostringstream s; - s << "timestamp: " << timestamp_.InMicroseconds() - << " duration: " << duration_.InMicroseconds() - << " size: " << size_ - << " encrypted: " << (decrypt_config_ != NULL); - return s.str(); -} - } // namespace media diff --git a/media/base/decoder_buffer.h b/media/base/decoder_buffer.h index c23e88f..7cb496b 100644 --- a/media/base/decoder_buffer.h +++ b/media/base/decoder_buffer.h @@ -5,8 +5,6 @@ #ifndef MEDIA_BASE_DECODER_BUFFER_H_ #define MEDIA_BASE_DECODER_BUFFER_H_ -#include <string> - #include "base/memory/aligned_memory.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" @@ -25,8 +23,6 @@ class DecryptConfig; // allocated using FFmpeg with particular alignment and padding requirements. // // Also includes decoder specific functionality for decryption. -// -// NOTE: It is illegal to call any method when IsEndOfStream() is true. class MEDIA_EXPORT DecoderBuffer : public base::RefCountedThreadSafe<DecoderBuffer> { public: @@ -47,10 +43,8 @@ class MEDIA_EXPORT DecoderBuffer // padded and aligned as necessary. |data| must not be NULL and |size| >= 0. static scoped_refptr<DecoderBuffer> CopyFrom(const uint8* data, int size); - // Create a DecoderBuffer indicating we've reached end of stream. - // - // Calling any method other than IsEndOfStream() on the resulting buffer - // is disallowed. + // Create a DecoderBuffer indicating we've reached end of stream. GetData() + // and GetWritableData() will return NULL and GetDataSize() will return 0. static scoped_refptr<DecoderBuffer> CreateEOSBuffer(); base::TimeDelta GetTimestamp() const; @@ -70,9 +64,6 @@ class MEDIA_EXPORT DecoderBuffer // If there's no data in this buffer, it represents end of stream. bool IsEndOfStream() const; - // Returns a human-readable string describing |*this|. - std::string AsHumanReadableString(); - protected: friend class base::RefCountedThreadSafe<DecoderBuffer>; diff --git a/media/base/stream_parser_buffer.cc b/media/base/stream_parser_buffer.cc index 1814382..13e649e 100644 --- a/media/base/stream_parser_buffer.cc +++ b/media/base/stream_parser_buffer.cc @@ -35,9 +35,7 @@ StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, is_keyframe_(is_keyframe), decode_timestamp_(kNoTimestamp()), config_id_(kInvalidConfigId) { - if (data) { - SetDuration(kNoTimestamp()); - } + SetDuration(kNoTimestamp()); } StreamParserBuffer::~StreamParserBuffer() { |