Files
2026-02-01 22:23:06 +08:00

112 lines
2.6 KiB
C++

/*
* @Date: 2024-07-22 19:36:07
* @LastEditors: Jacky
* @LastEditTime: 2024-09-05 16:38:18
* @FilePath: /GeneralTracker/Adaptation/InterfaceVdec.h
*/
#ifndef _VDEC_STREAM_H_
#define _VDEC_STREAM_H_
#include <stdint.h>
#include "PlatformDefine.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
GD_PIXEL_FORMAT_E outputFormat; //输出图像类型
uint32_t srcWidth; //原始图像宽
uint32_t srcHeight; //原始图像高
uint32_t dstWidth; //原始图像宽
uint32_t dstHeight; //原始图像高
}DecodeAttr_t;
typedef struct{
uint32_t frameIndex;
}DecodeData_t;
/**
* @brief: 解码数据接收回调函数
* @param {int} chn 解码通道
* @param {uint32_t} index 数据帧编号
* @param {char} *ptr 解码数据
* @param {int} size 解码数据大小
* @param {void} *userdata 用户指针
* @return {*}
* @Date: 2024-07-22 19:26:16
*/
typedef int32_t (*decodeFrameCallback)(const int chn, char *ptr, int size, DecodeData_t *param, void *userdata);
/**
* @brief: 打开解码通道
* @param {int} chn
* @param {string} url
* @param {DecodeAttr_t} *param
* @param {decodeFrameCallback} callback
* @param {void} *userdata
* @return {*}
* @Date: 2024-09-05 16:38:16
*/
module_error_t decodeOpen(const int chn, std::string url, DecodeAttr_t *param, decodeFrameCallback callback, void *userdata);
/**
* @brief: 关闭解码通道
* @param {int} 解码通道
* @return {*}
* @Date: 2024-07-22 19:26:40
*/
module_error_t decodeClose(const int chn);
/**
* @brief: 开始解码
* @param {int} 解码通道
* @return {*}
* @Date: 2024-07-22 19:26:45
*/
module_error_t decodeStart(const int chn);
/**
* @brief: 停止解码
* @param {int} 解码通道
* @return {*}
* @Date: 2024-07-22 19:27:54
*/
module_error_t decodeStop(const int chn);
/**
* @brief: 设置解码参数
* @param {int} 解码通道
* @param {DecodeAttr_t}
* @return {*}
* @Date: 2024-07-22 19:28:45
*/
module_error_t decodeSetAttr(const int chn, DecodeAttr_t *param);
/**
* @brief: 获取解码参数
* @param {int} 解码通道
* @param {DecodeAttr_t}
* @return {*}
* @Date: 2024-07-22 19:30:22
*/
module_error_t decodeGetAttr(const int chn, DecodeAttr_t *param);
/**
* @brief: 解码接收接口,用于获取图像帧
* @param {int} 解码通道
* @param {GD_VIDEO_FRAME_S} 图像数据结构体
* @return {*}
* @Date: 2024-07-22 19:30:26
*/
module_error_t decodeGetFrame(const int chn, GD_VIDEO_FRAME_S *frame);
#ifdef __cplusplus
}
#endif
#endif