haiku/headers/private/media/MediaWriter.h
Dario Casalinuovo 0ba82236bd Streaming: Remove any pointer BUrl argument
* There's no need to pass BUrl by pointer, this is
potentially dangerous and leaky without any advantage,
copying is definitely safer.
2016-06-24 19:00:38 +02:00

77 lines
1.6 KiB
C++

/*
* Copyright 2009-2010, Stephan Aßmus <superstippi@gmx.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef _MEDIA_WRITER_H
#define _MEDIA_WRITER_H
#include <Url.h>
#include "EncoderPlugin.h"
#include "StreamerPlugin.h"
#include "TList.h"
#include "WriterPlugin.h"
namespace BPrivate {
namespace media {
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,
const media_codec_info* codecInfo,
media_format* format, uint32 flags = 0);
status_t SetCopyright(int32 streamIndex,
const char* copyright);
status_t SetCopyright(const char* copyright);
status_t CommitHeader();
status_t Flush();
status_t Close();
status_t AddTrackInfo(int32 streamIndex, uint32 code,
const void* data, size_t size,
uint32 flags = 0);
status_t WriteChunk(int32 streamIndex,
const void* chunkBuffer, size_t chunkSize,
media_encode_info* encodeInfo);
private:
struct StreamInfo {
void* cookie;
};
private:
BDataIO* fTarget;
Writer* fWriter;
Streamer* fStreamer;
List<StreamInfo> fStreamInfos;
media_file_format fFileFormat;
};
}; // namespace media
}; // namespace BPrivate
using namespace BPrivate::media;
#endif // _MEDIA_WRITER_H