2003-11-04 04:32:33 +03:00
|
|
|
#ifndef _READER_PLUGIN_H
|
|
|
|
#define _READER_PLUGIN_H
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
#include <MediaTrack.h>
|
|
|
|
#include "MediaPlugin.h"
|
|
|
|
|
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
|
2003-11-04 04:32:33 +03:00
|
|
|
enum {
|
|
|
|
B_MEDIA_SEEK_TO_TIME = 0x10000,
|
|
|
|
B_MEDIA_SEEK_TO_FRAME = 0x20000
|
|
|
|
};
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
class Reader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Reader();
|
|
|
|
virtual ~Reader();
|
|
|
|
|
|
|
|
virtual const char *Copyright() = 0;
|
|
|
|
|
|
|
|
virtual status_t Sniff(int32 *streamCount) = 0;
|
|
|
|
|
2003-12-06 23:32:40 +03:00
|
|
|
virtual void GetFileFormatInfo(media_file_format *mff) = 0;
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
virtual status_t AllocateCookie(int32 streamNumber, void **cookie) = 0;
|
|
|
|
virtual status_t FreeCookie(void *cookie) = 0;
|
|
|
|
|
|
|
|
virtual status_t GetStreamInfo(void *cookie, int64 *frameCount, bigtime_t *duration,
|
2005-06-30 04:24:06 +04:00
|
|
|
media_format *format, const void **infoBuffer, size_t *infoSize) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
|
|
|
virtual status_t Seek(void *cookie,
|
2003-11-04 04:32:33 +03:00
|
|
|
uint32 seekTo,
|
2003-10-18 03:55:19 +04:00
|
|
|
int64 *frame, bigtime_t *time) = 0;
|
|
|
|
|
|
|
|
virtual status_t GetNextChunk(void *cookie,
|
2005-06-30 04:24:06 +04:00
|
|
|
const void **chunkBuffer, size_t *chunkSize,
|
2003-10-18 03:55:19 +04:00
|
|
|
media_header *mediaHeader) = 0;
|
|
|
|
|
|
|
|
BDataIO * Source();
|
|
|
|
|
|
|
|
private:
|
2003-11-04 04:32:33 +03:00
|
|
|
public: // XXX for test programs only
|
2003-10-18 03:55:19 +04:00
|
|
|
void Setup(BDataIO *source);
|
|
|
|
|
|
|
|
BDataIO * fSource;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-01-18 05:42:10 +03:00
|
|
|
class ReaderPlugin : public virtual MediaPlugin
|
2003-10-18 03:55:19 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual Reader *NewReader() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
} } // namespace BPrivate::media
|
|
|
|
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
|
2003-11-04 04:32:33 +03:00
|
|
|
#endif
|