* Rewrote MediaDefs.h and MediaEncoder.h
* Moved MediaKit errors into Errors.h git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32779 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+644
-393
File diff suppressed because it is too large
Load Diff
@@ -1,91 +1,117 @@
|
|||||||
#ifndef MEDIAENCODER_H
|
/*
|
||||||
#define MEDIAENCODER_H
|
* Copyright 2009, Haiku, Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _MEDIA_ENCODER_H
|
||||||
|
#define _MEDIA_ENCODER_H
|
||||||
|
|
||||||
|
|
||||||
#include <MediaDefs.h>
|
|
||||||
#include <MediaFormats.h>
|
#include <MediaFormats.h>
|
||||||
|
|
||||||
namespace BPrivate {
|
|
||||||
class Encoder;
|
//namespace BPrivate {
|
||||||
class _AddonManager;
|
// class Encoder;
|
||||||
}
|
// class _AddonManager;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
class BMediaEncoder {
|
class BMediaEncoder {
|
||||||
public:
|
public:
|
||||||
BMediaEncoder();
|
BMediaEncoder();
|
||||||
BMediaEncoder(const media_format *output_format);
|
BMediaEncoder(
|
||||||
BMediaEncoder(const media_codec_info *mci);
|
const media_format* outputFormat);
|
||||||
virtual ~BMediaEncoder();
|
BMediaEncoder(const media_codec_info* info);
|
||||||
status_t InitCheck() const;
|
virtual ~BMediaEncoder();
|
||||||
|
|
||||||
status_t SetTo(const media_format *output_format);
|
status_t InitCheck() const;
|
||||||
status_t SetTo(const media_codec_info *mci);
|
|
||||||
status_t SetFormat(media_format *input_format,
|
|
||||||
media_format *output_format,
|
|
||||||
media_file_format *mfi = NULL);
|
|
||||||
status_t Encode(const void *buffer, int64 frame_count,
|
|
||||||
media_encode_info *info);
|
|
||||||
status_t GetEncodeParameters(encode_parameters *parameters) const;
|
|
||||||
status_t SetEncodeParameters(encode_parameters *parameters);
|
|
||||||
protected:
|
|
||||||
virtual status_t WriteChunk(const void *chunk_data, size_t chunk_len,
|
|
||||||
media_encode_info *info) = 0;
|
|
||||||
virtual status_t AddTrackInfo(uint32 code, const char *data, size_t size);
|
|
||||||
|
|
||||||
private:
|
status_t SetTo(const media_format* outputFormat);
|
||||||
// unimplemented
|
status_t SetTo(const media_codec_info* info);
|
||||||
BMediaEncoder(const BMediaEncoder &);
|
status_t SetFormat(media_format* inputFormat,
|
||||||
BMediaEncoder & operator=(const BMediaEncoder &);
|
media_format* outputFormat,
|
||||||
|
media_file_format* fileFormat = NULL);
|
||||||
|
|
||||||
static status_t write_chunk(void *classptr, const void *chunk_data,
|
status_t Encode(const void* buffer, int64 frameCount,
|
||||||
size_t chunk_len, media_encode_info *info);
|
media_encode_info* info);
|
||||||
void Init();
|
|
||||||
void ReleaseEncoder();
|
|
||||||
|
|
||||||
BPrivate::_AddonManager *fEncoderMgr;
|
status_t GetEncodeParameters(
|
||||||
BPrivate::Encoder *fEncoder;
|
encode_parameters* parameters) const;
|
||||||
int32 fEncoderID;
|
status_t SetEncodeParameters(
|
||||||
bool fFormatValid;
|
encode_parameters* parameters);
|
||||||
bool fEncoderStarted;
|
|
||||||
status_t fInitStatus;
|
|
||||||
|
|
||||||
/* fbc data and virtuals */
|
protected:
|
||||||
|
virtual status_t WriteChunk(const void* buffer, size_t size,
|
||||||
|
media_encode_info* info) = 0;
|
||||||
|
|
||||||
uint32 _reserved_BMediaEncoder_[32];
|
virtual status_t AddTrackInfo(uint32 code, const char* data,
|
||||||
|
size_t size);
|
||||||
|
|
||||||
virtual status_t _Reserved_BMediaEncoder_0(int32 arg, ...);
|
// TODO: Needs Perform() method for FBC!
|
||||||
virtual status_t _Reserved_BMediaEncoder_1(int32 arg, ...);
|
|
||||||
virtual status_t _Reserved_BMediaEncoder_2(int32 arg, ...);
|
private:
|
||||||
virtual status_t _Reserved_BMediaEncoder_3(int32 arg, ...);
|
// FBC padding and forbidden methods
|
||||||
virtual status_t _Reserved_BMediaEncoder_4(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_0(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_5(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_1(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_6(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_2(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_7(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_3(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_8(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_4(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_9(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_5(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_10(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_6(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_11(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_7(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_12(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_8(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_13(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_9(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_14(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_10(int32 arg, ...);
|
||||||
virtual status_t _Reserved_BMediaEncoder_15(int32 arg, ...);
|
virtual status_t _Reserved_BMediaEncoder_11(int32 arg, ...);
|
||||||
|
virtual status_t _Reserved_BMediaEncoder_12(int32 arg, ...);
|
||||||
|
virtual status_t _Reserved_BMediaEncoder_13(int32 arg, ...);
|
||||||
|
virtual status_t _Reserved_BMediaEncoder_14(int32 arg, ...);
|
||||||
|
virtual status_t _Reserved_BMediaEncoder_15(int32 arg, ...);
|
||||||
|
|
||||||
|
BMediaEncoder(const BMediaEncoder& other);
|
||||||
|
BMediaEncoder& operator=(const BMediaEncoder& other);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static status_t write_chunk(void* classPtr,
|
||||||
|
const void* buffer, size_t size,
|
||||||
|
media_encode_info* info);
|
||||||
|
|
||||||
|
void Init();
|
||||||
|
void ReleaseEncoder();
|
||||||
|
|
||||||
|
// BPrivate::_AddonManager* fEncoderMgr;
|
||||||
|
// BPrivate::Encoder* fEncoder;
|
||||||
|
uint32 _reserved_was_fEncoderMgr;
|
||||||
|
uint32 _reserved_was_fEncoder;
|
||||||
|
|
||||||
|
int32 fEncoderID;
|
||||||
|
bool fFormatValid;
|
||||||
|
bool fEncoderStarted;
|
||||||
|
status_t fInitStatus;
|
||||||
|
|
||||||
|
uint32 _reserved_BMediaEncoder_[32];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class BMediaBufferEncoder: public BMediaEncoder {
|
class BMediaBufferEncoder: public BMediaEncoder {
|
||||||
public:
|
public:
|
||||||
BMediaBufferEncoder();
|
BMediaBufferEncoder();
|
||||||
BMediaBufferEncoder(const media_format *output_format);
|
BMediaBufferEncoder(
|
||||||
BMediaBufferEncoder(const media_codec_info *mci);
|
const media_format* outputFormat);
|
||||||
status_t EncodeToBuffer(void *output_buffer, size_t *output_size,
|
BMediaBufferEncoder(
|
||||||
const void *input_buffer, int64 frame_count,
|
const media_codec_info* info);
|
||||||
media_encode_info *info);
|
|
||||||
protected:
|
|
||||||
virtual status_t WriteChunk(const void *chunk_data, size_t chunk_len,
|
|
||||||
media_encode_info *info);
|
|
||||||
|
|
||||||
void *fBuffer;
|
status_t EncodeToBuffer(void* outputBuffer,
|
||||||
int32 fBufferSize;
|
size_t* _size, const void* inputBuffer,
|
||||||
|
int64 frameCount, media_encode_info* info);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual status_t WriteChunk(const void* buffer, size_t size,
|
||||||
|
media_encode_info* info);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void* fBuffer;
|
||||||
|
int32 fBufferSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // _MEDIA_ENCODER_H
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,38 @@
|
|||||||
#define B_BUFFER_NOT_AVAILABLE (B_MEDIA_ERROR_BASE + 6)
|
#define B_BUFFER_NOT_AVAILABLE (B_MEDIA_ERROR_BASE + 6)
|
||||||
#define B_LAST_BUFFER_ERROR (B_MEDIA_ERROR_BASE + 7)
|
#define B_LAST_BUFFER_ERROR (B_MEDIA_ERROR_BASE + 7)
|
||||||
|
|
||||||
|
#define B_MEDIA_SYSTEM_FAILURE (B_MEDIA_ERROR_BASE + 100)
|
||||||
|
#define B_MEDIA_BAD_NODE (B_MEDIA_ERROR_BASE + 101)
|
||||||
|
#define B_MEDIA_NODE_BUSY (B_MEDIA_ERROR_BASE + 102)
|
||||||
|
#define B_MEDIA_BAD_FORMAT (B_MEDIA_ERROR_BASE + 103)
|
||||||
|
#define B_MEDIA_BAD_BUFFER (B_MEDIA_ERROR_BASE + 104)
|
||||||
|
#define B_MEDIA_TOO_MANY_NODES (B_MEDIA_ERROR_BASE + 105)
|
||||||
|
#define B_MEDIA_TOO_MANY_BUFFERS (B_MEDIA_ERROR_BASE + 106)
|
||||||
|
#define B_MEDIA_NODE_ALREADY_EXISTS (B_MEDIA_ERROR_BASE + 107)
|
||||||
|
#define B_MEDIA_BUFFER_ALREADY_EXISTS (B_MEDIA_ERROR_BASE + 108)
|
||||||
|
#define B_MEDIA_CANNOT_SEEK (B_MEDIA_ERROR_BASE + 109)
|
||||||
|
#define B_MEDIA_CANNOT_CHANGE_RUN_MODE (B_MEDIA_ERROR_BASE + 110)
|
||||||
|
#define B_MEDIA_APP_ALREADY_REGISTERED (B_MEDIA_ERROR_BASE + 111)
|
||||||
|
#define B_MEDIA_APP_NOT_REGISTERED (B_MEDIA_ERROR_BASE + 112)
|
||||||
|
#define B_MEDIA_CANNOT_RECLAIM_BUFFERS (B_MEDIA_ERROR_BASE + 113)
|
||||||
|
#define B_MEDIA_BUFFERS_NOT_RECLAIMED (B_MEDIA_ERROR_BASE + 114)
|
||||||
|
#define B_MEDIA_TIME_SOURCE_STOPPED (B_MEDIA_ERROR_BASE + 115)
|
||||||
|
#define B_MEDIA_TIME_SOURCE_BUSY (B_MEDIA_ERROR_BASE + 116)
|
||||||
|
#define B_MEDIA_BAD_SOURCE (B_MEDIA_ERROR_BASE + 117)
|
||||||
|
#define B_MEDIA_BAD_DESTINATION (B_MEDIA_ERROR_BASE + 118)
|
||||||
|
#define B_MEDIA_ALREADY_CONNECTED (B_MEDIA_ERROR_BASE + 119)
|
||||||
|
#define B_MEDIA_NOT_CONNECTED (B_MEDIA_ERROR_BASE + 120)
|
||||||
|
#define B_MEDIA_BAD_CLIP_FORMAT (B_MEDIA_ERROR_BASE + 121)
|
||||||
|
#define B_MEDIA_ADDON_FAILED (B_MEDIA_ERROR_BASE + 122)
|
||||||
|
#define B_MEDIA_ADDON_DISABLED (B_MEDIA_ERROR_BASE + 123)
|
||||||
|
#define B_MEDIA_CHANGE_IN_PROGRESS (B_MEDIA_ERROR_BASE + 124)
|
||||||
|
#define B_MEDIA_STALE_CHANGE_COUNT (B_MEDIA_ERROR_BASE + 125)
|
||||||
|
#define B_MEDIA_ADDON_RESTRICTED (B_MEDIA_ERROR_BASE + 126)
|
||||||
|
#define B_MEDIA_NO_HANDLER (B_MEDIA_ERROR_BASE + 127)
|
||||||
|
#define B_MEDIA_DUPLICATE_FORMAT (B_MEDIA_ERROR_BASE + 128)
|
||||||
|
#define B_MEDIA_REALTIME_DISABLED (B_MEDIA_ERROR_BASE + 129)
|
||||||
|
#define B_MEDIA_REALTIME_UNAVAILABLE (B_MEDIA_ERROR_BASE + 130)
|
||||||
|
|
||||||
/* Mail Kit Errors */
|
/* Mail Kit Errors */
|
||||||
#define B_MAIL_NO_DAEMON (B_MAIL_ERROR_BASE + 0)
|
#define B_MAIL_NO_DAEMON (B_MAIL_ERROR_BASE + 0)
|
||||||
#define B_MAIL_UNKNOWN_USER (B_MAIL_ERROR_BASE + 1)
|
#define B_MAIL_UNKNOWN_USER (B_MAIL_ERROR_BASE + 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user