mp4.h
来自「faac-1.25.rar音频编解码器demo」· C头文件 代码 · 共 1,147 行 · 第 1/3 页
H
1,147 行
MP4FileHandle hFile,
const char* propName,
u_int8_t** ppValue,
u_int32_t* pValueSize);
bool MP4SetIntegerProperty(
MP4FileHandle hFile,
const char* propName,
int64_t value);
bool MP4SetFloatProperty(
MP4FileHandle hFile,
const char* propName,
float value);
bool MP4SetStringProperty(
MP4FileHandle hFile, const char* propName, const char* value);
bool MP4SetBytesProperty(
MP4FileHandle hFile, const char* propName,
const u_int8_t* pValue, u_int32_t valueSize);
/* track operations */
MP4TrackId MP4AddTrack(
MP4FileHandle hFile,
const char* type);
MP4TrackId MP4AddSystemsTrack(
MP4FileHandle hFile,
const char* type);
MP4TrackId MP4AddODTrack(
MP4FileHandle hFile);
MP4TrackId MP4AddSceneTrack(
MP4FileHandle hFile);
MP4TrackId MP4AddAudioTrack(
MP4FileHandle hFile,
u_int32_t timeScale,
MP4Duration sampleDuration,
u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE));
typedef struct mp4v2_ismacryp_session_params {
u_int32_t scheme_type;
u_int16_t scheme_version;
u_int8_t key_ind_len;
u_int8_t iv_len;
u_int8_t selective_enc;
char *kms_uri;
} mp4v2_ismacrypParams;
MP4TrackId MP4AddEncAudioTrack(
MP4FileHandle hFile,
u_int32_t timeScale,
MP4Duration sampleDuration,
mp4v2_ismacrypParams *icPp,
u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE));
MP4TrackId MP4AddAmrAudioTrack(
MP4FileHandle hFile,
u_int32_t timeScale,
u_int16_t modeSet,
u_int8_t modeChangePeriod,
u_int8_t framesPerSample,
bool isAmrWB);
void MP4SetAmrVendor(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int32_t vendor);
void MP4SetAmrDecoderVersion(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int8_t decoderVersion);
void MP4SetAmrModeSet(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int16_t modeSet);
MP4TrackId MP4AddVideoTrack(
MP4FileHandle hFile,
u_int32_t timeScale,
MP4Duration sampleDuration,
u_int16_t width,
u_int16_t height,
u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE));
MP4TrackId MP4AddEncVideoTrack(
MP4FileHandle hFile,
u_int32_t timeScale,
MP4Duration sampleDuration,
u_int16_t width,
u_int16_t height,
mp4v2_ismacrypParams *icPp,
u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE));
void MP4SetH263Vendor(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int32_t vendor);
void MP4SetH263DecoderVersion(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int8_t decoderVersion);
void MP4SetH263Bitrates(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int32_t avgBitrate,
u_int32_t maxBitrate);
MP4TrackId MP4AddH263VideoTrack(
MP4FileHandle hFile,
u_int32_t timeScale,
MP4Duration sampleDuration,
u_int16_t width,
u_int16_t height,
u_int8_t h263Level,
u_int8_t h263Profile,
u_int32_t avgBitrate,
u_int32_t maxBitrate);
MP4TrackId MP4AddHintTrack(
MP4FileHandle hFile,
MP4TrackId refTrackId);
MP4TrackId MP4CloneTrack(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID));
MP4TrackId MP4EncAndCloneTrack(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
mp4v2_ismacrypParams *icPp,
MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID));
MP4TrackId MP4CopyTrack(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
bool applyEdits DEFAULT(false),
MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID));
typedef u_int32_t (*encryptFunc_t)(u_int32_t, u_int32_t, u_int8_t*, u_int32_t*, u_int8_t **);
MP4TrackId MP4EncAndCopyTrack(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
mp4v2_ismacrypParams *icPp,
encryptFunc_t encfcnp,
u_int32_t encfcnparam1,
MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
bool applyEdits DEFAULT(false),
MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID));
bool MP4DeleteTrack(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int32_t MP4GetNumberOfTracks(
MP4FileHandle hFile,
const char* type DEFAULT(NULL),
u_int8_t subType DEFAULT(0));
MP4TrackId MP4FindTrackId(
MP4FileHandle hFile,
u_int16_t index,
const char* type DEFAULT(NULL),
u_int8_t subType DEFAULT(0));
u_int16_t MP4FindTrackIndex(
MP4FileHandle hFile,
MP4TrackId trackId);
/* track properties */
/* specific track properties */
const char* MP4GetTrackType(
MP4FileHandle hFile,
MP4TrackId trackId);
MP4Duration MP4GetTrackDuration(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int32_t MP4GetTrackTimeScale(
MP4FileHandle hFile,
MP4TrackId trackId);
bool MP4SetTrackTimeScale(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int32_t value);
// Should not be used, replace with MP4GetTrackEsdsObjectTypeId
u_int8_t MP4GetTrackAudioType(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int8_t MP4GetTrackAudioMpeg4Type(
MP4FileHandle hFile,
MP4TrackId trackId);
// Should not be used, replace with MP4GetTrackEsdsObjectTypeId
u_int8_t MP4GetTrackVideoType(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int8_t MP4GetTrackEsdsObjectTypeId(
MP4FileHandle hFile,
MP4TrackId trackId);
/* returns MP4_INVALID_DURATION if track samples do not have a fixed duration */
MP4Duration MP4GetTrackFixedSampleDuration(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int32_t MP4GetTrackBitRate(
MP4FileHandle hFile,
MP4TrackId trackId);
bool MP4GetTrackESConfiguration(
MP4FileHandle hFile,
MP4TrackId trackId,
u_int8_t** ppConfig,
u_int32_t* pConfigSize);
bool MP4SetTrackESConfiguration(
MP4FileHandle hFile,
MP4TrackId trackId,
const u_int8_t* pConfig,
u_int32_t configSize);
MP4SampleId MP4GetTrackNumberOfSamples(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int16_t MP4GetTrackVideoWidth(
MP4FileHandle hFile,
MP4TrackId trackId);
u_int16_t MP4GetTrackVideoHeight(
MP4FileHandle hFile,
MP4TrackId trackId);
float MP4GetTrackVideoFrameRate(
MP4FileHandle hFile,
MP4TrackId trackId);
bool MP4IsIsmaCrypMediaTrack(
MP4FileHandle hFile,
MP4TrackId trackId);
/* generic track properties */
u_int64_t MP4GetTrackIntegerProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName);
float MP4GetTrackFloatProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName);
const char* MP4GetTrackStringProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName);
void MP4GetTrackBytesProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName,
u_int8_t** ppValue,
u_int32_t* pValueSize);
bool MP4SetTrackIntegerProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName,
int64_t value);
bool MP4SetTrackFloatProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName,
float value);
bool MP4SetTrackStringProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName,
const char* value);
bool MP4SetTrackBytesProperty(
MP4FileHandle hFile,
MP4TrackId trackId,
const char* propName,
const u_int8_t* pValue,
u_int32_t valueSize);
/* sample operations */
bool MP4ReadSample(
/* input parameters */
MP4FileHandle hFile,
MP4TrackId trackId,
MP4SampleId sampleId,
/* input/output parameters */
u_int8_t** ppBytes,
u_int32_t* pNumBytes,
/* output parameters */
MP4Timestamp* pStartTime DEFAULT(NULL),
MP4Duration* pDuration DEFAULT(NULL),
MP4Duration* pRenderingOffset DEFAULT(NULL),
bool* pIsSyncSample DEFAULT(NULL));
/* uses (unedited) time to specify sample instead of sample id */
bool MP4ReadSampleFromTime(
/* input parameters */
MP4FileHandle hFile,
MP4TrackId trackId,
MP4Timestamp when,
/* input/output parameters */
u_int8_t** ppBytes,
u_int32_t* pNumBytes,
/* output parameters */
MP4Timestamp* pStartTime DEFAULT(NULL),
MP4Duration* pDuration DEFAULT(NULL),
MP4Duration* pRenderingOffset DEFAULT(NULL),
bool* pIsSyncSample DEFAULT(NULL));
bool MP4WriteSample(
MP4FileHandle hFile,
MP4TrackId trackId,
const u_int8_t* pBytes,
u_int32_t numBytes,
MP4Duration duration DEFAULT(MP4_INVALID_DURATION),
MP4Duration renderingOffset DEFAULT(0),
bool isSyncSample DEFAULT(true));
bool MP4CopySample(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
MP4SampleId srcSampleId,
MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
MP4TrackId dstTrackId DEFAULT(MP4_INVALID_TRACK_ID),
MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION));
bool MP4EncAndCopySample(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
MP4SampleId srcSampleId,
encryptFunc_t encfcnp,
u_int32_t encfcnparam1,
MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
MP4TrackId dstTrackId DEFAULT(MP4_INVALID_TRACK_ID),
MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION));
/* Note this function is not yet implemented */
bool MP4ReferenceSample(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
MP4SampleId srcSampleId,
MP4FileHandle dstFile,
MP4TrackId dstTrackId,
MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION));
u_int32_t MP4GetSampleSize(
MP4FileHandle hFile,
MP4TrackId trackId,
MP4SampleId sampleId);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?