diff --git a/headers/private/media/MediaWriter.h b/headers/private/media/MediaWriter.h index e053401d8f..df88014798 100644 --- a/headers/private/media/MediaWriter.h +++ b/headers/private/media/MediaWriter.h @@ -6,7 +6,10 @@ #define _MEDIA_WRITER_H +#include + #include "EncoderPlugin.h" +#include "StreamerPlugin.h" #include "TList.h" #include "WriterPlugin.h" @@ -19,10 +22,14 @@ class MediaWriter { public: MediaWriter(BDataIO* target, const media_file_format& fileFormat); + MediaWriter(BUrl* url, + const media_file_format& fileFormat); ~MediaWriter(); status_t InitCheck(); + BDataIO* Target() const; + void GetFileFormatInfo(media_file_format* mfi) const; status_t CreateEncoder(Encoder** _encoder, @@ -52,6 +59,7 @@ private: private: BDataIO* fTarget; Writer* fWriter; + Streamer* fStreamer; List fStreamInfos; diff --git a/src/kits/media/MediaWriter.cpp b/src/kits/media/MediaWriter.cpp index d7c9e50e3c..b9e063edca 100644 --- a/src/kits/media/MediaWriter.cpp +++ b/src/kits/media/MediaWriter.cpp @@ -48,6 +48,7 @@ MediaWriter::MediaWriter(BDataIO* target, const media_file_format& fileFormat) : fTarget(target), fWriter(NULL), + fStreamer(NULL), fStreamInfos(), fFileFormat(fileFormat) { @@ -57,6 +58,23 @@ MediaWriter::MediaWriter(BDataIO* target, const media_file_format& fileFormat) } +MediaWriter::MediaWriter(BUrl* url, const media_file_format& fileFormat) + : + fTarget(NULL), + fWriter(NULL), + fStreamer(NULL), + fStreamInfos(), + fFileFormat(fileFormat) +{ + CALLED(); + + if (gPluginManager.CreateStreamer(&fStreamer, url, &fTarget) != B_OK) + return; + + gPluginManager.CreateWriter(&fWriter, fFileFormat, fTarget); +} + + MediaWriter::~MediaWriter() { CALLED(); @@ -84,6 +102,13 @@ MediaWriter::InitCheck() } +BDataIO* +MediaWriter::Target() const +{ + return fTarget; +} + + void MediaWriter::GetFileFormatInfo(media_file_format* _fileFormat) const {