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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
#ifndef __MIAV_LIBDV_WRAPPER_H__
#define __MIAV_LIBDV_WRAPPER_H__
#include <libdv/dv.h>
#include <libdv/dv_types.h>
namespace DV {
typedef enum {
ColorBest = DV_QUALITY_COLOR | DV_QUALITY_AC_MASK | DV_QUALITY_AC_2,
ColorGood = DV_QUALITY_COLOR | DV_QUALITY_AC_MASK | DV_QUALITY_AC_1,
ColorBad = DV_QUALITY_COLOR | DV_QUALITY_AC_MASK | DV_QUALITY_DC,
MonocromeBest = DV_QUALITY_AC_MASK | DV_QUALITY_AC_2,
MonocromeGood = DV_QUALITY_AC_MASK | DV_QUALITY_AC_1,
MonocromeBad = DV_QUALITY_AC_MASK | DV_QUALITY_DC
} Quality;
typedef enum {
NTSC = e_dv_system_525_60,
PAL = e_dv_system_625_50
} System;
typedef enum {
YUV_411 = e_dv_sample_411,
YUV_420 = e_dv_sample_420,
YUV_422 = e_dv_sample_422
} Sampling;
typedef enum {
YUV = e_dv_color_yuv,
RGB = e_dv_color_rgb,
BGR0 = e_dv_color_bgr0
} ColorSpace;
};
class LibDVWrapper {
public:
LibDVWrapper(DV::Quality quality = DV::ColorBest,
DV::System system = DV::PAL,
DV::Sampling sampling = DV::YUV_422);
~LibDVWrapper();
void setQuality(DV::Quality quality);
void setSystem(DV::System system);
void setSampling(DV::Sampling sampling);
void setOutputBuffer(char *output, DV::ColorSpace colorspace = DV::YUV);
void decode(char *input);
private:
bool first;
int width, height;
int pitches[3];
unsigned char* yuv[3];
dv_decoder_t *decoder;
DV::ColorSpace colorspace;
};
#endif
|