2003-11-04 04:32:33 +03:00
|
|
|
#ifndef _READER_PLUGIN_H
|
|
|
|
#define _READER_PLUGIN_H
|
|
|
|
|
2018-10-28 17:45:44 +03:00
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
#include <MediaTrack.h>
|
2018-11-21 18:55:02 +03:00
|
|
|
#include <MetaData.h>
|
2018-10-29 11:41:21 +03:00
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
#include "MediaPlugin.h"
|
|
|
|
|
2018-10-28 17:45:44 +03:00
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
class PluginManager;
|
|
|
|
|
2003-11-04 04:32:33 +03:00
|
|
|
enum {
|
|
|
|
B_MEDIA_SEEK_TO_TIME = 0x10000,
|
|
|
|
B_MEDIA_SEEK_TO_FRAME = 0x20000
|
|
|
|
};
|
|
|
|
|
2018-10-28 17:45:44 +03:00
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
class BReader {
|
2003-10-18 03:55:19 +04:00
|
|
|
public:
|
2008-03-21 02:36:14 +03:00
|
|
|
virtual status_t Sniff(int32* streamCount) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2008-03-21 02:36:14 +03:00
|
|
|
virtual void GetFileFormatInfo(media_file_format* mff) = 0;
|
2018-11-22 11:48:04 +03:00
|
|
|
|
2018-11-21 18:55:02 +03:00
|
|
|
virtual status_t GetMetaData(BMetaData* data);
|
2018-11-22 11:48:04 +03:00
|
|
|
virtual status_t GetStreamMetaData(void* cookie,
|
|
|
|
BMetaData* data);
|
2003-12-06 23:32:40 +03:00
|
|
|
|
2008-03-21 02:36:14 +03:00
|
|
|
virtual status_t AllocateCookie(int32 streamNumber,
|
|
|
|
void** cookie) = 0;
|
|
|
|
virtual status_t FreeCookie(void* cookie) = 0;
|
2010-01-12 23:24:10 +03:00
|
|
|
|
2008-03-21 02:36:14 +03:00
|
|
|
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 flags, int64* frame,
|
|
|
|
bigtime_t* time);
|
|
|
|
virtual status_t FindKeyFrame(void* cookie, uint32 flags,
|
|
|
|
int64* frame, bigtime_t* time);
|
|
|
|
|
|
|
|
virtual status_t GetNextChunk(void* cookie,
|
|
|
|
const void** chunkBuffer, size_t* chunkSize,
|
|
|
|
media_header* mediaHeader) = 0;
|
2010-01-12 23:24:10 +03:00
|
|
|
|
2008-03-21 02:36:14 +03:00
|
|
|
BDataIO* Source() const;
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-11-18 14:05:48 +03:00
|
|
|
virtual status_t Perform(perform_code code, void* data);
|
|
|
|
|
2018-11-22 11:22:29 +03:00
|
|
|
protected:
|
2018-11-25 14:40:49 +03:00
|
|
|
BReader();
|
|
|
|
virtual ~BReader();
|
2018-11-22 11:22:29 +03:00
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
private:
|
2018-10-29 11:41:21 +03:00
|
|
|
void _Setup(BDataIO* source);
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2008-03-21 02:36:14 +03:00
|
|
|
BDataIO* fSource;
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
BMediaPlugin* fMediaPlugin;
|
2018-10-29 11:41:21 +03:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
// needed for plug-in reference count management
|
|
|
|
friend class PluginManager;
|
2018-11-22 11:22:29 +03:00
|
|
|
friend class MediaExtractor;
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-10-28 17:45:44 +03:00
|
|
|
virtual void _ReservedReader1();
|
|
|
|
virtual void _ReservedReader2();
|
|
|
|
virtual void _ReservedReader3();
|
|
|
|
virtual void _ReservedReader4();
|
|
|
|
virtual void _ReservedReader5();
|
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
uint32 fReserved[5];
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
class BReaderPlugin : public virtual BMediaPlugin {
|
2003-10-18 03:55:19 +04:00
|
|
|
public:
|
2018-11-25 14:40:49 +03:00
|
|
|
virtual BReader* NewReader() = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} } // namespace BPrivate::media
|
|
|
|
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
|
2008-03-21 02:36:14 +03:00
|
|
|
#endif // _READER_PLUGIN_H
|