blob: fb7f6f3694c72457aec769a2154c4ffbd04b842d (
plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
#include "frame.h"
#include "info.h"
#include <memory.h>
#include <stdlib.h>
Frame::Frame(char *vframe, int vframesize, video_format_t vformat,
char *aframe, int aframesize, audio_format_t aformat)
{
this->vframe = vframe;
this->vframesize = vframesize;
this->vformat = vformat;
this->aframe = aframe;
this->aframesize = aframesize;
this->aformat = aformat;
timecode.hour = 0;
timecode.min = 0;
timecode.sec = 0;
timecode.frame = 0;
freeze = false;
snapshot = false;
data = NULL;
}
Frame::Frame(unsigned char *d, int sz)
{
MIaV::info->error("Allocated a frame in the old way!");
if(sz) data = new unsigned char[sz];
if(sz && d) memcpy(data, d, sz);
if(sz == 0 && d) data = d;
size = sz;
number = 0;
memset(timestamp, 0, sizeof(timestamp));
endOfFrameStream = false;
usage = 0;
}
Frame::~Frame()
{
if(data) delete data;
data = NULL;
size = 0;
}
|