* Added FindKeyFrame() method to MediaExtractor, it is similar to Seek(),

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
This commit is contained in:
Stephan Aßmus
2008-03-20 23:36:14 +00:00
parent e958cea514
commit d830aa92ce
16 changed files with 233 additions and 127 deletions
+2
View File
@@ -38,6 +38,8 @@ public:
status_t Seek(int32 stream, uint32 seekTo,
int64 *frame, bigtime_t *time);
status_t FindKeyFrame(int32 stream, uint32 seekTo,
int64 *frame, bigtime_t *time) const;
status_t GetNextChunk(int32 stream,
const void **chunkBuffer, size_t *chunkSize,
+26 -24
View File
@@ -11,50 +11,52 @@ enum {
B_MEDIA_SEEK_TO_FRAME = 0x20000
};
class Reader
{
class Reader {
public:
Reader();
virtual ~Reader();
Reader();
virtual ~Reader();
virtual const char *Copyright() = 0;
virtual const char* Copyright() = 0;
virtual status_t Sniff(int32 *streamCount) = 0;
virtual status_t Sniff(int32* streamCount) = 0;
virtual void GetFileFormatInfo(media_file_format *mff) = 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 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 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 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;
virtual status_t GetNextChunk(void* cookie,
const void** chunkBuffer, size_t* chunkSize,
media_header* mediaHeader) = 0;
BDataIO * Source();
BDataIO* Source() const;
private:
public: // XXX for test programs only
void Setup(BDataIO *source);
void Setup(BDataIO* source);
BDataIO * fSource;
BDataIO* fSource;
};
class ReaderPlugin : public virtual MediaPlugin
{
class ReaderPlugin : public virtual MediaPlugin {
public:
virtual Reader *NewReader() = 0;
virtual Reader* NewReader() = 0;
};
} } // namespace BPrivate::media
using namespace BPrivate::media;
#endif
#endif // _READER_PLUGIN_H