format_interface.h

Overview

Related Modules:

Format

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

Function Name

Description

FormatInit (void)

void 

Initializes the format.

FormatDeInit (void)

void 

Deinitializes the format.

FormatDemuxerCreate (const FormatSource source, void **handle)

int32_t 

Creates a demuxer component and returns its context handle.

FormatDemuxerSetParameter (const void handle, int32_t trackId, const ParameterItem metaData, int32_t metaDataCnt)

int32_t 

Sets demuxer attributes.

FormatDemuxerGetParameter (const void handle, int32_t trackId, ParameterItem metaData)

int32_t 

Obtains demuxer attributes.

FormatDemuxerSetCallBack (void handle, const FormatCallback callBack)

int32_t 

Sets a callback for the demuxer.

FormatDemuxerSetBufferConfig (void handle, const FormatBufferSetting setting)

int32_t 

Sets buffer information for the demuxer.

FormatDemuxerGetBufferConfig (const void handle, FormatBufferSetting setting)

int32_t 

Obtains the buffer information of the demuxer.

FormatDemuxerPrepare (void handle)

int32_t 

Makes preparations for the demuxer.

FormatDemuxerGetFileInfo (void handle, FileInfo info)

int32_t 

Obtains the attributes of a media file.

FormatDemuxerSelectTrack (const void handle, int32_t programId, int32_t trackId)

int32_t 

Selects a specified media track.

FormatDemuxerUnselectTrack (const void handle, int32_t programId, int32_t trackId)

int32_t 

Unselects a specified media track from which the demuxer reads data frames.

FormatDemuxerStart (void handle)

int32_t 

Starts the demuxer.

FormatDemuxerGetSelectedTrack (const void handle, int32_t programId, int32_t trackId[], int32_t nums)

int32_t 

Obtains the ID of the media track selected by the demuxer for output.

FormatDemuxerReadFrame (const void handle, FormatFrame frame, int32_t timeOutMs)

int32_t 

Reads data frames.

FormatDemuxerFreeFrame (void handle, FormatFrame frame)

int32_t 

Frees data frames.

FormatDemuxerSeek (const void handle, int32_t streamIndex, int64_t timeStampUs, FormatSeekMode mode)

int32_t 

Seeks for a specified position for the demuxer.

FormatDemuxerStop (void handle)

int32_t 

Stops the demuxer from working.

FormatDemuxerDestory (void handle)

int32_t 

Destroys demuxer resources.

FormatMuxerCreate (void **handle, FormatOutputConfig outputConfig)

int32_t 

Creates a muxer and returns its context handle.

FormatMuxerDestory (const void handle)

int32_t 

Destroys a muxer and release its resources created by calling FormatMuxerCreate.

FormatMuxerAddTrack (void handle, const TrackSource trackSource)

int32_t 

Adds a media track source for the muxer. For details about track sources, see TrackSource.

FormatMuxerSetCallBack (void handle, const FormatCallback callBack)

int32_t 

Sets a callback for the muxer. For details about the callback, see FormatCallback.

FormatMuxerSetOrientation (void handle, int degrees)

int32_t 

Sets the orientation of the video track for the muxer.

FormatMuxerSetLocation (const void handle, int latitude, int longitude)

int32_t 

Sets the geographical information for the output file of the muxer.

FormatMuxerSetMaxFileSize (void handle, int64_t bytes)

int32_t 

Sets the maximum size (in bytes) for the output file of the muxer.

FormatMuxerSetMaxFileDuration (void handle, int64_t durationUs)

int32_t 

Sets the maximum duration (in seconds) for the output file.

FormatMuxerSetFileSplitDuration (const void handle, ManualSplitType type, int64_t timestampUs, uint32_t durationUs)

int32_t 

Manually splits a file.

FormatMuxerStart (void handle)

int32_t 

Starts the muxer.

FormatMuxerWriteFrame (const void handle, const FormatFrame frameData)

int32_t 

Writes data frames into the muxer.

FormatMuxerSetNextOutputFile (const void handle, int32_t fd)

int32_t 

Sets the descriptor for the next output file.

FormatMuxerStop (const void handle, bool block)

int32_t 

Stops the muxer that was started by calling FormatMuxerStart.

FormatMuxerSetParameter (void handle, int32_t trackId, const ParameterItem item, int32_t itemNum)

int32_t 

Sets muxer attributes.

FormatMuxerGetParameter (void handle, int32_t trackId, ParameterItem *item, int32_t itemNum)

int32_t 

Obtains muxer attributes.