Codec Kit: Rename classes to BFoo pattern
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
#ifndef _CODEC_ROSTER_H
|
||||
#define _CODEC_ROSTER_H
|
||||
|
||||
|
||||
#include <Decoder.h>
|
||||
#include <Encoder.h>
|
||||
#include <MediaDefs.h>
|
||||
#include <Reader.h>
|
||||
#include <Streamer.h>
|
||||
@@ -19,32 +20,32 @@ namespace media {
|
||||
class BCodecRoster {
|
||||
public:
|
||||
|
||||
static status_t InstantiateReader(Reader** reader,
|
||||
static status_t InstantiateReader(BReader** reader,
|
||||
int32* streamCount, media_file_format* mff,
|
||||
BDataIO* source);
|
||||
static void ReleaseReader(Reader* reader);
|
||||
static void ReleaseReader(BReader* reader);
|
||||
|
||||
static status_t InstantiateDecoder(Decoder** decoder,
|
||||
static status_t InstantiateDecoder(BDecoder** decoder,
|
||||
const media_format& format);
|
||||
static status_t InstantiateDecoder(Decoder** decoder,
|
||||
static status_t InstantiateDecoder(BDecoder** decoder,
|
||||
const media_codec_info& mci);
|
||||
static void ReleaseDecoder(Decoder* decoder);
|
||||
static void ReleaseDecoder(BDecoder* decoder);
|
||||
|
||||
static status_t InstantiateWriter(Writer** writer,
|
||||
static status_t InstantiateWriter(BWriter** writer,
|
||||
const media_file_format& mff,
|
||||
BDataIO* target);
|
||||
static void ReleaseWriter(Writer* writer);
|
||||
static void ReleaseWriter(BWriter* writer);
|
||||
|
||||
static status_t InstantiateEncoder(Encoder** encoder,
|
||||
static status_t InstantiateEncoder(BEncoder** encoder,
|
||||
const media_format& format);
|
||||
static status_t InstantiateEncoder(Encoder** encoder,
|
||||
static status_t InstantiateEncoder(BEncoder** encoder,
|
||||
const media_codec_info* codecInfo,
|
||||
uint32 flags);
|
||||
static void ReleaseEncoder(Encoder* encoder);
|
||||
static void ReleaseEncoder(BEncoder* encoder);
|
||||
|
||||
static status_t InstantiateStreamer(Streamer** streamer,
|
||||
static status_t InstantiateStreamer(BStreamer** streamer,
|
||||
BUrl url, BDataIO** source);
|
||||
static void ReleaseStreamer(Streamer* streamer);
|
||||
static void ReleaseStreamer(BStreamer* streamer);
|
||||
|
||||
/*! \brief Use this to iterate through the available encoders for a given file
|
||||
format.
|
||||
|
||||
+11
-11
@@ -12,16 +12,16 @@ namespace BPrivate { namespace media {
|
||||
|
||||
class PluginManager;
|
||||
|
||||
class ChunkProvider {
|
||||
class BChunkProvider {
|
||||
public:
|
||||
virtual ~ChunkProvider() {};
|
||||
virtual ~BChunkProvider() {};
|
||||
virtual status_t GetNextChunk(const void** chunkBuffer,
|
||||
size_t* chunkSize,
|
||||
media_header* mediaHeader) = 0;
|
||||
};
|
||||
|
||||
|
||||
class Decoder {
|
||||
class BDecoder {
|
||||
public:
|
||||
virtual void GetCodecInfo(media_codec_info* codecInfo) = 0;
|
||||
|
||||
@@ -43,19 +43,19 @@ public:
|
||||
size_t* chunkSize,
|
||||
media_header* mediaHeader);
|
||||
|
||||
void SetChunkProvider(ChunkProvider* provider);
|
||||
void SetChunkProvider(BChunkProvider* provider);
|
||||
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
protected:
|
||||
Decoder();
|
||||
virtual ~Decoder();
|
||||
BDecoder();
|
||||
virtual ~BDecoder();
|
||||
|
||||
|
||||
private:
|
||||
ChunkProvider* fChunkProvider;
|
||||
BChunkProvider* fChunkProvider;
|
||||
|
||||
MediaPlugin* fMediaPlugin;
|
||||
BMediaPlugin* fMediaPlugin;
|
||||
|
||||
// needed for plug-in reference count management
|
||||
friend class PluginManager;
|
||||
@@ -70,11 +70,11 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class DecoderPlugin : public virtual MediaPlugin {
|
||||
class BDecoderPlugin : public virtual BMediaPlugin {
|
||||
public:
|
||||
DecoderPlugin();
|
||||
BDecoderPlugin();
|
||||
|
||||
virtual Decoder* NewDecoder(uint index) = 0;
|
||||
virtual BDecoder* NewDecoder(uint index) = 0;
|
||||
virtual status_t GetSupportedFormats(media_format** formats,
|
||||
size_t* count) = 0;
|
||||
};
|
||||
|
||||
+12
-12
@@ -17,16 +17,16 @@ namespace BPrivate { namespace media {
|
||||
|
||||
class PluginManager;
|
||||
|
||||
class ChunkWriter {
|
||||
class BChunkWriter {
|
||||
public:
|
||||
virtual ~ChunkWriter() {};
|
||||
virtual ~BChunkWriter() {};
|
||||
virtual status_t WriteChunk(const void* chunkBuffer,
|
||||
size_t chunkSize,
|
||||
media_encode_info* encodeInfo) = 0;
|
||||
};
|
||||
|
||||
|
||||
class Encoder {
|
||||
class BEncoder {
|
||||
public:
|
||||
// Some codecs may only support certain input color spaces, or output
|
||||
// color spaces, or multiple of 16 width/height... This method is needed
|
||||
@@ -75,18 +75,18 @@ public:
|
||||
size_t chunkSize,
|
||||
media_encode_info* encodeInfo);
|
||||
|
||||
void SetChunkWriter(ChunkWriter* writer);
|
||||
void SetChunkWriter(BChunkWriter* writer);
|
||||
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
protected:
|
||||
Encoder();
|
||||
virtual ~Encoder();
|
||||
BEncoder();
|
||||
virtual ~BEncoder();
|
||||
|
||||
private:
|
||||
ChunkWriter* fChunkWriter;
|
||||
BChunkWriter* fChunkWriter;
|
||||
|
||||
MediaPlugin* fMediaPlugin;
|
||||
BMediaPlugin* fMediaPlugin;
|
||||
|
||||
// needed for plug-in reference count management
|
||||
friend class PluginManager;
|
||||
@@ -117,14 +117,14 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class EncoderPlugin : public virtual MediaPlugin {
|
||||
class BEncoderPlugin : public virtual BMediaPlugin {
|
||||
public:
|
||||
EncoderPlugin();
|
||||
BEncoderPlugin();
|
||||
|
||||
virtual Encoder* NewEncoder(
|
||||
virtual BEncoder* NewEncoder(
|
||||
const media_codec_info& codecInfo) = 0;
|
||||
|
||||
virtual Encoder* NewEncoder(
|
||||
virtual BEncoder* NewEncoder(
|
||||
const media_format& format) = 0;
|
||||
|
||||
virtual status_t RegisterNextEncoder(int32* cookie,
|
||||
|
||||
@@ -23,10 +23,10 @@ struct chunk_buffer;
|
||||
struct stream_info;
|
||||
|
||||
|
||||
class MediaExtractor {
|
||||
class BMediaExtractor {
|
||||
public:
|
||||
MediaExtractor(BDataIO* source, int32 flags);
|
||||
~MediaExtractor();
|
||||
BMediaExtractor(BDataIO* source, int32 flags);
|
||||
~BMediaExtractor();
|
||||
|
||||
status_t InitCheck();
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
size_t* _chunkSize,
|
||||
media_header* mediaHeader);
|
||||
|
||||
status_t CreateDecoder(int32 stream, Decoder** _decoder,
|
||||
status_t CreateDecoder(int32 stream, BDecoder** _decoder,
|
||||
media_codec_info* codecInfo);
|
||||
|
||||
// TODO: Explore if would be better to add a Start/Stop
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
thread_id fExtractorThread;
|
||||
|
||||
BDataIO* fSource;
|
||||
Reader* fReader;
|
||||
BReader* fReader;
|
||||
|
||||
stream_info* fStreamInfo;
|
||||
int32 fStreamCount;
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace BPrivate { namespace media {
|
||||
// TODO: This will replace BMediaAddOn in media2,
|
||||
// see if we need some more accessor method and
|
||||
// add the needed padding.
|
||||
class MediaPlugin {
|
||||
class BMediaPlugin {
|
||||
public:
|
||||
MediaPlugin();
|
||||
virtual ~MediaPlugin();
|
||||
BMediaPlugin();
|
||||
virtual ~BMediaPlugin();
|
||||
|
||||
private:
|
||||
int32 fRefCount;
|
||||
@@ -31,13 +31,13 @@ private:
|
||||
uint32 fReserved[5];
|
||||
};
|
||||
|
||||
class Decoder;
|
||||
class Reader;
|
||||
class BDecoder;
|
||||
class BReader;
|
||||
|
||||
} } // namespace BPrivate::media
|
||||
|
||||
using namespace BPrivate::media;
|
||||
|
||||
extern "C" MediaPlugin* instantiate_plugin();
|
||||
extern "C" BMediaPlugin* instantiate_plugin();
|
||||
|
||||
#endif // _MEDIA_PLUGIN_H
|
||||
|
||||
@@ -15,16 +15,16 @@ namespace BPrivate {
|
||||
namespace media {
|
||||
|
||||
|
||||
class MediaStreamer {
|
||||
class BMediaStreamer {
|
||||
public:
|
||||
MediaStreamer(BUrl url);
|
||||
~MediaStreamer();
|
||||
BMediaStreamer(BUrl url);
|
||||
~BMediaStreamer();
|
||||
|
||||
status_t CreateAdapter(BDataIO** adapter);
|
||||
|
||||
private:
|
||||
BUrl fUrl;
|
||||
Streamer* fStreamer;
|
||||
BStreamer* fStreamer;
|
||||
|
||||
// No virtual padding needed. Looks like a design decision.
|
||||
// Let's respect that, for now.
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace BPrivate {
|
||||
namespace media {
|
||||
|
||||
|
||||
class MediaWriter {
|
||||
class BMediaWriter {
|
||||
public:
|
||||
MediaWriter(BDataIO* target,
|
||||
BMediaWriter(BDataIO* target,
|
||||
const media_file_format& fileFormat);
|
||||
~MediaWriter();
|
||||
~BMediaWriter();
|
||||
|
||||
status_t InitCheck();
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
|
||||
void GetFileFormatInfo(media_file_format* mfi) const;
|
||||
|
||||
status_t CreateEncoder(Encoder** _encoder,
|
||||
status_t CreateEncoder(BEncoder** _encoder,
|
||||
const media_codec_info* codecInfo,
|
||||
media_format* format, uint32 flags = 0);
|
||||
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
};
|
||||
|
||||
BDataIO* fTarget;
|
||||
Writer* fWriter;
|
||||
BWriter* fWriter;
|
||||
List<StreamInfo> fStreamInfos;
|
||||
media_file_format fFileFormat;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
class Reader {
|
||||
class BReader {
|
||||
public:
|
||||
virtual status_t Sniff(int32* streamCount) = 0;
|
||||
|
||||
@@ -51,15 +51,15 @@ public:
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
protected:
|
||||
Reader();
|
||||
virtual ~Reader();
|
||||
BReader();
|
||||
virtual ~BReader();
|
||||
|
||||
private:
|
||||
void _Setup(BDataIO* source);
|
||||
|
||||
BDataIO* fSource;
|
||||
|
||||
MediaPlugin* fMediaPlugin;
|
||||
BMediaPlugin* fMediaPlugin;
|
||||
|
||||
// needed for plug-in reference count management
|
||||
friend class PluginManager;
|
||||
@@ -75,9 +75,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class ReaderPlugin : public virtual MediaPlugin {
|
||||
class BReaderPlugin : public virtual BMediaPlugin {
|
||||
public:
|
||||
virtual Reader* NewReader() = 0;
|
||||
virtual BReader* NewReader() = 0;
|
||||
};
|
||||
|
||||
} } // namespace BPrivate::media
|
||||
|
||||
@@ -17,16 +17,16 @@ namespace BPrivate { namespace media {
|
||||
class PluginManager;
|
||||
|
||||
|
||||
class Streamer {
|
||||
class BStreamer {
|
||||
public:
|
||||
virtual status_t Sniff(const BUrl& url, BDataIO** source) = 0;
|
||||
|
||||
protected:
|
||||
Streamer();
|
||||
virtual ~Streamer();
|
||||
BStreamer();
|
||||
virtual ~BStreamer();
|
||||
|
||||
private:
|
||||
MediaPlugin* fMediaPlugin;
|
||||
BMediaPlugin* fMediaPlugin;
|
||||
|
||||
friend class PluginManager;
|
||||
friend class MediaStreamer;
|
||||
@@ -41,11 +41,11 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class StreamerPlugin : public virtual MediaPlugin {
|
||||
class BStreamerPlugin : public virtual BMediaPlugin {
|
||||
public:
|
||||
StreamerPlugin();
|
||||
BStreamerPlugin();
|
||||
|
||||
virtual Streamer* NewStreamer() = 0;
|
||||
virtual BStreamer* NewStreamer() = 0;
|
||||
};
|
||||
|
||||
} } // namespace BPrivate::media
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace BPrivate { namespace media {
|
||||
|
||||
class PluginManager;
|
||||
|
||||
class Writer {
|
||||
class BWriter {
|
||||
public:
|
||||
virtual status_t SetMetaData(BMetaData* data) = 0;
|
||||
virtual status_t CommitHeader() = 0;
|
||||
@@ -38,8 +38,8 @@ public:
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
protected:
|
||||
Writer();
|
||||
virtual ~Writer();
|
||||
BWriter();
|
||||
virtual ~BWriter();
|
||||
|
||||
virtual status_t Init(const media_file_format* fileFormat) = 0;
|
||||
|
||||
@@ -48,11 +48,11 @@ private:
|
||||
|
||||
BDataIO* fTarget;
|
||||
|
||||
MediaPlugin* fMediaPlugin;
|
||||
BMediaPlugin* fMediaPlugin;
|
||||
|
||||
// needed for plug-in reference count management
|
||||
friend class PluginManager;
|
||||
friend class MediaWriter;
|
||||
friend class BMediaWriter;
|
||||
|
||||
virtual void _ReservedWriter1();
|
||||
virtual void _ReservedWriter2();
|
||||
@@ -64,9 +64,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class WriterPlugin : public virtual MediaPlugin {
|
||||
class BWriterPlugin : public virtual BMediaPlugin {
|
||||
public:
|
||||
virtual Writer* NewWriter() = 0;
|
||||
virtual BWriter* NewWriter() = 0;
|
||||
virtual status_t GetSupportedFileFormats(
|
||||
const media_file_format** _fileFormats,
|
||||
size_t* _count) = 0;
|
||||
|
||||
@@ -67,17 +67,17 @@ private:
|
||||
status_t _RegisterAddOn(const entry_ref& ref);
|
||||
status_t _UnregisterAddOn(const entry_ref& ref);
|
||||
|
||||
void _RegisterReader(ReaderPlugin* reader,
|
||||
void _RegisterReader(BReaderPlugin* reader,
|
||||
const entry_ref& ref);
|
||||
void _RegisterDecoder(DecoderPlugin* decoder,
|
||||
void _RegisterDecoder(BDecoderPlugin* decoder,
|
||||
const entry_ref& ref);
|
||||
|
||||
void _RegisterWriter(WriterPlugin* writer,
|
||||
void _RegisterWriter(BWriterPlugin* writer,
|
||||
const entry_ref& ref);
|
||||
void _RegisterEncoder(EncoderPlugin* encoder,
|
||||
void _RegisterEncoder(BEncoderPlugin* encoder,
|
||||
const entry_ref& ref);
|
||||
|
||||
void _RegisterStreamer(StreamerPlugin* streamer,
|
||||
void _RegisterStreamer(BStreamerPlugin* streamer,
|
||||
const entry_ref& ref);
|
||||
|
||||
bool _FindDecoder(const media_format& format,
|
||||
|
||||
@@ -27,50 +27,50 @@ public:
|
||||
PluginManager();
|
||||
~PluginManager();
|
||||
|
||||
MediaPlugin* GetPlugin(const entry_ref& ref);
|
||||
void PutPlugin(MediaPlugin* plugin);
|
||||
BMediaPlugin* GetPlugin(const entry_ref& ref);
|
||||
void PutPlugin(BMediaPlugin* plugin);
|
||||
|
||||
// Readers and Decoders
|
||||
status_t CreateReader(Reader** reader,
|
||||
status_t CreateReader(BReader** reader,
|
||||
int32* streamCount, media_file_format* mff,
|
||||
BDataIO* source);
|
||||
void DestroyReader(Reader* reader);
|
||||
void DestroyReader(BReader* reader);
|
||||
|
||||
status_t CreateDecoder(Decoder** decoder,
|
||||
status_t CreateDecoder(BDecoder** decoder,
|
||||
const media_format& format);
|
||||
status_t CreateDecoder(Decoder** decoder,
|
||||
status_t CreateDecoder(BDecoder** decoder,
|
||||
const media_codec_info& mci);
|
||||
status_t GetDecoderInfo(Decoder* decoder,
|
||||
status_t GetDecoderInfo(BDecoder* decoder,
|
||||
media_codec_info* _info) const;
|
||||
void DestroyDecoder(Decoder* decoder);
|
||||
void DestroyDecoder(BDecoder* decoder);
|
||||
|
||||
// Writers and Encoders
|
||||
status_t CreateWriter(Writer** writer,
|
||||
status_t CreateWriter(BWriter** writer,
|
||||
const media_file_format& mff,
|
||||
BDataIO* target);
|
||||
void DestroyWriter(Writer* writer);
|
||||
void DestroyWriter(BWriter* writer);
|
||||
|
||||
status_t CreateEncoder(Encoder** encoder,
|
||||
status_t CreateEncoder(BEncoder** encoder,
|
||||
const media_codec_info* codecInfo,
|
||||
uint32 flags);
|
||||
|
||||
status_t CreateEncoder(Encoder** encoder,
|
||||
status_t CreateEncoder(BEncoder** encoder,
|
||||
const media_format& format);
|
||||
|
||||
void DestroyEncoder(Encoder* encoder);
|
||||
void DestroyEncoder(BEncoder* encoder);
|
||||
|
||||
status_t CreateStreamer(Streamer** streamer,
|
||||
status_t CreateStreamer(BStreamer** streamer,
|
||||
BUrl url, BDataIO** source);
|
||||
void DestroyStreamer(Streamer* streamer);
|
||||
void DestroyStreamer(BStreamer* streamer);
|
||||
|
||||
private:
|
||||
status_t _LoadPlugin(const entry_ref& ref,
|
||||
MediaPlugin** plugin, image_id* image);
|
||||
BMediaPlugin** plugin, image_id* image);
|
||||
|
||||
struct plugin_info {
|
||||
char name[260];
|
||||
int usecount;
|
||||
MediaPlugin* plugin;
|
||||
BMediaPlugin* plugin;
|
||||
image_id image;
|
||||
|
||||
plugin_info& operator=(const plugin_info& other)
|
||||
|
||||
Reference in New Issue
Block a user