0d1adad317
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
74 lines
1.4 KiB
C++
74 lines
1.4 KiB
C++
#ifndef _MEDIA_EXTRACTOR_H
|
|
#define _MEDIA_EXTRACTOR_H
|
|
|
|
#include "ReaderPlugin.h"
|
|
#include "DecoderPlugin.h"
|
|
|
|
namespace BPrivate {
|
|
namespace media {
|
|
|
|
class ChunkCache;
|
|
|
|
struct stream_info
|
|
{
|
|
status_t status;
|
|
void * cookie;
|
|
bool hasCookie;
|
|
const void * infoBuffer;
|
|
size_t infoBufferSize;
|
|
ChunkCache * chunkCache;
|
|
media_format encodedFormat;
|
|
};
|
|
|
|
class MediaExtractor
|
|
{
|
|
public:
|
|
MediaExtractor(BDataIO * source, int32 flags);
|
|
~MediaExtractor();
|
|
|
|
status_t InitCheck();
|
|
|
|
void GetFileFormatInfo(media_file_format *mfi) const;
|
|
|
|
int32 StreamCount();
|
|
|
|
const media_format * EncodedFormat(int32 stream);
|
|
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,
|
|
const void **chunkBuffer, size_t *chunkSize,
|
|
media_header *mediaHeader);
|
|
|
|
status_t CreateDecoder(int32 stream, Decoder **decoder, media_codec_info *mci);
|
|
|
|
private:
|
|
static int32 extractor_thread(void *arg);
|
|
void ExtractorThread();
|
|
|
|
private:
|
|
status_t fErr;
|
|
|
|
sem_id fExtractorWaitSem;
|
|
thread_id fExtractorThread;
|
|
volatile bool fTerminateExtractor;
|
|
|
|
BDataIO *fSource;
|
|
Reader *fReader;
|
|
|
|
stream_info * fStreamInfo;
|
|
int32 fStreamCount;
|
|
|
|
media_file_format fMff;
|
|
};
|
|
|
|
}; // namespace media
|
|
}; // namespace BPrivate
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
#endif
|