haiku/headers/private/media/ReaderPlugin.h
Marcus Overhagen 0d1adad317 Media Codec API just got a visit from the coding style police.
We now use "const" for the chunk buffer pointer returned by GetNextChunk,
because the buffer is not supposed to be modified by the codec.
size_t is used for the size where applicable. This matches BMediaDecoder.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-30 00:24:06 +00:00

61 lines
1.2 KiB
C++

#ifndef _READER_PLUGIN_H
#define _READER_PLUGIN_H
#include <MediaTrack.h>
#include "MediaPlugin.h"
namespace BPrivate { namespace media {
enum {
B_MEDIA_SEEK_TO_TIME = 0x10000,
B_MEDIA_SEEK_TO_FRAME = 0x20000
};
class Reader
{
public:
Reader();
virtual ~Reader();
virtual const char *Copyright() = 0;
virtual status_t Sniff(int32 *streamCount) = 0;
virtual void GetFileFormatInfo(media_file_format *mff) = 0;
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,
media_format *format, const void **infoBuffer, size_t *infoSize) = 0;
virtual status_t Seek(void *cookie,
uint32 seekTo,
int64 *frame, bigtime_t *time) = 0;
virtual status_t GetNextChunk(void *cookie,
const void **chunkBuffer, size_t *chunkSize,
media_header *mediaHeader) = 0;
BDataIO * Source();
private:
public: // XXX for test programs only
void Setup(BDataIO *source);
BDataIO * fSource;
};
class ReaderPlugin : public virtual MediaPlugin
{
public:
virtual Reader *NewReader() = 0;
};
} } // namespace BPrivate::media
using namespace BPrivate::media;
#endif