mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-09-26 21:15:53 +08:00
[tools]: add doxygen config file
1.The INPUT tag used to specify the files and/or directories that contain documented source files is set to mpp/inc. 2.The OUTPUT_DIRECTORY tag used to specify the (relative or absolute) path into which the generated documentation will be written is set to mpp/doc. 3.Assuming that doxygen is configured correctly under Linux, if you want to get documentation of pdf format, do as follow: cd mpp/tools doxygen mpp_doxyfile cd ../doc/latex make 4.mpp/doc/html contains documentation of html format. 5.modify notes of vpu_api.h and rk_mpi.h. Change-Id: I02b09514ff44b4689ea99e3d99d2acc9eb58cd19 Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
This commit is contained in:
133
inc/rk_mpi.h
133
inc/rk_mpi.h
@@ -20,23 +20,36 @@
|
||||
#include "mpp_task.h"
|
||||
#include "rk_mpi_cmd.h"
|
||||
|
||||
/**
|
||||
* @addtogroup rk_mpi
|
||||
* @brief rockchip media process interface
|
||||
*
|
||||
* Mpp provides application programming interface for the application layer.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup rk_mpi
|
||||
* @brief The type of mpp context
|
||||
*/
|
||||
typedef enum {
|
||||
MPP_CTX_DEC,
|
||||
MPP_CTX_ENC,
|
||||
MPP_CTX_ISP,
|
||||
MPP_CTX_BUTT,
|
||||
MPP_CTX_DEC, /**< decoder */
|
||||
MPP_CTX_ENC, /**< encoder */
|
||||
MPP_CTX_ISP, /**< isp */
|
||||
MPP_CTX_BUTT, /**< undefined */
|
||||
} MppCtxType;
|
||||
|
||||
/**
|
||||
* Enumeration used to define the possible video compression codings.
|
||||
* NOTE: This essentially refers to file extensions. If the coding is
|
||||
* @ingroup rk_mpi
|
||||
* @brief Enumeration used to define the possible video compression codings.
|
||||
* sync with the omx_video.h
|
||||
*
|
||||
* @note This essentially refers to file extensions. If the coding is
|
||||
* being used to specify the ENCODE type, then additional work
|
||||
* must be done to configure the exact flavor of the compression
|
||||
* to be used. For decode cases where the user application can
|
||||
* not differentiate between MPEG-4 and H.264 bit streams, it is
|
||||
* up to the codec to handle this.
|
||||
*/
|
||||
//sync with the omx_video.h
|
||||
typedef enum {
|
||||
MPP_VIDEO_CodingUnused, /**< Value when coding is N/A */
|
||||
MPP_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */
|
||||
@@ -125,12 +138,11 @@ typedef struct MppEncConfig_t {
|
||||
RK_S32 cabac_en;
|
||||
} MppEncConfig;
|
||||
|
||||
/*
|
||||
* mpp main work function set
|
||||
* size : MppApi structure size
|
||||
* version : Mpp svn revision
|
||||
/**
|
||||
* @ingroup rk_mpi
|
||||
* @brief mpp main work function set
|
||||
*
|
||||
* all api function are seperated into two sets: data io api set and control api set
|
||||
* @note all api function are seperated into two sets: data io api set and control api set
|
||||
*
|
||||
* the data api set is for data input/output flow including:
|
||||
*
|
||||
@@ -165,12 +177,51 @@ typedef struct MppApi_t {
|
||||
RK_U32 version;
|
||||
|
||||
// simple data flow interface
|
||||
/**
|
||||
* @brief both send video stream packet to decoder and get video frame from
|
||||
* decoder at the same time
|
||||
* @param ctx The context of mpp
|
||||
* @param packet[in] The input video stream
|
||||
* @param frame[out] The output picture
|
||||
* @return 0 for decode success, others for failure
|
||||
*/
|
||||
MPP_RET (*decode)(MppCtx ctx, MppPacket packet, MppFrame *frame);
|
||||
/**
|
||||
* @brief send video stream packet to decoder only, async interface
|
||||
* @param ctx The context of mpp
|
||||
* @param packet The input video stream
|
||||
* @return 0 for success, others for failure
|
||||
*/
|
||||
MPP_RET (*decode_put_packet)(MppCtx ctx, MppPacket packet);
|
||||
/**
|
||||
* @brief get video frame from decoder only, async interface
|
||||
* @param ctx The context of mpp
|
||||
* @param frame The output picture
|
||||
* @return 0 for success, others for failure
|
||||
*/
|
||||
MPP_RET (*decode_get_frame)(MppCtx ctx, MppFrame *frame);
|
||||
|
||||
/**
|
||||
* @brief both send video frame to encoder and get encoded video stream from
|
||||
* encoder at the same time
|
||||
* @param ctx The context of mpp
|
||||
* @param frame[in] The input video data
|
||||
* @param packet[out] The output compressed data
|
||||
* @return 0 for encode success, others for failure
|
||||
*/
|
||||
MPP_RET (*encode)(MppCtx ctx, MppFrame frame, MppPacket *packet);
|
||||
/**
|
||||
* @brief send video frame to encoder only, async interface
|
||||
* @param ctx The context of mpp
|
||||
* @param frame The input video data
|
||||
* @return 0 for success, others for failure
|
||||
*/
|
||||
MPP_RET (*encode_put_frame)(MppCtx ctx, MppFrame frame);
|
||||
/**
|
||||
* @brief get encoded video packet from encoder only, async interface
|
||||
* @param ctx The context of mpp
|
||||
* @param packet The output compressed data
|
||||
* @return 0 for success, others for failure
|
||||
*/
|
||||
MPP_RET (*encode_get_packet)(MppCtx ctx, MppPacket *packet);
|
||||
|
||||
MPP_RET (*isp)(MppCtx ctx, MppFrame dst, MppFrame src);
|
||||
@@ -178,13 +229,42 @@ typedef struct MppApi_t {
|
||||
MPP_RET (*isp_get_frame)(MppCtx ctx, MppFrame *frame);
|
||||
|
||||
// advance data flow interface
|
||||
/**
|
||||
* @brief dequeue MppTask
|
||||
* @param ctx The context of mpp
|
||||
* @param type input port or output port which are both for data transaction
|
||||
* @param task MppTask which is sent to mpp for process
|
||||
* @return 0 for success, oters for failure
|
||||
*/
|
||||
MPP_RET (*dequeue)(MppCtx ctx, MppPortType type, MppTask *task);
|
||||
/**
|
||||
* @brief enqueue MppTask
|
||||
* @param ctx The context of mpp
|
||||
* @param type input port or output port which are both for data transaction
|
||||
* @param task MppTask which is sent to mpp for process
|
||||
* @return 0 for success, oters for failure
|
||||
*/
|
||||
MPP_RET (*enqueue)(MppCtx ctx, MppPortType type, MppTask task);
|
||||
|
||||
// control interface
|
||||
/**
|
||||
* @brief discard all packet and frame, reset all component,
|
||||
* for both decoder and encoder
|
||||
* @param ctx The context of mpp
|
||||
*/
|
||||
MPP_RET (*reset)(MppCtx ctx);
|
||||
/**
|
||||
* @brief control function for mpp property setting
|
||||
* @param ctx The context of mpp
|
||||
* @param cmd The mpi command
|
||||
* @param param The mpi command parameter
|
||||
* @return 0 for success, oters for failure
|
||||
*/
|
||||
MPP_RET (*control)(MppCtx ctx, MpiCmd cmd, MppParam param);
|
||||
|
||||
/**
|
||||
* @brief The reserved segment
|
||||
*/
|
||||
RK_U32 reserv[16];
|
||||
} MppApi;
|
||||
|
||||
@@ -193,17 +273,28 @@ typedef struct MppApi_t {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* mpp interface work flow
|
||||
*
|
||||
* 1. mpp_create : Create empty context structure and mpi function pointers.
|
||||
* 2. mpp_init : Call after mpp_create to setup mpp type and video format.
|
||||
* This function will call internal context init function.
|
||||
* 3. Use functions in MppApi to access mpp services.
|
||||
* 4. mpp_destory: Destroy mpp context and free both context and mpi structure
|
||||
/**
|
||||
* @ingroup rk_mpi
|
||||
* @brief Create empty context structure and mpi function pointers.
|
||||
* Use functions in MppApi to access mpp services.
|
||||
* @param ctx pointer of the mpp context
|
||||
* @param mpi pointer of mpi function
|
||||
*/
|
||||
MPP_RET mpp_create(MppCtx *ctx, MppApi **mpi);
|
||||
/**
|
||||
* @ingroup rk_mpi
|
||||
* @brief Call after mpp_create to setup mpp type and video format.
|
||||
* This function will call internal context init function.
|
||||
* @param ctx The context of mpp
|
||||
* @param type MppCtxType, decoder or encoder
|
||||
* @param coding video compression coding
|
||||
*/
|
||||
MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding);
|
||||
/**
|
||||
* @ingroup rk_mpi
|
||||
* @brief Destroy mpp context and free both context and mpi structure
|
||||
* @param ctx The context of mpp
|
||||
*/
|
||||
MPP_RET mpp_destroy(MppCtx ctx);
|
||||
|
||||
// coding type format function
|
||||
|
103
inc/vpu_api.h
103
inc/vpu_api.h
@@ -20,6 +20,10 @@
|
||||
#include "rk_type.h"
|
||||
#include "mpp_err.h"
|
||||
|
||||
/**
|
||||
* @brief rockchip media process interface
|
||||
*/
|
||||
|
||||
#define VPU_API_NOPTS_VALUE (0x8000000000000000LL)
|
||||
|
||||
/*
|
||||
@@ -43,21 +47,24 @@
|
||||
#define VPU_OUTPUT_FORMAT_BIT_14 (0x00030000)
|
||||
#define VPU_OUTPUT_FORMAT_BIT_16 (0x00040000)
|
||||
|
||||
/**
|
||||
* @brief input picture type
|
||||
*/
|
||||
typedef enum {
|
||||
ENC_INPUT_YUV420_PLANAR = 0, /* YYYY... UUUU... VVVV */
|
||||
ENC_INPUT_YUV420_SEMIPLANAR = 1, /* YYYY... UVUVUV... */
|
||||
ENC_INPUT_YUV422_INTERLEAVED_YUYV = 2, /* YUYVYUYV... */
|
||||
ENC_INPUT_YUV422_INTERLEAVED_UYVY = 3, /* UYVYUYVY... */
|
||||
ENC_INPUT_RGB565 = 4, /* 16-bit RGB */
|
||||
ENC_INPUT_BGR565 = 5, /* 16-bit RGB */
|
||||
ENC_INPUT_RGB555 = 6, /* 15-bit RGB */
|
||||
ENC_INPUT_BGR555 = 7, /* 15-bit RGB */
|
||||
ENC_INPUT_RGB444 = 8, /* 12-bit RGB */
|
||||
ENC_INPUT_BGR444 = 9, /* 12-bit RGB */
|
||||
ENC_INPUT_RGB888 = 10, /* 24-bit RGB */
|
||||
ENC_INPUT_BGR888 = 11, /* 24-bit RGB */
|
||||
ENC_INPUT_RGB101010 = 12, /* 30-bit RGB */
|
||||
ENC_INPUT_BGR101010 = 13 /* 30-bit RGB */
|
||||
ENC_INPUT_YUV420_PLANAR = 0, /**< YYYY... UUUU... VVVV */
|
||||
ENC_INPUT_YUV420_SEMIPLANAR = 1, /**< YYYY... UVUVUV... */
|
||||
ENC_INPUT_YUV422_INTERLEAVED_YUYV = 2, /**< YUYVYUYV... */
|
||||
ENC_INPUT_YUV422_INTERLEAVED_UYVY = 3, /**< UYVYUYVY... */
|
||||
ENC_INPUT_RGB565 = 4, /**< 16-bit RGB */
|
||||
ENC_INPUT_BGR565 = 5, /**< 16-bit RGB */
|
||||
ENC_INPUT_RGB555 = 6, /**< 15-bit RGB */
|
||||
ENC_INPUT_BGR555 = 7, /**< 15-bit RGB */
|
||||
ENC_INPUT_RGB444 = 8, /**< 12-bit RGB */
|
||||
ENC_INPUT_BGR444 = 9, /**< 12-bit RGB */
|
||||
ENC_INPUT_RGB888 = 10, /**< 24-bit RGB */
|
||||
ENC_INPUT_BGR888 = 11, /**< 24-bit RGB */
|
||||
ENC_INPUT_RGB101010 = 12, /**< 30-bit RGB */
|
||||
ENC_INPUT_BGR101010 = 13 /**< 30-bit RGB */
|
||||
} EncInputPictureType;
|
||||
|
||||
typedef enum VPU_API_CMD {
|
||||
@@ -161,15 +168,16 @@ typedef struct EncoderOut {
|
||||
} EncoderOut_t;
|
||||
|
||||
/*
|
||||
* Enumeration used to define the possible video compression codings.
|
||||
* NOTE: This essentially refers to file extensions. If the coding is
|
||||
* @brief Enumeration used to define the possible video compression codings.
|
||||
* @note This essentially refers to file extensions. If the coding is
|
||||
* being used to specify the ENCODE type, then additional work
|
||||
* must be done to configure the exact flavor of the compression
|
||||
* to be used. For decode cases where the user application can
|
||||
* not differentiate between MPEG-4 and H.264 bit streams, it is
|
||||
* up to the codec to handle this.
|
||||
*
|
||||
* sync with the omx_video.h
|
||||
*/
|
||||
//sync with the omx_video.h
|
||||
typedef enum OMX_RK_VIDEO_CODINGTYPE {
|
||||
OMX_RK_VIDEO_CodingUnused, /**< Value when coding is N/A */
|
||||
OMX_RK_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */
|
||||
@@ -253,16 +261,15 @@ typedef struct EncParameter {
|
||||
RK_S32 reserved[3];
|
||||
} EncParameter_t;
|
||||
|
||||
|
||||
typedef struct EXtraCfg {
|
||||
RK_S32 vc1extra_size;
|
||||
RK_S32 vp6codeid;
|
||||
RK_S32 tsformat;
|
||||
RK_U32 reserved[20];
|
||||
} EXtraCfg_t;
|
||||
|
||||
/**
|
||||
* @addtogroup rk_vpu_codec
|
||||
* @{
|
||||
* @brief vpu function interface
|
||||
*/
|
||||
typedef struct VpuCodecContext {
|
||||
void* vpuApiObj;
|
||||
@@ -277,8 +284,6 @@ typedef struct VpuCodecContext {
|
||||
|
||||
RK_U8 enableparsing;
|
||||
|
||||
|
||||
|
||||
RK_S32 no_thread;
|
||||
EXtraCfg_t extra_cfg;
|
||||
|
||||
@@ -300,35 +305,61 @@ typedef struct VpuCodecContext {
|
||||
* @param extra_size The size of extra data.
|
||||
*
|
||||
* @return 0 for init success, others for failure.
|
||||
* note: check whether ctx has been allocated success after you do init.
|
||||
* @note check whether ctx has been allocated success after you do init.
|
||||
*/
|
||||
RK_S32 (*init)(struct VpuCodecContext *ctx, RK_U8 *extraData, RK_U32 extra_size);
|
||||
|
||||
/**
|
||||
* @brief both send video stream packet to decoder and get video frame from
|
||||
* decoder at the same time
|
||||
* @param ctx The context of vpu codec
|
||||
* @param pkt[in] Stream to be decoded
|
||||
* @param aDecOut[out] Decoding frame
|
||||
* @return 0 for decode success, others for failure.
|
||||
*/
|
||||
RK_S32 (*decode)(struct VpuCodecContext *ctx, VideoPacket_t *pkt, DecoderOut_t *aDecOut);
|
||||
|
||||
/**
|
||||
* @brief both send video frame to encoder and get encoded video stream from
|
||||
* encoder at the same time.
|
||||
* @param ctx The context of vpu codec
|
||||
* @param aEncInStrm[in] Frame to be encoded
|
||||
* @param aEncOut[out] Encoding stream
|
||||
* @return 0 for encode success, others for failure.
|
||||
*/
|
||||
RK_S32 (*encode)(struct VpuCodecContext *ctx, EncInputStream_t *aEncInStrm, EncoderOut_t *aEncOut);
|
||||
|
||||
/**
|
||||
* flush codec while do fast forward playing.
|
||||
*
|
||||
* @brief flush codec while do fast forward playing.
|
||||
* @param ctx The context of vpu codec
|
||||
* @return 0 for flush success, others for failure.
|
||||
*/
|
||||
RK_S32 (*flush)(struct VpuCodecContext *ctx);
|
||||
RK_S32 (*control)(struct VpuCodecContext *ctx, VPU_API_CMD cmdType, void* param);
|
||||
/**
|
||||
*seperate the decode function to two function
|
||||
*
|
||||
*/
|
||||
* @brief send video stream packet to decoder only, async interface
|
||||
* @param ctx The context of vpu codec
|
||||
* @param pkt Stream to be decoded
|
||||
* @return 0 for success, others for failure.
|
||||
*/
|
||||
RK_S32 (*decode_sendstream)(struct VpuCodecContext *ctx, VideoPacket_t *pkt);
|
||||
/**
|
||||
* @brief get video frame from decoder only, async interface
|
||||
* @param ctx The context of vpu codec
|
||||
* @param aDecOut Decoding frame
|
||||
* @return 0 for success, others for failure.
|
||||
*/
|
||||
RK_S32 (*decode_getframe)(struct VpuCodecContext *ctx, DecoderOut_t *aDecOut);
|
||||
|
||||
/**
|
||||
* @brief send video frame to encoder only, async interface
|
||||
* @param ctx The context of vpu codec
|
||||
* @param aEncInStrm Frame to be encoded
|
||||
* @return 0 for success, others for failure.
|
||||
*/
|
||||
RK_S32 (*encoder_sendframe)(struct VpuCodecContext *ctx, EncInputStream_t *aEncInStrm);
|
||||
/**
|
||||
* @brief get encoded video packet from encoder only, async interface
|
||||
* @param ctx The context of vpu codec
|
||||
* @param aEncOut Encoding stream
|
||||
* @return 0 for success, others for failure.
|
||||
*/
|
||||
RK_S32 (*encoder_getstream)(struct VpuCodecContext *ctx, EncoderOut_t *aEncOut);
|
||||
} VpuCodecContext_t;
|
||||
|
||||
@@ -338,7 +369,15 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief open context of vpu
|
||||
* @param ctx pointer of vpu codec context
|
||||
*/
|
||||
RK_S32 vpu_open_context(struct VpuCodecContext **ctx);
|
||||
/**
|
||||
* @brief close context of vpu
|
||||
* @param ctx pointer of vpu codec context
|
||||
*/
|
||||
RK_S32 vpu_close_context(struct VpuCodecContext **ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
2303
tools/mpp_doxyfile
Normal file
2303
tools/mpp_doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user