Explanation for "missing" GetDuration, GetCopyright, GetTrackCount functions: These values will be provided from the extractor via the parameter web. This will require some new constants to be defined in ParameterWeb.h.
Also, a word on duration meanings: for multitrack files, it is expected that this duration will correspond to the "playable" duration of the file.
For example: you have two 2.5 hr tracks and one 2.4 hr track. As you decode frames, you reach 2.4 hr and return an error. In this situation you would return 2.4 hr.
If you stretch the smaller track to fit the time for the larger track, or if you continue to play the larger track
despite running out of data on the other, you would return 2.5 hr.
If by some odd chance you scale all files to play in 1 second, for example, you would return 1 second.
extern "C" {
status_t BExtractor * instantiate_extractor();
}
class BExtractor
{
public:
BExtractor(void);
virtual ~BExtractor(void);
// implement per BFileInterface::GetRef
virtual status_t GetSource(const BPositionIO * outSource,
BMimeType * outMimeType) = 0;
// implement per BFileInterface::SetRef
virtual status_t SetSource(const BPositionIO & source,
bigtime_t * outDuration) = 0;
// implement per BFileInterface::GetNextFileFormat
virtual status_t GetNextFileFormat(int32 * cookie,
media_file_format * outFormat) = 0;
// implement per BFileInterface::DisposeFileFormatCookie
virtual void DisposeFileFormatCookie(int32 cookie) = 0;
// implement per BMediaFile::GetFileFormatInfo
status_t GetFileFormatInfo(media_file_format *mfi) const;
// the extractor should implement this function in the
// manner described for BFileInterface::SniffRef
virtual status_t Sniff(char * outMimeType, float * outQuality) = 0;
// the extractor may implement this in the manner
// described for MediaAddOn::SniffType
virtual status_t SniffType(char * outMimeType, float * outQuality);
// same as others except that it uses the format passed
virtual status_t SniffFormat(media_format const & format,
char * outMimeType, float * outQuality);
// The extractor should do any cleanup required. After
// this function returns, the BPositionIO object will be
// closed and deleted by the system (not you)
virtual status_t Close(void);
// the extractor should provide several basic parameters
// through this interface, such as B_TRACK_COUNT, and B_DURATION
// see also BMediaFile::GetParameterValue
virtual status_t GetParameterValue(int32 id, const void * value,
size_t * size) = 0;
// the extractor may optionally supply parameters for the
// user to configure, such as buffering information(?)
// see also BMediaFile::SetParameterValue
virtual status_t SetParameterValue(int32 id, const void * value,
size_t size);
// the extractor may return a BParameterWeb for browsing
// or configuring the file format's parameters. returns
// NULL if the extractor doesn't support this.
// see also BMediaFile::Web
virtual BParameterWeb * Web(void);
...
}