MediaWriter: Add new BUrl functionality
This commit is contained in:
parent
a2b3f12698
commit
20ae088fa5
@ -6,7 +6,10 @@
|
||||
#define _MEDIA_WRITER_H
|
||||
|
||||
|
||||
#include <Url.h>
|
||||
|
||||
#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<StreamInfo> fStreamInfos;
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user