Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #ifndef GENAPI_CHUNKADAPTERDCAM_H
00031 #define GENAPI_CHUNKADAPTERDCAM_H
00032
00033 #include <Base/GCTypes.h>
00034 #include <GenApi/ChunkAdapter.h>
00035 #include <GenApi/Compatibility.h>
00036
00037 namespace GENAPI_NAMESPACE
00038 {
00039
00040 void GENAPI_DECL SET_GUID(GUID& name, uint32_t l, uint16_t w1, uint16_t w2, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7, uint8_t b8);
00041
00042
00043
00044 # pragma pack(push, 1)
00045
00046 typedef struct DCAM_CHUNK_TRAILER
00047 {
00048 GUID ChunkID ;
00049 uint32_t ChunkLength ;
00050 uint32_t InverseChunkLength ;
00051 } DCAM_CHUNK_TRAILER;
00052
00053 typedef struct DCAM_CHECKSUM
00054 {
00055 uint32_t CRCChecksum ;
00056 } DCAM_CHECKSUM;
00057
00058
00059 # pragma pack(pop)
00060
00061
00063 class GENAPI_DECL CChunkAdapterDcam : public CChunkAdapter
00064 {
00065
00066 public:
00068 CChunkAdapterDcam(INodeMap* pNodeMap = NULL, int64_t MaxChunkCacheSize = -1);
00069
00071 virtual ~CChunkAdapterDcam();
00072
00074 virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength);
00075
00077 virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics = NULL);
00078
00080 bool HasCRC(uint8_t *pBuffer, int64_t BufferLength);
00081
00083 bool CheckCRC(uint8_t *pBuffer, int64_t BufferLength);
00084
00085 protected:
00087 uint32_t CRC16(const unsigned char *pData, uint32_t nbyLength );
00088
00090 bool CheckBuffer(const unsigned char* pData, uint32_t nbyLength );
00091
00092 };
00093
00094 }
00095
00096 #endif // GENAPI_CHUNKADAPTERDCAM_H