2009-07-29 20:25:30 +04:00
|
|
|
#ifndef _WRITER_PLUGIN_H
|
|
|
|
#define _WRITER_PLUGIN_H
|
|
|
|
|
|
|
|
#include <MediaTrack.h>
|
|
|
|
#include "MediaPlugin.h"
|
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
namespace BPrivate { namespace media {
|
2009-07-29 20:25:30 +04:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
class PluginManager;
|
2018-11-26 15:18:35 +03:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
class Writer {
|
|
|
|
public:
|
|
|
|
Writer();
|
|
|
|
virtual ~Writer();
|
2018-11-26 15:18:35 +03:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
virtual status_t Init(const media_file_format* fileFormat) = 0;
|
2009-07-29 20:25:30 +04:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
virtual status_t SetCopyright(const char* copyright) = 0;
|
2009-07-29 20:25:30 +04:00
|
|
|
virtual status_t CommitHeader() = 0;
|
|
|
|
virtual status_t Flush() = 0;
|
|
|
|
virtual status_t Close() = 0;
|
|
|
|
|
2009-07-31 19:29:08 +04:00
|
|
|
virtual status_t AllocateCookie(void** cookie,
|
2010-10-21 01:36:23 +04:00
|
|
|
media_format* format,
|
2009-08-01 05:16:12 +04:00
|
|
|
const media_codec_info* codecInfo) = 0;
|
2009-07-29 20:25:30 +04:00
|
|
|
virtual status_t FreeCookie(void* cookie) = 0;
|
2009-07-31 14:46:58 +04:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
virtual status_t SetCopyright(void* cookie,
|
|
|
|
const char* copyright) = 0;
|
2009-07-31 14:46:58 +04:00
|
|
|
|
2009-07-29 20:25:30 +04:00
|
|
|
virtual status_t AddTrackInfo(void* cookie, uint32 code,
|
|
|
|
const void* data, size_t size,
|
|
|
|
uint32 flags = 0) = 0;
|
|
|
|
|
2009-07-30 21:54:03 +04:00
|
|
|
virtual status_t WriteChunk(void* cookie,
|
2009-07-29 20:25:30 +04:00
|
|
|
const void* chunkBuffer, size_t chunkSize,
|
2009-07-31 14:46:58 +04:00
|
|
|
media_encode_info* encodeInfo) = 0;
|
2009-07-29 20:25:30 +04:00
|
|
|
|
|
|
|
BDataIO* Target() const;
|
|
|
|
|
2018-11-18 14:05:48 +03:00
|
|
|
virtual status_t Perform(perform_code code, void* data);
|
|
|
|
|
2009-07-29 20:25:30 +04:00
|
|
|
private:
|
2018-10-28 17:45:44 +03:00
|
|
|
virtual void _ReservedWriter1();
|
|
|
|
virtual void _ReservedWriter2();
|
|
|
|
virtual void _ReservedWriter3();
|
|
|
|
virtual void _ReservedWriter4();
|
|
|
|
virtual void _ReservedWriter5();
|
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
public: // XXX for test programs only
|
|
|
|
void Setup(BDataIO* target);
|
|
|
|
|
|
|
|
BDataIO* fTarget;
|
|
|
|
|
|
|
|
// needed for plug-in reference count management
|
|
|
|
friend class PluginManager;
|
|
|
|
MediaPlugin* fMediaPlugin;
|
|
|
|
|
2009-07-29 20:25:30 +04:00
|
|
|
uint32 fReserved[5];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
class WriterPlugin : public virtual MediaPlugin {
|
2009-07-29 20:25:30 +04:00
|
|
|
public:
|
2019-05-17 21:43:32 +03:00
|
|
|
virtual Writer* NewWriter() = 0;
|
2009-07-29 23:11:32 +04:00
|
|
|
virtual status_t GetSupportedFileFormats(
|
2009-07-30 04:11:02 +04:00
|
|
|
const media_file_format** _fileFormats,
|
2009-07-29 23:11:32 +04:00
|
|
|
size_t* _count) = 0;
|
2009-07-29 20:25:30 +04:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
};
|
2009-07-29 20:25:30 +04:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
} } // namespace BPrivate::media
|
2018-11-26 15:18:35 +03:00
|
|
|
|
2019-05-17 21:43:32 +03:00
|
|
|
using namespace BPrivate::media;
|
2009-07-29 20:25:30 +04:00
|
|
|
|
|
|
|
#endif // _WRITER_PLUGIN_H
|