DvppDataMemory.hpp
1.27 KB
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, unsigned long long frame_nb)
:DeviceMemory(_channel, _width, _width_stride, _height, _height_stride, _id, _dev_id, _key_frame, frame_nb, 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 long long frame_nb, unsigned char * pHwData)
:DeviceMemory(-1, _width, _width_stride, _height, _height_stride, _id, _dev_id, _key_frame, frame_nb, false){
data_size = _size;
data_type = 1;
pHwRgb = pHwData;
}
~DvppDataMemory(){
if (pHwRgb) {
int ret = acldvppFree(pHwRgb);
if(ret != ACL_ERROR_NONE){
cout << "acldvppFree failed" << endl;
}
pHwRgb = nullptr;
}
}
public:
int data_type; // 0: rgb , 1: NV12
};