#ifndef __MV_DEVICE_BASE_H__ #define __MV_DEVICE_BASE_H__ #include "MvInclude.h" namespace MvCamCtrl { interface IMvDevice { // ´ò¿ªÉ豸 virtual int Open(unsigned int nAccessMode = MV_ACCESS_Exclusive, unsigned short nSwitchoverKey = 0) = 0; // ¹Ø±ÕÉ豸 virtual int Close() = 0; // ÅжÏÉ豸µÄ״̬£¬½öµ±·µ»Øfalseʱ£¬¿É´ò¿ªÉ豸 virtual bool IsOpen() = 0; // ¿ªÆôץͼ virtual int StartGrabbing() = 0; // ֹͣץͼ virtual int StopGrabbing() = 0; // »ñÈ¡É豸ÐÅÏ¢ virtual int GetDeviceInfo(MV_CC_DEVICE_INFO&) = 0; /** @fn GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen) * @brief »ñÈ¡É豸µÄXMLÎļþ * @param pData [IN][OUT] - ´ý¿½ÈëµÄ»º´æµØÖ· nDataSize [IN] - »º´æ´óС pnDataLen [OUT] - xml ÎļþÊý¾Ý³¤¶È * * @return ³É¹¦£¬·µ»ØMV_OK£»Ê§°Ü£¬·µ»Ø´íÎóÂë * @note µ±pDataΪNULL»ònDataSize±Èʵ¼ÊµÄxmlÎļþСʱ£¬²»¿½±´Êý¾Ý£¬ÓÉpnDataLen·µ»ØxmlÎļþ´óС£» * µ±pDataΪÓÐЧ»º´æµØÖ·£¬ÇÒ»º´æ×ã¹»´óʱ£¬¿½±´ÍêÕûÊý¾Ý£¬²¢ÓÉpnDataLen·µ»ØxmlÎļþ´óС¡£ */ virtual int GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen) = 0; /** @fn GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo) * @brief »ñȡһ֡ͼÏñÊý¾Ý * @param pData [IN][OUT] - Êý¾ÝÖ¸Õë nDataLen [IN] - Êý¾Ý³¤¶È pFrameInfo [OUT] - Êä³öµÄÖ¡ÐÅÏ¢ * * @return ³É¹¦£¬·µ»ØMV_OK£»Ê§°Ü£¬·µ»Ø´íÎóÂë */ virtual int GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo) = 0; // »ñÈ¡GenICamʹÓõĴ«Êä²ã´úÀíÀà virtual TlProxy GetTlProxy() = 0; virtual ~IMvDevice( void ){}; }; interface IDeviceFactory { // ö¾Ù×ÓÍøÄÚ£¬Ö¸¶¨µÄ´«ÊäЭÒé¶ÔÓ¦µÄËùÓÐÉ豸 virtual int EnumDevices( unsigned int nTLayerType , MV_CC_DEVICE_INFO_LIST& stDevList ) = 0; // ´´½¨É豸´úÀíÀà virtual IMvDevice* CreateDevice( const MV_CC_DEVICE_INFO& device ) = 0; // Ïú»ÙÖ¸¶¨É豸µÄÄÚ²¿×ÊÔ´ virtual int DestroyDevice( IMvDevice* ) = 0; // ÅжÏÖ¸¶¨µÄÉ豸ÊÇ·ñ¿ÉÒÔ·ÃÎÊ virtual bool IsDeviceAccessible( const MV_CC_DEVICE_INFO& deviceInfo) = 0; }; } #endif /* __MV_DEVICE_BASE_H__ */