找传奇、传世资源到传世资源站!

QT Hisi demo

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

QT 在hisi的demo

#include "handlehisidynamic.h"#include<QDebug>#include <QLibrary>#include <QFileInfo>#ifdef HISIV100static Error_S ErrList[] = { {0, "unknow error"}, {-1, "lib file not exist"}, {-2, "Mpp system init error"}, {-3, "Mpp system stop error"}, {-4, "not a dynamic file"}, {-5, "load failed"}, {-6, "resolve Mpp_jegappend fxc error"}, {-7, "resolve Mpp_registerDecode fxc error"}, {-8, "resolve Mpp_system_init fxc error"}};void getImageFromHisi( char *buf, int size){}HandleHisiDynamic hisimpp;HandleHisiDynamic::HandleHisiDynamic(QObject *parent) : QObject(parent){ errcode = 0;}HandleHisiDynamic::~HandleHisiDynamic(){ if( QFileInfo(HISI_DLL_FILE).exists()) ERROR_RETURN_NULL(-1); QLibrary lib( HISI_DLL_FILE ); if( lib.isLibrary(HISI_DLL_FILE)) ERROR_RETURN_NULL(-4); if( lib.isLoaded()) ERROR_RETURN_NULL(-5); FXCMpp_system_exit exit = (FXCMpp_system_exit)lib.resolve("HISystem_Stop"); INVALID_RETURN_NULL(exit, -2); exit();}int HandleHisiDynamic::dllInit(){ if( !QFileInfo(HISI_DLL_FILE).exists()) ERROR_RETURN(-1); QLibrary lib( HISI_DLL_FILE ); if( !lib.load()) ERROR_RETURN(-5); FXCMpp_system_init init = (FXCMpp_system_init)lib.resolve("HISystem_Start"); INVALID_RETURN(init, -8); int code = init(); if( code != 0 ) ERROR_RETURN(-2);// FXCMpp_jpegappend appendfxc = (FXCMpp_jpegappend)lib.resolve("Mpp_AppendJpeg"); // INVALID_RETURN(appendfxc, -6);// FXCMpp_RegisterDecodeResult reghandl = (FXCMpp_RegisterDecodeResult)lib.resolve("HISystem_RegisterImgMsg"); // INVALID_RETURN(reghandl, -7); // reghandl( getImageFromHisi ); return 0;}QString HandleHisiDynamic::errormsg(){ for( int i = 0; i < sizeof( ErrList )/ sizeof( ErrList[0]); i ) { if(errcode == ErrList[i].code ) return ErrList[i].errstr; } return ErrList[0].errstr;}#endif

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复