2. Tops Codec API 文档¶
2.1. Global enum and defines¶
此部分内容是GlobalDefs Global enum and defines
-
enum topscodecDevID_t¶
Describes the device ID.
Values:
-
enumerator TOPSCODEC_DEVICE_VPP0_COMBO¶
Device 0
-
enumerator TOPSCODEC_DEVICE_VPP0_DECODE¶
Device 1
-
enumerator TOPSCODEC_DEVICE_VPP1_COMBO¶
Device 2
-
enumerator TOPSCODEC_DEVICE_VPP1_DECODE¶
Device 3
-
enumerator TOPSCODEC_DEVICE_UNKNOWN¶
-
enumerator TOPSCODEC_DEVICE_VPP0_COMBO¶
-
enum topscodecRetCode_t¶
Describes the return values of EFCodec API calls.
Values:
-
enumerator TOPSCODEC_SUCCESS¶
-
enumerator TOPSCODEC_ERROR_INVALID_VALUE¶
Invalid parameters passed to EFCodec.
-
enumerator TOPSCODEC_ERROR_INVALID_HANDLE¶
Invalid handle passed to EFCodec.
-
enumerator TOPSCODEC_ERROR_INVALID_MEMORY¶
Invalid memory passed to EFCodec.
-
enumerator TOPSCODEC_ERROR_CREATE_FAILED¶
Fails to create encode or decode.
-
enumerator TOPSCODEC_ERROR_TIMEOUT¶
Timeout for function call.
-
enumerator TOPSCODEC_ERROR_OUT_OF_MEMORY¶
Unable to allocate enough memory.
-
enumerator TOPSCODEC_ERROR_BUFFER_EMPTY¶
No output buffer available.
-
enumerator TOPSCODEC_ERROR_NOT_SUPPORTED¶
Function not supported.
-
enumerator TOPSCODEC_ERROR_NOT_PERMITED¶
Operation not permitted.
-
enumerator TOPSCODEC_ERROR_TRANSMIT_FAILED¶
An error occurs in msg transmit process.
-
enumerator TOPSCODEC_ERROR_BAD_STREAM¶
Invalid input stream; for example, it fails to parse the JPEG stream.
-
enumerator TOPSCODEC_ERROR_BUFFER_OVERFLOW¶
Encode output buffer overflow.
-
enumerator TOPSCODEC_ERROR_DEVICE_NOT_OPEN¶
-
enumerator TOPSCODEC_ERROR_UNKNOWN¶
Unknown error.
-
enumerator TOPSCODEC_SUCCESS¶
-
enum topscodecType_t¶
Describes the codec types.
Values:
-
enumerator TOPSCODEC_MPEG1¶
MPEG1
-
enumerator TOPSCODEC_MPEG2¶
MPEG2
-
enumerator TOPSCODEC_MPEG4¶
MPEG4
-
enumerator TOPSCODEC_VC1¶
VC1
-
enumerator TOPSCODEC_H263¶
H263
-
enumerator TOPSCODEC_H264¶
H.264
-
enumerator TOPSCODEC_H264_SVC¶
H.264-SVC
-
enumerator TOPSCODEC_H264_MVC¶
H.264-MVC
-
enumerator TOPSCODEC_HEVC¶
HEVC
-
enumerator TOPSCODEC_VP8¶
VP8
-
enumerator TOPSCODEC_VP9¶
VP9
-
enumerator TOPSCODEC_AVS¶
AVS
-
enumerator TOPSCODEC_AVS_PLUS¶
AVS+
-
enumerator TOPSCODEC_AVS2¶
AVS2
-
enumerator TOPSCODEC_JPEG¶
JPEG
-
enumerator TOPSCODEC_AV1¶
AV1
-
enumerator TOPSCODEC_NUM_CODECS¶
The number of EFCodec enums.
-
enumerator TOPSCODEC_MPEG1¶
-
enum topscodecJpegBackend_t¶
Describes the EFCodec backend IP.
Values:
-
enumerator TOPSCODEC_BACKEND_DEFAULT_HW¶
-
enumerator TOPSCODEC_BACKEND_JPU_HW¶
-
enumerator TOPSCODEC_BACKEND_VPU_HW¶
-
enumerator TOPSCODEC_BACKEND_DEFAULT_HW¶
-
enum topscodecChromaFormat_t¶
Describes the chroma formats.
Values:
-
enumerator TOPSCODEC_CHROMA_FORMAT_MONOCHROME¶
MonoChrome.
-
enumerator TOPSCODEC_CHROMA_FORMAT_420¶
YUV 4:2:0.
-
enumerator TOPSCODEC_CHROMA_FORMAT_422¶
YUV 4:2:2.
-
enumerator TOPSCODEC_CHROMA_FORMAT_444¶
YUV 4:4:4.
-
enumerator TOPSCODEC_CHROMA_FORMAT_440¶
YUV 4:4:0.
-
enumerator TOPSCODEC_CHROMA_FORMAT_411¶
YUV 4:1:1.
-
enumerator TOPSCODEC_CHROMA_FORMAT_410¶
YUV 4:1:0.
-
enumerator TOPSCODEC_CHROMA_FORMAT_400¶
YUV 4:0:0.
-
enumerator TOPSCODEC_CHROMA_FORMAT_UNKNOWN¶
Unknown chroma format.
-
enumerator TOPSCODEC_CHROMA_FORMAT_MONOCHROME¶
-
enum topscodecPicType_t¶
Describes the picture types.
Values:
-
enumerator TOPSCODEC_PIC_TYPE_P¶
Forward predicted picture.
-
enumerator TOPSCODEC_PIC_TYPE_B¶
Bi-directionally predicted picture.
-
enumerator TOPSCODEC_PIC_TYPE_I¶
Intra predicted picture.
-
enumerator TOPSCODEC_PIC_TYPE_IDR¶
IDR picture.
-
enumerator TOPSCODEC_PIC_TYPE_UNKNOWN¶
Unknown picture type.
-
enumerator TOPSCODEC_PIC_TYPE_P¶
-
enum topscodecStreamType_t¶
Describes the stream types.
Values:
-
enumerator TOPSCODEC_NALU_TYPE_P¶
Forward predicted frame type.
-
enumerator TOPSCODEC_NALU_TYPE_B¶
Bi-directionally predicted frame type.
-
enumerator TOPSCODEC_NALU_TYPE_I¶
Intra predicted frame type.
-
enumerator TOPSCODEC_NALU_TYPE_IDR¶
IDR frame type.
-
enumerator TOPSCODEC_NALU_TYPE_EOS¶
EOS (End Of Stream) NAL unit type.
-
enumerator TOPSCODEC_NALU_TYPE_SEI¶
SEI NAL unit type.
-
enumerator TOPSCODEC_NALU_TYPE_SPS¶
SPS NAL unit type.
-
enumerator TOPSCODEC_NALU_TYPE_PPS¶
PPS NAL unit type.
-
enumerator TOPSCODEC_NALU_TYPE_VPS¶
VPS NAL unit type.
-
enumerator TOPSCODEC_H264_NALU_TYPE_SPS_PPS¶
H.264 mixed type, not a standard NALU type.
-
enumerator TOPSCODEC_HEVC_NALU_TYPE_VPS_SPS_PPS¶
HEVC mixed type, not a standard NALU type.
-
enumerator TOPSCODEC_NALU_TYPE_UNKNOWN¶
Unknown NAL unit type.
-
enumerator TOPSCODEC_NALU_TYPE_P¶
-
enum topscodecEventType_t¶
Describes the event types.
Values:
-
enumerator TOPSCODEC_EVENT_NEW_FRAME¶
For both decode/encode, data output callback event.
-
enumerator TOPSCODEC_EVENT_SEQUENCE¶
For video decode, sequence callback event.
-
enumerator TOPSCODEC_EVENT_EOS¶
For both decode/encode, notifies EOS event.
-
enumerator TOPSCODEC_EVENT_FRAME_PROCESSED¶
Encode frame is processed.
-
enumerator TOPSCODEC_EVENT_BITSTREAM_PROCESSED¶
Decode input bitstream buffer
-
enumerator TOPSCODEC_EVENT_OUT_OF_MEMORY¶
Fails to allocate memory due to insufficient space.
-
enumerator TOPSCODEC_EVENT_STREAM_CORRUPT¶
Stream corrupts, and the frame is discarded.
-
enumerator TOPSCODEC_EVENT_STREAM_NOT_SUPPORTED¶
Stream is not supported.
-
enumerator TOPSCODEC_EVENT_BUFFER_OVERFLOW¶
Encode output buffer overflow or decode output buffer number is not enough.
-
enumerator TOPSCODEC_EVENT_FATAL_ERROR¶
Internal fatal error.
-
enumerator TOPSCODEC_EVENT_NEW_FRAME¶
-
enum topscodecColorSpace_t¶
Describes the color space types.
Values:
-
enumerator TOPSCODEC_COLOR_SPACE_BT_601¶
ITU BT.601 color standard.
-
enumerator TOPSCODEC_COLOR_SPACE_BT_601_ER¶
ITU BT.601 color standard extend range.
-
enumerator TOPSCODEC_COLOR_SPACE_BT_709¶
ITU BT.709 color standard.
-
enumerator TOPSCODEC_COLOR_SPACE_BT_709_ER¶
ITU BT.709 color standard extend range.
-
enumerator TOPSCODEC_COLOR_SPACE_BT_2020¶
ITU BT.2020 color standard.
-
enumerator TOPSCODEC_COLOR_SPACE_BT_2020_ER¶
ITU BT.2020 color standard extend range.
-
enumerator TOPSCODEC_COLOR_SPACE_BT_601¶
-
enum topscodecMemType_t¶
Describes the memory types.
Values:
-
enumerator TOPSCODEC_MEM_TYPE_HOST¶
Host CPU memory.
-
enumerator TOPSCODEC_MEM_TYPE_DEV¶
GCU Device memory.
-
enumerator TOPSCODEC_MEM_TYPE_HOST¶
-
enum topscodecBufSource_t¶
Describes the buffer source types.
Values:
-
enumerator TOPSCODEC_BUF_SOURCE_LIB¶
Creates buffers by EFCodec SDK.
-
enumerator TOPSCODEC_BUF_SOURCE_USER¶
Creates buffers by user APP.
-
enumerator TOPSCODEC_BUF_SOURCE_LIB¶
-
enum topscodecPixelFormat_t¶
Describes the pixel formats.
Values:
-
enumerator TOPSCODEC_PIX_FMT_NV12¶
Semi-planar Y4-U1V1.
-
enumerator TOPSCODEC_PIX_FMT_NV21¶
Semi-planar Y4-V1U1.
-
enumerator TOPSCODEC_PIX_FMT_I420¶
Planar Y4-U1-V1.
-
enumerator TOPSCODEC_PIX_FMT_YV12¶
Planar Y4-V1-U1.
-
enumerator TOPSCODEC_PIX_FMT_YUYV¶
8bit packed Y2U1Y2V1.
-
enumerator TOPSCODEC_PIX_FMT_UYVY¶
8bit packed U1Y2V1Y2.
-
enumerator TOPSCODEC_PIX_FMT_YVYU¶
8bit packed Y2V1Y2U1.
-
enumerator TOPSCODEC_PIX_FMT_VYUY¶
8bit packed V1Y2U1Y2.
-
enumerator TOPSCODEC_PIX_FMT_P010¶
10bit semi-planar Y4-U1V1.
-
enumerator TOPSCODEC_PIX_FMT_P010LE¶
10bit semi-planar Y4-U1V1 little end
-
enumerator TOPSCODEC_PIX_FMT_I010¶
10bit planar Y4-U1-V1.
-
enumerator TOPSCODEC_PIX_FMT_YUV444¶
8bit planar Y4-U4-V4
-
enumerator TOPSCODEC_PIX_FMT_YUV444_10BIT¶
10bit planar Y4-U4-V4.
-
enumerator TOPSCODEC_PIX_FMT_ARGB¶
Packed A8R8G8B8.
-
enumerator TOPSCODEC_PIX_FMT_ABGR¶
Packed A8B8G8R8.
-
enumerator TOPSCODEC_PIX_FMT_BGRA¶
Packed B8G8R8A8.
-
enumerator TOPSCODEC_PIX_FMT_RGBA¶
Packed A8B8G8R8.
-
enumerator TOPSCODEC_PIX_FMT_RGB565¶
R5G6B5, 16 bits per pixel.
-
enumerator TOPSCODEC_PIX_FMT_BGR565¶
B5G6R5, 16 bits per pixel.
-
enumerator TOPSCODEC_PIX_FMT_RGB555¶
B5G5R5, 16 bits per pixel.
-
enumerator TOPSCODEC_PIX_FMT_BGR555¶
B5G5R5, 16 bits per pixel.
-
enumerator TOPSCODEC_PIX_FMT_RGB444¶
R4G4B4, 16 bits per pixel.
-
enumerator TOPSCODEC_PIX_FMT_BGR444¶
B4G4R4, 16 bits per pixel.
-
enumerator TOPSCODEC_PIX_FMT_RGB888¶
8bit packed R8G8B8.
-
enumerator TOPSCODEC_PIX_FMT_BGR888¶
8bit packed B8G8R8.
-
enumerator TOPSCODEC_PIX_FMT_RGB3P¶
8bit planar R-G-B
-
enumerator TOPSCODEC_PIX_FMT_RGB101010¶
10bit packed R10G10B10.
-
enumerator TOPSCODEC_PIX_FMT_BGR101010¶
10bit packed B10G10R10.
-
enumerator TOPSCODEC_PIX_FMT_MONOCHROME¶
8bit gray scale.
-
enumerator TOPSCODEC_PIX_FMT_MONOCHROME_10BIT¶
10bit gray scale.
-
enumerator TOPSCODEC_PIX_FMT_BGR3P¶
8bit planar B-G-R
-
enumerator TOPSCODEC_PIX_FMT_NV12¶
-
enum topscodecRotation_t¶
Indicates the rotation facotrs.
Values:
-
enumerator TOPSCODEC_ROTATION_NONE¶
Counter-clockwise rotation 0.
-
enumerator TOPSCODEC_ROTATION_90¶
Counter-clockwise rotation 90.
-
enumerator TOPSCODEC_ROTATION_180¶
Counter-clockwise rotation 180.
-
enumerator TOPSCODEC_ROTATION_270¶
Counter-clockwise rotation 270.
-
enumerator TOPSCODEC_ROTATION_NONE¶
-
enum topscodecRunMode_t¶
Describes the run mode, of which synchronized mode is only supported by JPEG decoding and JPEG encoding.
Values:
-
enumerator TOPSCODEC_RUN_MODE_ASYNC¶
Runs asynchronously.
-
enumerator TOPSCODEC_RUN_MODE_SYNC¶
Runs synchronously. Only JPEG supports this mode.
-
enumerator TOPSCODEC_RUN_MODE_ASYNC¶
-
enum topscodecDecMode_t¶
Describes video decoding mode.
Values:
-
enumerator TOPSCODEC_DEC_MODE_IPB¶
Decodes IPB frames.
-
enumerator TOPSCODEC_DEC_MODE_IP¶
Decodes IP frames (not supported yet).
-
enumerator TOPSCODEC_DEC_MODE_I¶
Decodes I frames.
-
enumerator TOPSCODEC_DEC_MODE_REF¶
Decodes reference frames, and skips non-reference frames.
-
enumerator TOPSCODEC_DEC_MODE_IPB¶
-
enum topscodecDecSendMode_t¶
Describes decoder sending modes.
Values:
-
enumerator TOPSCODEC_DEC_SEND_MODE_FRAME¶
Sends by frame.
-
enumerator TOPSCODEC_DEC_SEND_MODE_STREAM¶
Sends by stream.
-
enumerator TOPSCODEC_DEC_SEND_MODE_FRAME¶
-
enum topscodecDecOutputOrder_t¶
Describes video decoding output order.
Values:
-
enumerator TOPSCODEC_DEC_OUTPUT_ORDER_DISPLAY¶
Display order.
-
enumerator TOPSCODEC_DEC_OUTPUT_ORDER_DECODE¶
Decoding order.
-
enumerator TOPSCODEC_DEC_OUTPUT_ORDER_DISPLAY¶
-
enum topscodecDecStatus_t¶
Describes decoder buffer status, which is used in ::topscodecDecQueryBufStatus.
Values:
-
enumerator TOPSCODECDEC_STATUS_INVALID¶
-
enumerator TOPSCODECDEC_STATUS_INPROGRESS¶
-
enumerator TOPSCODECDEC_STATUS_SUCCESS¶
-
enumerator TOPSCODECDEC_STATUS_ERROR¶
-
enumerator TOPSCODECDEC_STATUS_INVALID¶
-
typedef enum topscodecPixelFormat_t topscodecPixelFormat_t
Describes the pixel formats.
-
typedef i32_t (*topscodecCallback_t)(topscodecEventType_t, void*, void*)¶
Decoder and encoder callback function type, which is called when events of topscodecEventType_t occur.
The first parameter with type topscodecEventType_t indicates event type. The second parameter with type void * is used to bypass user_context. The third parameter with type void * indicates event attribute. Return value of callbacks will be passed to SendData when an error occurs.
-
TOPSCODEC_FRAME_MAX_PLANE_NUM¶
-
struct topscodecFramePlane_t¶
- #include <tops_codec.h>
Indicates frame plane attributes, which are used in topscodecFrame_t.
-
struct topscodecFrame_t¶
- #include <tops_codec.h>
Indicates frame attributes, which are used as decoder’s output data struct or encoder’s input data struct.
-
struct topscodecStream_t¶
- #include <tops_codec.h>
Indicates stream attributes, which are used as decoding input or encoding output. Only system memory is supported when this struct is used as decoding input. Only GCU memory is supported when this struct is used as encoding output.
-
struct topscodecRect_t¶
- #include <tops_codec.h>
Indicates rectangle attributes, which are used to indicate CROP attribute or video decoding display area.
-
struct topscodecAspectRatio_t¶
- #include <tops_codec.h>
Indicates video decoding display aspect ratio.
-
struct topscodecFps_t¶
- #include <tops_codec.h>
Indicates video stream’s framerate, numerator/denominator.
-
struct topscodecVideoSignalDescription_t¶
- #include <tops_codec.h>
Video signal description. Refer to Section E.2.1 (VUI parameters syntax) of H.264 specification doc.
-
struct topscodecRotationAttr_t¶
- #include <tops_codec.h>
Indicates codec ratation attributes.
-
struct topscodecDownscaleAttr_t¶
- #include <tops_codec.h>
Indicates decoding downscaled width and height attributes.
-
struct topscodecCropAttr_t¶
- #include <tops_codec.h>
Indicates crop attributes.
-
struct topscodecSfoAttr_t¶
-
struct topscodecPpAttr_t¶
- #include <tops_codec.h>
Indicates decoding post-process attributes or encoding pre-process attributes.
-
struct topscodecDecCaps_t¶
- #include <tops_codec.h>
Describes the decoder capability. The capability of JPEG decoder is a union of all backends.
-
struct topscodecDecSequenceInfo_t¶
- #include <tops_codec.h>
Describes video decoding sequence event information.
-
struct topscodecDecStreamCorruptInfo_t¶
- #include <tops_codec.h>
Describes decoding stream corrupt event information.
-
struct topscodecDecCreateInfo_t¶
- #include <tops_codec.h>
Describes decoder create attributes, which are used in topscodecDecCreate.
-
struct topscodecDecParams_t¶
- #include <tops_codec.h>
Describes decoder parameters, which are used in topscodecDecSetParams.
-
struct topscodecJpegInfo_t¶
- #include <tops_codec.h>
Describes JPEG header information, which is used in ::topscodecDecGetJpegInfo.
2.2. Codec APIs¶
此部分内容是Codec APIs
- TOPSCODEC_EXPORT i32_t topscodecGetLibVersion (u32_t *major, u32_t *minor, u32_t *patch)
Retrieves the version of EFCodec library. The version of EFCodec is composed of major, minor and patch. For instance, major = 1, minor = 1, patch = 9, the version of EFCodec library is 1.1.9.
- Requirements
None.
- Example
None.
Note
None.
- Parameters
major – [in] Input. A pointer to scale factor that gets the major version of EFCodec library.
minor – [in] Input. A pointer to scale factor that gets the minor version of EFCodec library.
patch – [in] Input. A pointer to scale factor that gets the patch version of EFCodec library.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
- TOPSCODEC_EXPORT i32_t topscodecGetMemoryHandle (u64_t dev_addr, u64_t size, void **rt_handle)
Convert a device address to a runtime memory handle.
- Parameters
dev_addr – [in] Specifies the device address.
size – [in] Specifies the size of the memory.
rt_handle – [out] Returns the runtime memory handle.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
- TOPSCODEC_EXPORT i32_t topscodecDecGetCaps (topscodecType_t codec, u32_t card_id, u32_t device_id, topscodecDecCaps_t *caps)
Gets decoder capability information.
- Parameters
codec – [in] Specifies which codec is chosen to get capability information.
device_id – [in] Specifies which device is chosen to get capability information. The value is in the range [0, device number - 1].
caps – [out] Decoder’s capability.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
- TOPSCODEC_EXPORT i32_t topscodecDecCreate (topscodecHandle_t *handle, topscodecDecCreateInfo_t *info)
Creates decoder.
- Parameters
handle – [out] Returns decoder’s handle.
cb – [in] Gives event callback to decoder.
info – [in] Information for creating decoder.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_NOT_SUPPORTED – This function call fails because the codec type is not supported.
TOPSCODEC_ERROR_CREATE_FAILED – This function call fails because it is unable to create decoder on the device.
TOPSCODEC_ERROR_OUT_OF_MEMORY – This function call fails because it is unable to allocate enough memory.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
- TOPSCODEC_EXPORT i32_t topscodecDecSetParams (topscodecHandle_t handle, topscodecDecParams_t *params)
Sets the decoder parameters.
Note
This function should be called before decoding or in the sequence callback function.
When this function is called and it causes the output buffer to reallocate, the application needs to ensure that the old buffers are not referenced.
- Parameters
handle – [in] Decoder’s handle.
params – [in] Decoder parameters.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_NOT_SUPPORTED – This function call fails because one or more specified functions is not supported.
TOPSCODEC_ERROR_OUT_OF_MEMORY – This function call fails because it is unable to allocate enough memory.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
- TOPSCODEC_EXPORT i32_t topscodecDecDestroy (topscodecHandle_t handle)
Destroys decoder.
- Parameters
handle – [in] Decoder’s handle.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
- TOPSCODEC_EXPORT i32_t topscodecDecodeStream (topscodecHandle_t handle, topscodecStream_t *input, i32_t timeout_ms)
Sends stream to decoder.
Note
When user’s APP callback does not return TOPSCODEC_SUCCESS, the error return value will be passed to this function asynchronously.
- Parameters
handle – [in] Decoder’s handle.
input – [in] Input stream information.
timeout_ms – [in] Timeout in ms, -1 means waiting infinitely.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
TOPSCODEC_ERROR_TIMEOUT – This function call fails because of timeout.
TOPSCODEC_ERROR_UNKNOWN – This function call fails because of unknown error. The decoder is unable to continue running.
- TOPSCODEC_EXPORT i32_t topscodecDecFrameMap (topscodecHandle_t handle, topscodecFrame_t *frame)
Increases reference count of output frame.
- Parameters
handle – [in] Decoder’s handle.
frame – [in] Reference count of frame to be increased.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
- TOPSCODEC_EXPORT i32_t topscodecDecFrameUnmap (topscodecHandle_t handle, topscodecFrame_t *frame)
Decreases reference count of output frame.
- Parameters
handle – [in] Decoder’s handle.
frame – [in] Reference count of frame to be decreased.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
- TOPSCODEC_EXPORT i32_t topscodecDecJpegSyncDecode (topscodecHandle_t handle, topscodecStream_t input[], topscodecFrame_t output[], i32_t timeout_ms)
Decodes JPEG by synchronization mode.
- Parameters
handle – [in] Decoder’s handle.
input – [in] Input stream information.
output – [in] Output frame information, user application should allocate output frame buffer and set to output.
timeout_ms – [in] Timeout in ms, -1 means waiting infinitely.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_TIMEOUT – This function call fails because of timeout.
TOPSCODEC_ERROR_BAD_STREAM – This function call fails because the input stream is invalid.
TOPSCODEC_ERROR_NOT_SUPPORTED – This function call fails because the input stream is not supported.
TOPSCODEC_ERROR_UNKNOWN – This function call fails because of unknown error.The decoder is unable to continue running.
- TOPSCODEC_EXPORT i32_t topscodecDecGetStatus (topscodecHandle_t handle, topscodecDecStatus_t *status)
Queries decoder’s buffer status.
- Parameters
handle – [in] Decoder’s handle.
status – [out] Decoder’s buffer status.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_HANDLE – This function call fails because the handle is invalid.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.
TOPSCODEC_ERROR_TRANSMIT_FAILED – This function call fails because communication with the device fails.
- TOPSCODEC_EXPORT i32_t topscodecGetLoading (topscodecDevID_t deviceID, u32_t sess_id, double *loading)
Query hardware loading.
- Parameters
deviceID – [in] Codec device ID.
Loading – [in] Codec HW Loading.
- Returns
TOPSCODEC_SUCCESS – This function has run successfully.
TOPSCODEC_ERROR_INVALID_VALUE – This function call fails because the value of the function parameter is invalid.