Chromium Code Reviews| Index: media/filters/buffer_url_protocol.h |
| diff --git a/media/filters/buffer_url_protocol.h b/media/filters/buffer_url_protocol.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..772a8dba0f0edffe955bc8cdeda37699e5582ed5 |
| --- /dev/null |
| +++ b/media/filters/buffer_url_protocol.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_FILTERS_BUFFER_URL_PROTOCOL_H_ |
| +#define MEDIA_FILTERS_BUFFER_URL_PROTOCOL_H_ |
| + |
| +#include "media/filters/ffmpeg_glue.h" |
| + |
| +#include "base/basictypes.h" |
| + |
| +namespace media { |
| + |
| +// Simple FFmpegURLProtocol that reads from a buffer. |
| +// NOTE: This object does not copy the buffer so the |
| +// buffer pointer passed into the constructor |
| +// needs to remain valid for the entire lifetime of |
| +// this object. |
| +class BufferUrlProtocol : public FFmpegURLProtocol { |
|
scherkus (not reviewing)
2011/06/23 18:50:18
I had a feeling this code looked oddly familiar...
acolwell GONE FROM CHROMIUM
2011/06/23 22:42:17
Done.
|
| + public: |
| + BufferUrlProtocol(const uint8* buf, int size, bool streaming); |
| + virtual ~BufferUrlProtocol(); |
| + |
| + // FFmpegURLProtocol methods. |
| + virtual int Read(int size, uint8* data); |
| + virtual bool GetPosition(int64* position_out); |
| + virtual bool SetPosition(int64 position); |
| + virtual bool GetSize(int64* size_out); |
| + virtual bool IsStreaming(); |
| + |
| + private: |
| + const uint8* buf_; |
| + int size_; |
| + int offset_; |
| + bool streaming_; |
| + |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(BufferUrlProtocol); |
| +}; |
| + |
| +} |
|
scherkus (not reviewing)
2011/06/23 18:50:18
// namespace media
acolwell GONE FROM CHROMIUM
2011/06/23 22:42:17
Done.
|
| + |
| +#endif // MEDIA_FILTERS_BUFFER_URL_PROTOCOL_H_ |