haiku/headers/private/media/MediaWriter.h
Stephan Aßmus fa770e4c84 * Writer::WriteChunk() takes media_encode_info* instead of flags.
* Improved Encoder API towards what we need for the get_next_encoder() variants
  and the BMediaTrack API.
* Implemented the rest of MediaWriter. Still undecided what to make of
  AddTrackInfo(). BMediaEncoder has that as well, which hints that this is
  something the Encoder needs to support. But it could also be that this is
  only possible to support in Writer.
* Wired a lot of previously unimplemented methods in BMediaFile and BMediaTrack
  needed for write support. If I have not overlooked anything, only the
  parameter stuff is still unimplemented now.

This is all untested, since the FFMpeg Encoder and Writer are still only stubs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-31 10:46:58 +00:00

69 lines
1.4 KiB
C++

/*
* Copyright 2009, 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 "EncoderPlugin.h"
#include "TList.h"
#include "WriterPlugin.h"
namespace BPrivate {
namespace media {
class MediaWriter {
public:
MediaWriter(BDataIO* target,
const media_file_format& fileFormat);
~MediaWriter();
status_t InitCheck();
void GetFileFormatInfo(media_file_format* mfi) const;
status_t CreateEncoder(Encoder** _encoder,
const media_codec_info* codecInfo,
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;
List<StreamInfo> fStreamInfos;
media_file_format fFileFormat;
};
}; // namespace media
}; // namespace BPrivate
using namespace BPrivate::media;
#endif // _MEDIA_WRITER_H