[mmap] partial revert of 8cef8db4 to disable using mmap file reader
[videoplayer.git] / GLvideo_params.h
blob59f01e7ac2a799153dc7047db25325ae7e28bd5d
1 #ifndef __GLVIDEO_PARAMS_H
2 #define __GLVIDEO_PARAMS_H
4 #include <QtCore>
6 enum OSDmode {
7 OSD_NONE = 0,
8 OSD_FRAMENUM,
9 OSD_CAPTION,
10 OSD_MAX,
13 inline
14 OSDmode& operator++(OSDmode& l)
16 l = (OSDmode) ((l + 1) % OSD_MAX);
17 return l;
20 inline
21 std::istream& operator>>(std::istream& s, OSDmode& m)
23 s >> (unsigned int &)m;
24 return s;
27 struct GLvideo_params {
28 int frame_repeats;
30 bool osd_valid;
31 QString font_file;
32 QString caption;
33 float osd_scale;
34 OSDmode osd_bot;
35 bool osd_perf;
36 float osd_back_alpha;
37 float osd_text_alpha;
39 /* offset1 is the offset applied to src video
40 * offset1 result is multiplied by mul
41 * offset2 is then added */
42 bool matrix_valid;
43 int input_luma_range;
44 int input_luma_blacklevel;
45 int input_chroma_blacklevel;
46 int output_range;
47 int output_blacklevel;
48 float luminance_mul;
49 float chrominance_mul;
50 float luminance_offset2;
51 float chrominance_offset2;
53 /*optionally turn off luminance or chrominance channels*/
54 bool show_luma;
55 bool show_chroma;
57 /* what colour matrix */
58 float matrix_Kr;
59 float matrix_Kg;
60 float matrix_Kb;
62 /* @interlaced_source@ modifies behaviour when repeating
63 * frames (paused) and playing backwards (field reversal)
64 * @deinterlace@ causes a .5 .5 deinterlacer to be used */
65 bool interlaced_source;
66 bool deinterlace;
68 /* @aspect_ratio_lock@ forces the assumption that
69 * the video PAR is the same as the device PAR */
70 bool view_valid;
71 bool aspect_ratio_lock;
74 /* SetLumaCoeffsRec709
75 * Set Kr,Kg,Kb to have the luma coefficients defined in ITU-R Rec BT.709
76 * NB, these are *not* the colour primaries */
77 static inline void
78 SetLumaCoeffsRec709(GLvideo_params &p)
80 p.matrix_Kr = 0.2126;
81 p.matrix_Kg = 0.7152;
82 p.matrix_Kb = 0.0722;
85 /* SetLumaCoeffsRec601
86 * Set Kr,Kg,Kb to have the luma coefficients defined in ITU-R Rec BT.601
87 * NB, these are *not* the colour primaries */
88 static inline void
89 SetLumaCoeffsRec601(GLvideo_params &p)
91 p.matrix_Kr = 0.299;
92 p.matrix_Kg = 0.587;
93 p.matrix_Kb = 0.114;
95 #endif