0b4cd5d5
Hu Chunming
完成轨迹定时抓拍
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include<string>
#include "dvpp_headers.h"
using namespace std;
class DvppDataMemory : public DeviceMemory
{
public:
DvppDataMemory(int _channel, int _width, int _width_stride, int _height, int _height_stride, int _size, string _id, string _dev_id, bool _key_frame)
:DeviceMemory(_channel, _width, _width_stride, _height, _height_stride, _id, _dev_id, _key_frame, false){
data_size = _size;
int ret = acldvppMalloc((void **)&pHwRgb, data_size);
if(ret != ACL_ERROR_NONE){
cout << "acldvppMalloc failed" << endl;
}
}
DvppDataMemory( int _width, int _width_stride, int _height, int _height_stride, int _size, string _id, string _dev_id, bool _key_frame, unsigned char * pHwData)
:DeviceMemory(3, _width, _width_stride, _height, _height_stride, _id, _dev_id, _key_frame, false){
data_size = _size;
data_type = 1;
pHwRgb = pHwData;
}
~DvppDataMemory(){
if (pHwRgb) {
int ret = acldvppFree((uint8_t*)pHwRgb);
if(ret != ACL_ERROR_NONE){
cout << "acldvppFree failed" << endl;
}
pHwRgb = nullptr;
}
}
public:
int data_type; // 0: rgb , 1: NV12
};
|