d830aa92ce
but operates "read-only". * Added FindKeyFrame() method to ReaderPlugin, see above. * Reformated ReaderPlugin header. Added const qualifier to Source() method. * Small cleanups in BMediaTrack::SeekToTime() and SeekToFrame(). Added TODOs with regards to "seeking" in decoders, wich should IMHO be revised. (Codecs cannot seek in the stream, they only get fed chunk data. The only thing they can do is reset themselves in preparation for a discontinuity of the chunk data...) * Implemented BMediaTrack::FindKeyframeByXX() methods via the new MediaExtractor::FindKeyFrame() method. * Implemented Seek() and FindKeyFrame() methods in the Reader base class, returning B_NOT_SUPPORTED. I think this makes sense and also I don't have to adapt all existing Reader plugins for the new FindKeyFrame() call. :-) * Implemeneted FindKeyFrame() in the avi_reader. The OpenDMLFile class gets Seek() extended for a "read-only" mode. Currently the implementation is broken (as before) with regards to keyframes. These were ignored before and I have not changed them to actually support the seek flags with regards to keyframes. That's the interesting TODO... * Some reformatting here and there in avi_reader code, sorry for the mixup. The only actual change is the support for the read-only flag to Seek(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24495 a95241bf-73f2-0310-859d-f6bbb57e9c96
63 lines
1.4 KiB
C++
63 lines
1.4 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 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;
|
|
|
|
BDataIO* Source() const;
|
|
|
|
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 // _READER_PLUGIN_H
|