2003-11-24 01:19:21 +03:00
|
|
|
#ifndef _MEDIA_EXTRACTOR_H
|
|
|
|
#define _MEDIA_EXTRACTOR_H
|
|
|
|
|
|
|
|
#include "ReaderPlugin.h"
|
|
|
|
#include "DecoderPlugin.h"
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
namespace media {
|
|
|
|
|
2003-11-24 02:50:27 +03:00
|
|
|
struct stream_info
|
|
|
|
{
|
|
|
|
status_t status;
|
|
|
|
void * cookie;
|
2004-02-29 23:09:42 +03:00
|
|
|
bool hasCookie;
|
2003-11-24 02:50:27 +03:00
|
|
|
void * infoBuffer;
|
|
|
|
int32 infoBufferSize;
|
|
|
|
media_format encodedFormat;
|
|
|
|
};
|
|
|
|
|
2003-11-24 01:19:21 +03:00
|
|
|
class MediaExtractor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MediaExtractor(BDataIO * source, int32 flags);
|
|
|
|
~MediaExtractor();
|
|
|
|
|
|
|
|
status_t InitCheck();
|
|
|
|
|
|
|
|
void GetFileFormatInfo(media_file_format *mfi) const;
|
|
|
|
|
|
|
|
int32 StreamCount();
|
|
|
|
|
2003-12-07 02:21:23 +03:00
|
|
|
const media_format * EncodedFormat(int32 stream);
|
2003-11-24 01:19:21 +03:00
|
|
|
int64 CountFrames(int32 stream) const;
|
|
|
|
bigtime_t Duration(int32 stream) const;
|
|
|
|
|
|
|
|
status_t Seek(int32 stream, uint32 seekTo,
|
|
|
|
int64 *frame, bigtime_t *time);
|
|
|
|
|
|
|
|
status_t GetNextChunk(int32 stream,
|
|
|
|
void **chunkBuffer, int32 *chunkSize,
|
|
|
|
media_header *mediaHeader);
|
|
|
|
|
|
|
|
status_t CreateDecoder(int32 stream, Decoder **decoder, media_codec_info *mci);
|
2003-11-24 02:50:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
status_t fErr;
|
|
|
|
|
|
|
|
BDataIO *fSource;
|
|
|
|
Reader *fReader;
|
2003-11-24 01:19:21 +03:00
|
|
|
|
2003-11-24 02:50:27 +03:00
|
|
|
stream_info * fStreamInfo;
|
|
|
|
int32 fStreamCount;
|
|
|
|
|
|
|
|
media_file_format fMff;
|
2003-11-24 01:19:21 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace media
|
|
|
|
}; // namespace BPrivate
|
|
|
|
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
|
|
|
|
#endif
|