#ifndef MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_
#define MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "media/filters/ffmpeg_glue.h"
namespace media {
class MEDIA_EXPORT InMemoryUrlProtocol : public FFmpegURLProtocol {
public:
InMemoryUrlProtocol(const uint8* buf, int64 size, bool streaming);
virtual ~InMemoryUrlProtocol();
virtual int Read(int size, uint8* data) OVERRIDE;
virtual bool GetPosition(int64* position_out) OVERRIDE;
virtual bool SetPosition(int64 position) OVERRIDE;
virtual bool GetSize(int64* size_out) OVERRIDE;
virtual bool IsStreaming() OVERRIDE;
private:
const uint8* data_;
int64 size_;
int64 position_;
bool streaming_;
DISALLOW_IMPLICIT_CONSTRUCTORS(InMemoryUrlProtocol);
};
}
#endif