| Index: media/base/seekable_buffer.h
|
| diff --git a/media/base/seekable_buffer.h b/media/base/seekable_buffer.h
|
| index eb7ba84d745fbe9842f25418d88a59bbbea38c7a..0a3ff72aa8e3ff93689c57631f0dd217608dd0cd 100644
|
| --- a/media/base/seekable_buffer.h
|
| +++ b/media/base/seekable_buffer.h
|
| @@ -45,7 +45,7 @@ class MEDIA_EXPORT SeekableBuffer {
|
| public:
|
| // Constructs an instance with |forward_capacity| and |backward_capacity|.
|
| // The values are in bytes.
|
| - SeekableBuffer(size_t backward_capacity, size_t forward_capacity);
|
| + SeekableBuffer(int backward_capacity, int forward_capacity);
|
|
|
| ~SeekableBuffer();
|
|
|
| @@ -57,20 +57,20 @@ class MEDIA_EXPORT SeekableBuffer {
|
| // The current read position will advance by the amount of bytes read. If
|
| // reading caused backward_bytes() to exceed backward_capacity(), an eviction
|
| // of the backward buffer will be done internally.
|
| - size_t Read(uint8* data, size_t size);
|
| + int Read(uint8* data, int size);
|
|
|
| // Copies up to |size| bytes from current position to |data|. Returns
|
| // number of bytes copied. Doesn't advance current position. Optionally
|
| // starts at a |forward_offset| from current position.
|
| - size_t Peek(uint8* data, size_t size) { return Peek(data, size, 0); }
|
| - size_t Peek(uint8* data, size_t size, size_t forward_offset);
|
| + int Peek(uint8* data, int size) { return Peek(data, size, 0); }
|
| + int Peek(uint8* data, int size, int forward_offset);
|
|
|
| // Returns pointer to the current chunk of data that is being consumed.
|
| // If there is no data left in the buffer false is returned, otherwise
|
| // true is returned and |data| and |size| are updated. The returned
|
| // |data| value becomes invalid when Read(), Append() or Seek()
|
| // are called.
|
| - bool GetCurrentChunk(const uint8** data, size_t* size) const;
|
| + bool GetCurrentChunk(const uint8** data, int* size) const;
|
|
|
| // Appends |buffer_in| to this buffer. Returns false if forward_bytes() is
|
| // greater than or equals to forward_capacity(), true otherwise. The data
|
| @@ -79,7 +79,7 @@ class MEDIA_EXPORT SeekableBuffer {
|
|
|
| // Appends |size| bytes of |data| to the buffer. Result is the same
|
| // as for Append(Buffer*).
|
| - bool Append(const uint8* data, size_t size);
|
| + bool Append(const uint8* data, int size);
|
|
|
| // Moves the read position by |offset| bytes. If |offset| is positive, the
|
| // current read position is moved forward. If negative, the current read
|
| @@ -94,34 +94,34 @@ class MEDIA_EXPORT SeekableBuffer {
|
| bool Seek(int32 offset);
|
|
|
| // Returns the number of bytes buffered beyond the current read position.
|
| - size_t forward_bytes() const { return forward_bytes_; }
|
| + int forward_bytes() const { return forward_bytes_; }
|
|
|
| // Returns the number of bytes buffered that precedes the current read
|
| // position.
|
| - size_t backward_bytes() const { return backward_bytes_; }
|
| + int backward_bytes() const { return backward_bytes_; }
|
|
|
| // Sets the forward_capacity to |new_forward_capacity| bytes.
|
| - void set_forward_capacity(size_t new_forward_capacity) {
|
| + void set_forward_capacity(int new_forward_capacity) {
|
| forward_capacity_ = new_forward_capacity;
|
| }
|
|
|
| // Sets the backward_capacity to |new_backward_capacity| bytes.
|
| - void set_backward_capacity(size_t new_backward_capacity) {
|
| + void set_backward_capacity(int new_backward_capacity) {
|
| backward_capacity_ = new_backward_capacity;
|
| }
|
|
|
| // Returns the maximum number of bytes that should be kept in the forward
|
| // direction.
|
| - size_t forward_capacity() const { return forward_capacity_; }
|
| + int forward_capacity() const { return forward_capacity_; }
|
|
|
| // Returns the maximum number of bytes that should be kept in the backward
|
| // direction.
|
| - size_t backward_capacity() const { return backward_capacity_; }
|
| + int backward_capacity() const { return backward_capacity_; }
|
|
|
| // Returns the current timestamp, taking into account current offset. The
|
| // value calculated based on the timestamp of the current buffer. If
|
| // timestamp for the current buffer is set to 0 or the data was added with
|
| - // Append(const uint*, size_t), then returns value that corresponds to the
|
| + // Append(const uint*, int), then returns value that corresponds to the
|
| // last position in a buffer that had timestamp set.
|
| // kNoTimestamp() is returned if no buffers we read from had timestamp set.
|
| base::TimeDelta current_time() const { return current_time_; }
|
| @@ -139,36 +139,36 @@ class MEDIA_EXPORT SeekableBuffer {
|
| // of bytes read. The current read position will be moved forward by the
|
| // number of bytes read. If |data| is NULL, only the current read position
|
| // will advance but no data will be copied.
|
| - size_t InternalRead(
|
| - uint8* data, size_t size, bool advance_position, size_t forward_offset);
|
| + int InternalRead(
|
| + uint8* data, int size, bool advance_position, int forward_offset);
|
|
|
| // A helper method that moves the current read position forward by |size|
|
| // bytes.
|
| // If the return value is true, the operation completed successfully.
|
| // If the return value is false, |size| is greater than forward_bytes() and
|
| // the seek operation failed. The current read position is not updated.
|
| - bool SeekForward(size_t size);
|
| + bool SeekForward(int size);
|
|
|
| // A helper method that moves the current read position backward by |size|
|
| // bytes.
|
| // If the return value is true, the operation completed successfully.
|
| // If the return value is false, |size| is greater than backward_bytes() and
|
| // the seek operation failed. The current read position is not updated.
|
| - bool SeekBackward(size_t size);
|
| + bool SeekBackward(int size);
|
|
|
| // Updates |current_time_| with the time that corresponds to the
|
| // specified position in the buffer.
|
| - void UpdateCurrentTime(BufferQueue::iterator buffer, size_t offset);
|
| + void UpdateCurrentTime(BufferQueue::iterator buffer, int offset);
|
|
|
| BufferQueue::iterator current_buffer_;
|
| BufferQueue buffers_;
|
| - size_t current_buffer_offset_;
|
| + int current_buffer_offset_;
|
|
|
| - size_t backward_capacity_;
|
| - size_t backward_bytes_;
|
| + int backward_capacity_;
|
| + int backward_bytes_;
|
|
|
| - size_t forward_capacity_;
|
| - size_t forward_bytes_;
|
| + int forward_capacity_;
|
| + int forward_bytes_;
|
|
|
| // Keeps track of the most recent time we've seen in case the |buffers_| is
|
| // empty when our owner asks what time it is.
|
|
|