# codec\_interface.h - [Overview](#section516593123165626) - [Summary](#section1395341176165626) - [Functions](#func-members) ## **Overview** **Related Modules:** [Codec](Codec.md) **Description:** Declares codec-related APIs, including functions for initializing audio and video codecs, setting parameters, and controlling and transferring data. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Functions

Function

Description

CodecInit ()

int32_t

Initializes the internal audio and video submodules of the codec.

CodecDeinit ()

int32_t

Deinitializes the internal audio and video submodules of the codec.

CodecEnumerateCapbility (uint32_t index, CodecCapbility *cap)

int32_t

Obtains the capabilities of a specified media type based on an index.

CodecGetCapbility (AvCodecMime mime, CodecType type, uint32_t flags, CodecCapbility *cap)

int32_t

Obtains the capabilities of a specified media type.

CodecCreate (const char *name, const Param *attr, int len, CODEC_HANDLETYPE *handle)

int32_t

Creates a specific codec component and returns the component context through a handle.

CodecDestroy (CODEC_HANDLETYPE handle)

int32_t

Destroys a codec component.

CodecSetPortMode (CODEC_HANDLETYPE handle, DirectionType type, BufferMode mode)

int32_t

Sets the input or output buffer mode.

CodecSetParameter (CODEC_HANDLETYPE handle, const Param *params, int paramCnt)

int32_t

Sets parameters required by a codec component.

CodecGetParameter (CODEC_HANDLETYPE handle, Param *params, int paramCnt)

int32_t

Obtains parameters from a codec component.

CodecStart (CODEC_HANDLETYPE handle)

int32_t

Starts a codec component.

CodecStop (CODEC_HANDLETYPE handle)

int32_t

Stops a codec component.

CodecFlush (CODEC_HANDLETYPE handle, DirectionType directType)

int32_t

Clears the cache when the codec component is the running state.

CodecQueueInput (CODEC_HANDLETYPE handle, const InputInfo *inputData, uint32_t timeoutMs)

int32_t

Queues input data.

CodecDequeInput (CODEC_HANDLETYPE handle, uint32_t timeoutMs, InputInfo *inputData)

int32_t

Dequeues input data that has been used.

CodecQueueOutput (CODEC_HANDLETYPE handle, OutputInfo *outInfo, uint32_t timeoutMs, int releaseFenceFd)

int32_t

Queues output data.

CodecDequeueOutput (CODEC_HANDLETYPE handle, uint32_t timeoutMs, int *acquireFd, OutputInfo *outInfo)

int32_t

Dequeues output data.

CodecSetCallback (CODEC_HANDLETYPE handle, const CodecCallback *cb, UINTPTR instance)

int32_t

Sets the callback function.