-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyuv420p.h
53 lines (42 loc) · 795 Bytes
/
yuv420p.h
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
#ifndef YUV420P_H
#define YUV420P_H
#include <string>
struct Plane
{
int width;
int height;
std::string data;
Plane() : data()
{
width = 0;
height = 0;
}
~Plane() {}
int Build(const unsigned char* data, int width, int height, int stride)
{
this->width = width;
this->height = height;
for (int j = 0; j < this->height; ++j)
{
this->data.append((const char*) (data + j * stride), this->width);
}
return 0;
}
};
struct Yuv420p
{
int flv_tag_idx;
unsigned int pts;
Plane y;
Plane u;
Plane v;
bool end;
Yuv420p() : y(), u(), v()
{
flv_tag_idx = 0;
pts = 0;
end = false;
}
~Yuv420p() {}
};
#endif // YUV420P_H