# format\_interface.h ## **Overview** **Related Modules:** [Format](Format.md) **Description:** Declares format-related APIs. For example, you use the functions provided in this file to define custom data types and to initialize, create, destroy the muxer and demuxer, and set their parameters. Also, you can read demuxer data frames, select demuxer tracks, add muxer tracks, and write data frames into a container. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Functions
FormatInit (void) |
|
FormatDeInit (void) |
|
FormatDemuxerCreate (const FormatSource *source, void **handle) |
|
FormatDemuxerSetParameter (const void *handle, int32_t trackId, const ParameterItem *metaData, int32_t metaDataCnt) |
|
FormatDemuxerGetParameter (const void *handle, int32_t trackId, ParameterItem *metaData) |
|
FormatDemuxerSetCallBack (void *handle, const FormatCallback *callBack) |
|
FormatDemuxerSetBufferConfig (void *handle, const FormatBufferSetting *setting) |
|
FormatDemuxerGetBufferConfig (const void *handle, FormatBufferSetting *setting) |
|
FormatDemuxerPrepare (void *handle) |
|
FormatDemuxerGetFileInfo (void *handle, FileInfo *info) |
|
FormatDemuxerSelectTrack (const void *handle, int32_t programId, int32_t trackId) |
|
FormatDemuxerUnselectTrack (const void *handle, int32_t programId, int32_t trackId) |
Unselects a specified media track from which the demuxer reads data frames. |
FormatDemuxerStart (void *handle) |
|
FormatDemuxerGetSelectedTrack (const void *handle, int32_t *programId, int32_t trackId[], int32_t *nums) |
Obtains the ID of the media track selected by the demuxer for output. |
FormatDemuxerReadFrame (const void *handle, FormatFrame *frame, int32_t timeOutMs) |
|
FormatDemuxerFreeFrame (void *handle, FormatFrame *frame) |
|
FormatDemuxerSeek (const void *handle, int32_t streamIndex, int64_t timeStampUs, FormatSeekMode mode) |
|
FormatDemuxerStop (void *handle) |
|
FormatDemuxerDestory (void *handle) |
|
FormatMuxerCreate (void **handle, FormatOutputConfig *outputConfig) |
|
FormatMuxerDestory (const void *handle) |
Destroys a muxer and release its resources created by calling FormatMuxerCreate. |
FormatMuxerAddTrack (void *handle, const TrackSource *trackSource) |
Adds a media track source for the muxer. For details about track sources, see TrackSource. |
FormatMuxerSetCallBack (void *handle, const FormatCallback *callBack) |
Sets a callback for the muxer. For details about the callback, see FormatCallback. |
FormatMuxerSetOrientation (void *handle, int degrees) |
|
FormatMuxerSetLocation (const void *handle, int latitude, int longitude) |
Sets the geographical information for the output file of the muxer. |
FormatMuxerSetMaxFileSize (void *handle, int64_t bytes) |
Sets the maximum size (in bytes) for the output file of the muxer. |
FormatMuxerSetMaxFileDuration (void *handle, int64_t durationUs) |
|
FormatMuxerSetFileSplitDuration (const void *handle, ManualSplitType type, int64_t timestampUs, uint32_t durationUs) |
|
FormatMuxerStart (void *handle) |
|
FormatMuxerWriteFrame (const void *handle, const FormatFrame *frameData) |
|
FormatMuxerSetNextOutputFile (const void *handle, int32_t fd) |
|
FormatMuxerStop (const void *handle, bool block) |
Stops the muxer that was started by calling FormatMuxerStart. |
FormatMuxerSetParameter (void *handle, int32_t trackId, const ParameterItem *item, int32_t itemNum) |
|
FormatMuxerGetParameter (void *handle, int32_t trackId, ParameterItem *item, int32_t itemNum) |