diff options
Diffstat (limited to 'media/omx/input_buffer.h')
-rw-r--r-- | media/omx/input_buffer.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/media/omx/input_buffer.h b/media/omx/input_buffer.h index a15d1a1..9c6f442 100644 --- a/media/omx/input_buffer.h +++ b/media/omx/input_buffer.h @@ -7,10 +7,15 @@ // // This object is implemened using system memory. +#ifndef MEDIA_OMX_INPUT_BUFFER_H_ +#define MEDIA_OMX_INPUT_BUFFER_H_ + #include "base/basictypes.h" +#include "base/scoped_ptr.h" namespace media { +// TODO(hclam): consolidate our buffer implementations http://crbug.com/28654 class InputBuffer { public: // Creates an empty input buffer. @@ -20,24 +25,26 @@ class InputBuffer { // After construction, this object will be given the ownership of // |data| and is responsible for deleting it. InputBuffer(uint8* data, int size); - virtual ~InputBuffer(); + ~InputBuffer(); // Read from the this buffer into |data| with the maximum |size| bytes. // Returns number of bytes read. If a read is successful, the number // of used bytes will advances accordingly. // Returns a negative number on error. - virtual int Read(uint8* data, int size); + int Read(uint8* data, int size); // Returns true if this buffer is used. - virtual bool Used(); + bool Used(); // Returns true if this is an end-of-stream buffer. - virtual bool Eos(); + bool IsEndOfStream(); private: - uint8* data_; + scoped_array<uint8> data_; int size_; int used_; }; } // namespace media + +#endif // MEDIA_OMX_INPUT_BUFFER_H_ |