UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
dvs.c
Go to the documentation of this file.
1/*
2 * FILE: video_display/dvs.c
3 * AUTHORS: Martin Benes <martinbenesh@gmail.com>
4 * Lukas Hejtmanek <xhejtman@ics.muni.cz>
5 * Petr Holub <hopet@ics.muni.cz>
6 * Milos Liska <xliska@fi.muni.cz>
7 * Jiri Matela <matela@ics.muni.cz>
8 * Dalibor Matura <255899@mail.muni.cz>
9 * Ian Wesley-Smith <iwsmith@cct.lsu.edu>
10 * Colin Perkins <csp@isi.edu>
11 *
12 * Copyright (c) 2005-2023 CESNET z.s.p.o.
13 * Copyright (c) 2001-2003 University of Southern California
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, is permitted provided that the following conditions
17 * are met:
18 *
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 *
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * 3. All advertising materials mentioning features or use of this software
27 * must display the following acknowledgement:
28 *
29 * This product includes software developed by the University of Southern
30 * California Information Sciences Institute. This product also includes
31 * software developed by CESNET z.s.p.o.
32 *
33 * 4. Neither the name of the University, Institute, CESNET nor the names of
34 * its contributors may be used to endorse or promote products derived from
35 * this software without specific prior written permission.
36 *
37 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
38 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
39 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
41 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
42 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
43 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
44 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
46 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
47 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
48 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 *
50 */
51
52#include "config.h"
53#include "config_unix.h"
54#include "config_win32.h"
55#include "host.h"
56
57#include "audio/types.h"
58#include "debug.h"
59#include "lib_common.h"
60#include "video.h"
61#include "video_display.h"
62#include "video_display/dvs.h"
63#include "tv.h"
64#include "utils/ring_buffer.h"
65
66#include "dvs_clib.h" /* From the DVS SDK */
67#include "dvs_fifo.h" /* From the DVS SDK */
68
69#define HDSP_MAGIC 0x12345678
70
72 {SV_MODE_PAL, 720, 576, 25.0, AUX_INTERLACED}, /* pal 720x576 25.00hz Interlaced */
73 {SV_MODE_NTSC, 720, 486, 29.97, AUX_INTERLACED}, /* ntsc 720x486 29.97hz Interlaced */
74 {SV_MODE_PALHR, 960, 576, 25.50, AUX_INTERLACED}, /* pal 960x576 25.00hz Interlaced */
75 {SV_MODE_NTSCHR, 960, 486, 29.97, AUX_INTERLACED}, /* ntsc 960x486 29.97hz Interlaced */
76 {SV_MODE_PALFF, 720, 592, 25.00, AUX_INTERLACED}, /* pal 720x592 25.00hz Interlaced */
77 {SV_MODE_NTSCFF, 720, 502, 29.97, AUX_INTERLACED}, /* ntsc 720x502 29.97hz Interlaced */
78 {SV_MODE_PAL608, 720, 608, 25.00, AUX_INTERLACED}, /* pal608 720x608 25.00hz Interlaced */
79 {SV_MODE_HD360, 960, 504, 29.97, AUX_INTERLACED}, /* HD360 960x504 29.97hz Compressed HDTV */
80 {SV_MODE_SMPTE293_59P, 720, 483, 59.94, AUX_PROGRESSIVE}, /* SMPTE293/59P 720x483 59.94hz Progressive */
81 {SV_MODE_PAL_24I, 720, 576, 24.0, AUX_INTERLACED}, /* SLOWPAL 720x576 24.00hz Interlaced */
82 //#define SV_MODE_TEST /* Test Raster */
83 {SV_MODE_VESASDI_1024x768_60P, 1024, 768, 60, AUX_PROGRESSIVE},
84 {SV_MODE_PAL_25P, 720, 576, 25, AUX_PROGRESSIVE}, /* pal 25Hz (1:1) */
85 {SV_MODE_PAL_50P, 720, 576, 50, AUX_PROGRESSIVE}, /* pal 50Hz (1:1) */
86 {SV_MODE_PAL_100P, 720, 576, 100, AUX_PROGRESSIVE}, /* pal 100Hz (1:1) */
87 {SV_MODE_NTSC_29P, 720, 576, 29.97, AUX_PROGRESSIVE}, /* ntsc 29.97Hz (1:1) */
88 {SV_MODE_NTSC_59P, 720, 576, 59.94, AUX_PROGRESSIVE}, /* ntsc 59.94Hz (1:1) */
89 {SV_MODE_NTSC_119P, 720, 486, 119.88, AUX_PROGRESSIVE}, /* ntsc 119.88Hz (1:1) */
90 {SV_MODE_SMPTE274_25sF, 1920, 1080, 25.0, AUX_SF}, /* 1920x1080 25.00hz Segmented Frame */
91 {SV_MODE_SMPTE274_29sF, 1920, 1080, 29.97, AUX_SF}, /* 1920x1080 29.97hz Segmented Frame */
92 {SV_MODE_SMPTE274_30sF, 1920, 1080, 30.00, AUX_SF}, /* 1920x1080 30.00hz Segmented Frame */
93 //#define SV_MODE_EUREKA
94 {SV_MODE_SMPTE240_30I, 1920, 1035, 30.0, AUX_INTERLACED}, /* 1920x1035 30.00hz Interlaced */
95 {SV_MODE_SMPTE274_30I, 1920, 1080, 30.0, AUX_INTERLACED}, /* 1920x1080 30.00hz Interlaced */
96 {SV_MODE_SMPTE296_60P, 1280, 720, 60.0, AUX_PROGRESSIVE}, /* 1280x720 60.00hz Progressive */
97 {SV_MODE_SMPTE240_29I, 1920, 1035, 29.97, AUX_INTERLACED}, /* 1920x1035 29.97hz Interlaced */
98 {SV_MODE_SMPTE274_29I, 1920, 1080, 29.97, AUX_INTERLACED}, /* 1920x1080 29.97hz Interlaced */
99 {SV_MODE_SMPTE296_59P, 1280, 720, 59.94, AUX_PROGRESSIVE}, /* 1280x720 59.94hz Progressive */
100 {SV_MODE_SMPTE295_25I, 1920, 1080, 25.0, AUX_INTERLACED}, /* 1920x1080 1250/25Hz Interlaced */
101 {SV_MODE_SMPTE274_25I, 1920, 1080, 25.0, AUX_INTERLACED}, /* 1920x1080 25.00hz Interlaced */
102 {SV_MODE_SMPTE274_24sF, 1920, 1080, 24.0, AUX_SF}, /* 1920x1080 24.00hz Segmented Frame */
103 {SV_MODE_SMPTE274_23sF, 1920, 1080, 23.98, AUX_SF}, /* 1920x1080 23.98hz Segmented Frame */
104 {SV_MODE_SMPTE274_24P, 1920, 1080, 24.0, AUX_SF}, /* 1920x1080 24.00hz Progressive */
105 {SV_MODE_SMPTE274_23P, 1920, 1080, 23.98, AUX_PROGRESSIVE}, /* 1920x1080 23.98hz Progressive */
106 {SV_MODE_SMPTE274_25P, 1920, 1080, 25.00, AUX_PROGRESSIVE}, /* 1920x1080 25.00hz Progressive */
107 {SV_MODE_SMPTE274_29P, 1920, 1080, 29.97, AUX_PROGRESSIVE}, /* 1920x1080 29.97hz Progressive */
108 {SV_MODE_SMPTE274_30P, 1920, 1080, 30.00, AUX_PROGRESSIVE}, /* 1920x1080 30.00hz Progressive */
109
110 {SV_MODE_SMPTE296_72P, 1280, 720, 72.00, AUX_PROGRESSIVE}, /* 1280x720 72.00hz Progressive */
111 {SV_MODE_SMPTE296_71P, 1280, 720, 71.93, AUX_PROGRESSIVE}, /* 1280x720 71.93hz Progressive */
112 {SV_MODE_SMPTE296_72P_89MHZ, 1280, 720, 72.00, AUX_PROGRESSIVE}, /* 1280x720 72.00hz Progressive Analog 89 Mhz */
113 {SV_MODE_SMPTE296_71P_89MHZ, 1280, 720, 71.93, AUX_PROGRESSIVE}, /* 1280x720 71.93hz Progressive Analog 89 Mhz */
114
115 {SV_MODE_SMPTE274_23I, 1920, 1080, 23.98, AUX_INTERLACED}, /* 1920x1080 23.98hz Interlaced */
116 {SV_MODE_SMPTE274_24I, 1920, 1080, 24.00, AUX_INTERLACED}, /* 1920x1080 24.00hz Interlaced */
117
118 {SV_MODE_SMPTE274_47P, 1920, 1080, 47.95, AUX_PROGRESSIVE}, /* 1920x1080 47.95hz Progressive */
119 {SV_MODE_SMPTE274_48P, 1920, 1080, 48.00, AUX_PROGRESSIVE}, /* 1920x1080 48.00hz Progressive */
120 {SV_MODE_SMPTE274_59P, 1920, 1080, 59.94, AUX_PROGRESSIVE}, /* 1920x1080 59.94hz Progressive */
121 {SV_MODE_SMPTE274_60P, 1920, 1080, 60.00, AUX_PROGRESSIVE}, /* 1920x1080 60.00hz Progressive */
122 {SV_MODE_SMPTE274_71P, 1920, 1080, 71.93, AUX_PROGRESSIVE}, /* 1920x1080 71.93hz Progressive */
123 {SV_MODE_SMPTE274_72P, 1920, 1080, 72.00, AUX_PROGRESSIVE}, /* 1920x1080 72.00hz Progressive */
124
125 //{SV_MODE_SMPTE274_2560_24P
126 //{SV_MODE_SMPTE274_2560_23P ( | SV_MODE_FLAG_DROPFRAME)
127 //{SV_MODE_SMPTE296_24P_30MHZ, 1280, 720, 30, AUX_PROGRESSIVE},
128 {SV_MODE_SMPTE296_24P, 1280, 720, 24, AUX_PROGRESSIVE},
129 {SV_MODE_SMPTE296_23P, 1280, 720, 23.98, AUX_PROGRESSIVE},
130
131 {SV_MODE_FILM2K_1556_12P, 2048, 1556, 12.0, AUX_PROGRESSIVE},
132 {SV_MODE_FILM2K_1556_6P, 2048, 1556, 6.0, AUX_PROGRESSIVE},
133 {SV_MODE_FILM2K_1556_3P, 2048, 1556, 3.0, AUX_PROGRESSIVE},
134
135 {SV_MODE_FILM2K_2048x1536_24P, 2048, 1536, 24.0, 0}, /* Telecine formats with 4:3 aspect ratio */
136 {SV_MODE_FILM2K_2048x1536_24sF, 2048, 1536, 24.0, AUX_SF},
137 {SV_MODE_FILM2K_2048x1536_48P, 2048, 1536, 48.0, AUX_PROGRESSIVE},
138
139 {SV_MODE_FILM2K_2048x1556_24P, 2048, 1556, 24.0, AUX_PROGRESSIVE},
140 {SV_MODE_FILM2K_2048x1556_23P, 2048, 1556, 23.98, AUX_PROGRESSIVE},
141 {SV_MODE_FILM2K_2048x1556_24sF, 2048, 1556, 24.0, AUX_SF},
142 {SV_MODE_FILM2K_2048x1556_23sF, 2048, 1556, 23.98, AUX_SF},
143 {SV_MODE_FILM2K_2048x1556_48P, 2048, 1556, 48.0, AUX_PROGRESSIVE},
144
145 /*{SV_MODE_SGI_12824_NTSC 0x4f
146 {SV_MODE_SGI_12824_59P 0x50
147 {SV_MODE_SGI_12848_29I 0x51*/
148
149 {SV_MODE_FILM2K_2048x1556_14sF, 2048, 1556, 14.0, AUX_SF},
150 {SV_MODE_FILM2K_2048x1556_15sF, 2048, 1556, 15.0, AUX_SF},
151
152 {SV_MODE_VESA_1024x768_30I, 1024, 768, 30.0, AUX_INTERLACED},
153 {SV_MODE_VESA_1024x768_29I, 1024, 768, 29.97, AUX_INTERLACED},
154 {SV_MODE_VESA_1280x1024_30I, 1280, 1024, 30.0, AUX_INTERLACED},
155 {SV_MODE_VESA_1280x1024_29I, 1280, 1024, 29.97, AUX_INTERLACED},
156 {SV_MODE_VESA_1600x1200_30I, 1600, 1200, 30.0, AUX_INTERLACED},
157 {SV_MODE_VESA_1600x1200_29I, 1600, 1200, 29.97, AUX_INTERLACED},
158
159 {SV_MODE_VESA_640x480_60P, 640, 480, 60.0, AUX_PROGRESSIVE},
160 {SV_MODE_VESA_640x480_59P, 640, 480, 59.94, AUX_PROGRESSIVE},
161 {SV_MODE_VESA_800x600_60P, 800, 600, 60.0, AUX_PROGRESSIVE},
162 {SV_MODE_VESA_800x600_59P, 800, 600, 59.94, AUX_PROGRESSIVE},
163 {SV_MODE_VESA_1024x768_60P, 1024, 768, 60.0, AUX_PROGRESSIVE},
164 {SV_MODE_VESA_1024x768_59P, 1024, 768, 59.94, AUX_PROGRESSIVE},
165 {SV_MODE_VESA_1280x1024_60P, 1280, 1024, 60.0, AUX_PROGRESSIVE},
166 {SV_MODE_VESA_1280x1024_59P, 1280, 1024, 59.94, AUX_PROGRESSIVE},
167 {SV_MODE_VESA_1600x1200_60P, 1600, 1200, 60.0, AUX_PROGRESSIVE},
168 {SV_MODE_VESA_1600x1200_59P, 1600, 1200, 59.94, AUX_PROGRESSIVE},
169
170 {SV_MODE_VESA_640x480_72P, 640, 480, 72.0, AUX_PROGRESSIVE},
171 {SV_MODE_VESA_640x480_71P, 640, 480, 71.93, AUX_PROGRESSIVE},
172 {SV_MODE_VESA_800x600_72P, 800, 600, 72.0, AUX_PROGRESSIVE},
173 {SV_MODE_VESA_800x600_71P, 800, 600, 71.93, AUX_PROGRESSIVE},
174 {SV_MODE_VESA_1024x768_72P, 1024, 768, 72.0, AUX_PROGRESSIVE},
175 {SV_MODE_VESA_1024x768_71P, 1024, 768, 71.93, AUX_PROGRESSIVE},
176 {SV_MODE_VESA_1280x1024_72P, 1280, 1024, 72.0, AUX_PROGRESSIVE},
177 {SV_MODE_VESA_1280x1024_71P, 1280, 1024, 71.93, AUX_PROGRESSIVE},
178 {SV_MODE_VESA_1600x1200_72P, 1600, 1200, 72.0, AUX_PROGRESSIVE},
179 {SV_MODE_VESA_1600x1200_71P, 1600, 1200, 71.93, AUX_PROGRESSIVE},
180
181 {SV_MODE_SMPTE296_25P, 1280, 720, 25.0, AUX_PROGRESSIVE},
182 {SV_MODE_SMPTE296_29P, 1280, 720, 29.97, AUX_PROGRESSIVE},
183 {SV_MODE_SMPTE296_30P, 1280, 720, 30.0, AUX_PROGRESSIVE},
184 {SV_MODE_SMPTE296_50P, 1280, 720, 50.0, AUX_PROGRESSIVE},
185
186 {SV_MODE_FILM2K_2048x1556_29sF, 2048, 1556, 29.97, AUX_SF},
187 {SV_MODE_FILM2K_2048x1556_30sF, 2048, 1556, 30.0, AUX_SF},
188 {SV_MODE_FILM2K_2048x1556_36sF, 2048, 1556, 36.0, AUX_SF},
189
190 {SV_MODE_FILM2K_2048x1080_23sF, 2048, 1080, 23.98, AUX_SF},
191 {SV_MODE_FILM2K_2048x1080_24sF, 2048, 1080, 24.0, AUX_SF},
192 {SV_MODE_FILM2K_2048x1080_23P, 2048, 1080, 23.98, AUX_PROGRESSIVE},
193 {SV_MODE_FILM2K_2048x1080_24P, 2048, 1080, 24.0, AUX_PROGRESSIVE},
194
195 {SV_MODE_FILM2K_2048x1556_19sF, 2048, 1556, 19, AUX_SF},
196 {SV_MODE_FILM2K_2048x1556_20sF, 2048, 1556, 20.0, AUX_SF},
197
198 {SV_MODE_1980x1152_25I, 1980, 1152, 25.0, AUX_INTERLACED},
199
200 {SV_MODE_SMPTE274_50P, 1920, 1080, 50.0, AUX_PROGRESSIVE},
201
202 {SV_MODE_FILM4K_4096x2160_24sF, 4096, 2160, 24.0, AUX_SF},
203 {SV_MODE_FILM4K_4096x2160_24P, 4096, 2160, 24.0, AUX_PROGRESSIVE},
204
205 {SV_MODE_3840x2400_24sF, 3840, 240, 24.0, AUX_SF},
206 {SV_MODE_3840x2400_24P, 3840, 2400, 24.0, AUX_PROGRESSIVE},
207
208 {SV_MODE_FILM4K_3112_24sF, 4096, 3112, 24.0, AUX_SF},
209 {SV_MODE_FILM4K_3112_24P, 4096, 3112, 24.0, AUX_PROGRESSIVE},
210
211 {SV_MODE_FILM4K_3112_5sF, 4096, 3112, 5, AUX_SF},
212
213 {SV_MODE_3840x2400_12P, 3840, 2440, 12, AUX_PROGRESSIVE},
214 {SV_MODE_ARRI_1920x1080_47P, 1920, 1080, 47.95, AUX_PROGRESSIVE},
215 {SV_MODE_ARRI_1920x1080_48P, 1920, 1080, 48.0, AUX_PROGRESSIVE},
216 {SV_MODE_ARRI_1920x1080_50P, 1920, 1080, 50, AUX_PROGRESSIVE},
217 {SV_MODE_ARRI_1920x1080_59P, 1920, 1080, 59.94, AUX_PROGRESSIVE},
218 {SV_MODE_ARRI_1920x1080_60P, 1920, 1080, 60.0, AUX_PROGRESSIVE},
219
220 {SV_MODE_SMPTE296_100P, 1280, 720, 100.0, AUX_PROGRESSIVE},
221 {SV_MODE_SMPTE296_119P, 1280, 720, 119.88, AUX_PROGRESSIVE},
222 {SV_MODE_SMPTE296_120P, 1280, 720, 120.0, AUX_PROGRESSIVE},
223
224 {SV_MODE_1920x1200_24P, 1920, 1200, 24.0, AUX_PROGRESSIVE},
225 {SV_MODE_1920x1200_60P, 1920, 1200, 60.0, AUX_PROGRESSIVE},
226
227 {SV_MODE_WXGA_1366x768_50P, 1366, 768, 50.0, AUX_PROGRESSIVE},
228 {SV_MODE_WXGA_1366x768_59P, 1360, 768, 59.94, AUX_PROGRESSIVE},
229 {SV_MODE_WXGA_1366x768_60P, 1366, 768, 60.0, AUX_PROGRESSIVE},
230 {SV_MODE_WXGA_1366x768_90P, 1366, 768, 90.0, AUX_PROGRESSIVE},
231 {SV_MODE_WXGA_1366x768_120P, 1366, 768, 120.0, AUX_PROGRESSIVE},
232
233 {SV_MODE_1400x1050_60P, 1440, 1050, 60.0, AUX_PROGRESSIVE},
234
235 {SV_MODE_FILM2K_2048x858_23sF, 2048, 858, 23.98, AUX_SF},
236 {SV_MODE_FILM2K_2048x858_24sF, 2048, 858, 24.0, AUX_SF},
237 {SV_MODE_FILM2K_1998x1080_23sF, 1998, 1080, 23.98, AUX_SF},
238 {SV_MODE_FILM2K_1998x1080_24sF, 1998, 1080, 24.0, AUX_SF},
239
240 {SV_MODE_ANALOG_1920x1080_47P, 1920, 1080, 47.95, AUX_PROGRESSIVE},
241 {SV_MODE_ANALOG_1920x1080_48P, 1920, 1080, 48.0, AUX_PROGRESSIVE},
242 {SV_MODE_ANALOG_1920x1080_50P, 1920, 1080, 50.0, AUX_PROGRESSIVE},
243 {SV_MODE_ANALOG_1920x1080_59P, 1920, 1080, 59.94 , AUX_PROGRESSIVE},
244 {SV_MODE_ANALOG_1920x1080_60P, 1920, 1080, 60.0, AUX_PROGRESSIVE},
245
246 {SV_MODE_QUADDVI_3840x2160_48P, 3840, 2160, 48.0, AUX_PROGRESSIVE},
247 {SV_MODE_QUADDVI_3840x2160_48Pf2, 3840, 2160, 48.0, 0}, /* wtf is Pf2 ?? */
248 {SV_MODE_QUADDVI_3840x2160_60P, 3840, 2160, 60.0, AUX_PROGRESSIVE},
249 {SV_MODE_QUADDVI_3840x2160_60Pf2, 3840, 2160, 60.0, AUX_SF},
250
251 {SV_MODE_QUADSDI_3840x2160_23P, 3840, 2160, 23.98, AUX_PROGRESSIVE},
252 {SV_MODE_QUADSDI_3840x2160_24P, 3840, 2160, 24.0, AUX_PROGRESSIVE},
253 {SV_MODE_QUADSDI_4096x2160_23P, 3840, 2160, 23.98, AUX_PROGRESSIVE},
254 {SV_MODE_QUADSDI_4096x2160_24P, 3840, 2160, 24.0, AUX_PROGRESSIVE},
255
256 {SV_MODE_FILM2K_2048x1080_25P, 2048, 1080, 25.0, AUX_PROGRESSIVE},
257
258 {SV_MODE_FILM2K_2048x1744_24P, 2048, 1774, 24.0, AUX_PROGRESSIVE},
259 {SV_MODE_FILM2K_2048x1080_47P, 2048, 1080, 47.95, AUX_PROGRESSIVE},
260 {SV_MODE_FILM2K_2048x1080_48P, 2048, 1080, 48.0, AUX_PROGRESSIVE},
261
262 {SV_MODE_FILM2K_2048x1080_25sF, 2048, 1080, 25.0, AUX_SF},
263
264 {SV_MODE_FILM2K_2048x1080_29P, 2048, 1080, 29.97 , AUX_PROGRESSIVE},
265 {SV_MODE_FILM2K_2048x1080_30P , 2048, 1080, 30.0, AUX_PROGRESSIVE},
266 {SV_MODE_FILM2K_2048x1080_50P , 2048, 1080, 50.0, AUX_PROGRESSIVE},
267 {SV_MODE_FILM2K_2048x1080_59P, 2048, 1080, 59.94, AUX_PROGRESSIVE},
268 {SV_MODE_FILM2K_2048x1080_60P, 2048, 1080, 60.0, AUX_PROGRESSIVE},
269
270 {SV_MODE_FILM2K_2048x858_23P, 2048, 858, 23.98, AUX_PROGRESSIVE},
271 {SV_MODE_FILM2K_2048x858_24P, 2048, 858, 24.0, AUX_PROGRESSIVE},
272 {SV_MODE_FILM2K_1998x1080_23P, 1998, 1080, 23.98, AUX_PROGRESSIVE},
273 {SV_MODE_FILM2K_1998x1080_24P, 1998, 1080, 24.0, AUX_PROGRESSIVE},
274
275 {SV_MODE_ANALOG_2048x1080_50P, 2048, 1080, 50.0, AUX_PROGRESSIVE},
276 {SV_MODE_ANALOG_2048x1080_59P, 2048, 1080, 59.94, AUX_PROGRESSIVE},
277 {SV_MODE_ANALOG_2048x1080_60P, 2048, 1080, 60.0, AUX_PROGRESSIVE},
278
279 {SV_MODE_QUADSDI_3840x2400_23P, 3840, 2400, 23.98, AUX_PROGRESSIVE},
280 {SV_MODE_QUADSDI_3840x2400_24P, 3840, 2400, 24.0, AUX_PROGRESSIVE},
281 {SV_MODE_QUADDVI_3840x2160_30P, 3840, 1260, 30.0, AUX_PROGRESSIVE},
282 {SV_MODE_QUADDVI_3840x2400_24P, 3840, 2400, 24.0, AUX_PROGRESSIVE},
283
284 {SV_MODE_FILM2K_2048x1772_24P, 2048, 1772, 24.0, AUX_PROGRESSIVE},
285
286 {0, 0, 0, 0, 0},
287};
288
290 pthread_t thread_id;
291 sv_handle *sv;
292 sv_fifo *fifo;
293 sv_fifo_buffer *fifo_buffer;
294 sv_fifo_buffer *display_buffer;
295 sv_fifo_buffer *tmp_buffer;
296 pthread_mutex_t lock;
297 pthread_cond_t boss_cv;
298 pthread_cond_t worker_cv;
299volatile int work_to_do;
300volatile int boss_waiting;
301volatile int worker_waiting;
302 uint32_t magic;
303 char *bufs[2];
306 struct tile *tile;
308 unsigned first_run:1;
309 unsigned play_audio:1;
310
311 pthread_mutex_t audio_reconf_lock;
313 pthread_cond_t audio_reconf_done_cv;
316 volatile int audio_reconf_done;
317
319 char *audio_fifo_data; /* temporary memory for the data that gets immediatelly
320 decoded */
322
323 unsigned int mode_set_manually:1;
324
326 struct timeval t, t0;
327
328 pthread_t thread_id;
330};
331
332static void show_help(void);
333
334static void show_help(void)
335{
336 int i;
337 sv_handle *sv;
338 int res;
339 char name[128];
340 int card_idx = 0;
341
342 printf("DVS options:\n\n");
343 printf("\t -d dvs[:<mode>:<codec>][:<card>] | help\n\n");
344 printf("\t eg. '-d dvs' or '-d dvs:PCI,card:0'");
345 printf("\t(the mode needn't to be set and you shouldn't to want set it)\n\n");
346 snprintf(name, 128, "PCI,card:%d", card_idx);
347
348 res = sv_openex(&sv, name, SV_OPENPROGRAM_DEFAULT, SV_OPENTYPE_DEFAULT, 0, 0);
349 if (res != SV_OK) {
350 printf
351 ("Unable to open grabber: sv_open() failed (no card present or driver not loaded?)\n");
352 printf("Error %s\n", sv_geterrortext(res));
353 return;
354 }
355 while (res == SV_OK) {
356 printf("\tCard %s - supported modes:\n\n", name);
357 for(i=0; hdsp_mode_table[i].width !=0; i++) {
358 int res;
359 sv_query(sv, SV_QUERY_MODE_AVAILABLE, hdsp_mode_table[i].mode, & res);
360 if(res) {
361 const char *interlacing;
362 if(hdsp_mode_table[i].aux & AUX_INTERLACED) {
363 interlacing = "interlaced";
364 } else if(hdsp_mode_table[i].aux & AUX_PROGRESSIVE) {
365 interlacing = "progressive";
366 } else if(hdsp_mode_table[i].aux & AUX_SF) {
367 interlacing = "progressive segmented";
368 } else {
369 interlacing = "unknown (!)";
370 }
371 printf ("\t%4d: %4d x %4d @ %2.2f %s\n", hdsp_mode_table[i].mode,
372 hdsp_mode_table[i].width, hdsp_mode_table[i].height,
373 hdsp_mode_table[i].fps, interlacing);
374 }
375 }
376 sv_close(sv);
377 card_idx++;
378 snprintf(name, 128, "PCI,card:%d", card_idx);
379 res = sv_openex(&sv, name, SV_OPENPROGRAM_DEFAULT, SV_OPENTYPE_DEFAULT, 0, 0);
380 printf("\n");
381 }
382 printf("\n");
383}
384
385static void *display_dvs_run(void *arg)
386{
387 struct state_hdsp *s = (struct state_hdsp *)arg;
388 int res;
389
390 while (1) {
391 pthread_mutex_lock(&s->lock);
392
393 while (s->work_to_do == FALSE) {
394 s->worker_waiting = TRUE;
395 pthread_cond_wait(&s->worker_cv, &s->lock);
397 }
398
400 s->work_to_do = FALSE;
401
402 if (s->boss_waiting) {
403 pthread_cond_signal(&s->boss_cv);
404 }
405
406 if(s->should_exit) {
407 pthread_mutex_unlock(&s->lock);
408 break;
409 }
410 pthread_mutex_unlock(&s->lock);
411
412 /* audio - copy appropriate amount of data from ring buffer */
413 if(s->play_audio) {
414 int read_b;
417 if(read_b != s->audio_fifo_required_size) {
418 fprintf(stderr, "[dvs] Audio buffer underflow\n");
419 }
420 }
421 res =
422 sv_fifo_putbuffer(s->sv, s->fifo, s->display_buffer, NULL);
423 if (res != SV_OK) {
424 fprintf(stderr, "Error %s\n", sv_geterrortext(res));
425 /* Here is probably bug in recent DVS SDK (4.2.1.1) that triggers
426 * this error multiple times after device reconfiguration. After few
427 * frames it disappears.
428 * TODO: If ther is no longer the error, remove this comment and exit here.
429 */
430 }
431
432 gettimeofday(&s->t, NULL);
433 double seconds = tv_diff(s->t, s->t0);
434
435 s->frames++;
436
437 if (seconds >= 5) {
438 float fps = s->frames / seconds;
439 log_msg(LOG_LEVEL_INFO, "[DVS disp.] %d frames in %g seconds = %g FPS\n", s->frames, seconds, fps);
440 s->t0 = s->t;
441 s->frames = 0;
442 }
443 }
444 return NULL;
445}
446
447static struct video_frame *
449{
450 struct state_hdsp *s = (struct state_hdsp *)state;
451 int res;
452
453 assert(s->magic == HDSP_MAGIC);
454
455 if(s->mode != NULL) {
456 int fifo_flags = SV_FIFO_FLAG_FLUSH | SV_FIFO_FLAG_NODMAADDR;
457
458 if(!s->play_audio)
459 fifo_flags |= SV_FIFO_FLAG_VIDEOONLY;
460 else {
461 pthread_mutex_lock(&s->audio_reconf_lock);
462 if(s->audio_reconf_pending) {
464 pthread_cond_signal(&s->audio_reconf_possible_cv);
465 }
466 while(!s->audio_reconf_done)
467 pthread_cond_wait(&s->audio_reconf_done_cv, &s->audio_reconf_lock);
469 pthread_mutex_unlock(&s->audio_reconf_lock);
470 }
471 /* Prepare the new RTP buffer... */
472 res =
473 sv_fifo_getbuffer(s->sv, s->fifo, &s->fifo_buffer, NULL,
474 fifo_flags);
475 if (res != SV_OK) {
476 fprintf(stderr, "Error %s\n", sv_geterrortext(res));
477 return NULL;
478 }
479
480 s->bufs_index = (s->bufs_index + 1) % 2;
481 s->tile->data = s->bufs[s->bufs_index];
482 assert(s->tile->data != NULL);
483 s->fifo_buffer->video[0].addr = s->tile->data;
484 s->fifo_buffer->video[0].size = s->tile->data_len;
485
486 if(s->play_audio) {
487 s->audio_fifo_required_size = s->fifo_buffer->audio[0].size;
488 s->fifo_buffer->audio[0].addr[0] = s->audio_fifo_data;
489 }
490 }
491 s->first_run = FALSE;
492
493 return s->frame;
494}
495
496static bool display_dvs_putf(void *state, struct video_frame *frame, long long flags)
497{
498 struct state_hdsp *s = (struct state_hdsp *)state;
499
500 assert(s->magic == HDSP_MAGIC);
501
502 pthread_mutex_lock(&s->lock);
503 if(s->work_to_do && flags != PUTF_BLOCKING) {
504 pthread_mutex_unlock(&s->lock);
505 return FALSE;
506 }
507
508 /* Wait for the worker to finish... */
509 while (s->work_to_do) {
510 s->boss_waiting = TRUE;
511 pthread_cond_wait(&s->boss_cv, &s->lock);
512 s->boss_waiting = FALSE;
513 }
514
515 // pass poisoned pill
516 if(!frame) {
517 s->should_exit = true;
518 }
519
520 /* ...and give it more to do... */
521 s->tmp_buffer = s->fifo_buffer;
522 s->fifo_buffer = NULL;
523 s->work_to_do = TRUE;
524
525 /* ...and signal the worker */
526 if (s->worker_waiting) {
527 pthread_cond_signal(&s->worker_cv);
528 }
529 pthread_mutex_unlock(&s->lock);
530
531 return true;
532}
533
535 struct video_desc desc)
536{
537 struct state_hdsp *s = (struct state_hdsp *)state;
538 int i, res;
539 int hd_video_mode;
540
541 /* Wait for the worker to finish... */
542 while (!s->worker_waiting);
543
545 s->frame->fps = desc.fps;
547 s->tile->width = desc.width;
548 s->tile->height = desc.height;
549
550 if(s->mode_set_manually) return true;
551
552 s->mode = NULL;
553 for(i=0; hdsp_mode_table[i].width != 0; i++) {
554 if(hdsp_mode_table[i].width == desc.width &&
556 fabs(desc.fps - hdsp_mode_table[i].fps) < 0.01 ) {
560 s->mode = &hdsp_mode_table[i];
561 break;
562 }
563 }
564 }
565
566 if(s->mode == NULL) {
567 fprintf(stderr, "Reconfigure failed. Expect troubles pretty soon..\n"
568 "\tRequested: %dx%d, color space %d, fps %f,%s\n",
571 return false;
572 }
573
574 hd_video_mode = SV_MODE_STORAGE_FRAME;
575
576 switch(s->frame->color_spec) {
577 case DVS10:
578 hd_video_mode |= SV_MODE_COLOR_YUV422 | SV_MODE_NBIT_10BDVS;
579 break;
580 case UYVY:
581 hd_video_mode |= SV_MODE_COLOR_YUV422;
582 break;
583 case RGBA:
584 hd_video_mode |= SV_MODE_COLOR_RGBA;
585 break;
586 case RGB:
587 hd_video_mode |= SV_MODE_COLOR_RGB_RGB;
588 break;
589 default:
590 fprintf(stderr, "[dvs] Unsupported video codec passed!");
591 return false;
592 }
593
594 hd_video_mode |= s->mode->mode;
595 //s->hd_video_mode |= SV_MODE_AUDIO_NOAUDIO;
596
597 if(s->fifo)
598 sv_fifo_free(s->sv, s->fifo);
599
600 //res = sv_videomode(s->sv, hd_video_mode);
601 res = sv_option(s->sv, SV_OPTION_VIDEOMODE, hd_video_mode);
602 if (res != SV_OK) {
603 fprintf(stderr, "Cannot set videomode %s\n", sv_geterrortext(res));
604 return false;
605 }
606 res = sv_sync_output(s->sv, SV_SYNCOUT_BILEVEL);
607 if (res != SV_OK) {
608 fprintf(stderr, "Cannot enable sync-on-green %s\n",
609 sv_geterrortext(res));
610 return false;
611 }
612
613
614 res = sv_fifo_init(s->sv, &s->fifo, 0, /* must be zero for output */
615 0, /* obsolete, must be zero */
616 SV_FIFO_DMA_ON,
617 SV_FIFO_FLAG_NODMAADDR, /* SV_FIFO_FLAG_* */
618 0); /* default maximal numer of FIFO buffer frames */
619 if (res != SV_OK) {
620 fprintf(stderr, "Cannot initialize video display FIFO %s\n",
621 sv_geterrortext(res));
622 return false;
623 }
624 res = sv_fifo_start(s->sv, s->fifo);
625 if (res != SV_OK) {
626 fprintf(stderr, "Cannot start video display FIFO %s\n",
627 sv_geterrortext(res));
628 return false;
629 }
630
632 s->tile->height;
633
634 free(s->bufs[0]);
635 free(s->bufs[1]);
636 s->bufs[0] = malloc(s->tile->data_len);
637 s->bufs[1] = malloc(s->tile->data_len);
638 s->bufs_index = 0;
639 memset(s->bufs[0], 0, s->tile->data_len);
640 memset(s->bufs[1], 0, s->tile->data_len);
641
642 if(!s->first_run)
643 display_dvs_getf(s); /* update s->frame.data */
644
645 return true;
646}
647
648static void display_dvs_probe(struct device_info **available_cards, int *count, void (**deleter)(void *))
649{
651 *count = 1;
652 *available_cards = (struct device_info *) calloc(1, sizeof(struct device_info));
653 strcpy((*available_cards)[0].dev, "");
654 strcpy((*available_cards)[0].name, "Dvs");
655 strcpy((*available_cards)[0].extra, "\"embeddedAudioAvailable\":\"t\"");
656}
657
658
659static void *display_dvs_init(struct module *parent, const char *cfg, unsigned int flags)
660{
661 UNUSED(parent);
662 struct state_hdsp *s;
663 int i;
664 char *name = strdup("");
665 int res;
666 char *fmt = NULL;
667
668 if (cfg && strcmp(cfg, "help") == 0) {
669 show_help();
670 free(name);
671 return INIT_NOERR;
672 }
673
674 s = (struct state_hdsp *)calloc(1, sizeof(struct state_hdsp));
675 s->magic = HDSP_MAGIC;
676
678
679 s->frame = vf_alloc(1);
680 s->tile = vf_get_tile(s->frame, 0);
681
682 gettimeofday(&s->t0, NULL);
683
684 if (cfg != NULL) {
685 fmt = strdup(cfg);
686 if(strncmp(fmt, "PCI", 3) == 0) {
687 free(name);
688 name = strdup(fmt);
689 } else {
690 char *tmp;
691 int mode_index;
692
693 tmp = strtok(fmt, ":");
694
695 mode_index = atoi(tmp);
696 tmp = strtok(NULL, ":");
697
698 if (tmp) {
700 if (s->frame->color_spec == VIDEO_CODEC_NONE) {
701 fprintf(stderr, "dvs: unknown codec: %s\n", tmp);
702 goto error;
703 }
704 for(i=0; hdsp_mode_table[i].width != 0; i++) {
705 if(hdsp_mode_table[i].mode == mode_index) {
706 s->mode = &hdsp_mode_table[i];
707 break;
708 }
709 }
710 if(s->mode == NULL) {
711 fprintf(stderr, "dvs: unknown video mode: %d\n", mode_index);
712 goto error;
713 }
714 tmp = strtok(NULL, ":");
715 if(tmp)
716 {
717 if (strtok(NULL, ":") != NULL) { // DVS device name contains ':'
718 // which was removed by strtok
719 tmp[strlen(tmp)] = ':';
720 free(name);
721 name = strdup(tmp);
722 } else {
723 fprintf(stderr, "dvs: Malformed device name!");
724 goto error;
725 }
726 }
727 }
728 }
729 free(fmt);
730 fmt = NULL;
731 }
732
733 s->audio_ring_buffer = NULL;
734 s->audio_fifo_data = NULL;
736 s->play_audio = TRUE;
737 } else {
738 s->play_audio = FALSE;
739 sv_option(s->sv, SV_OPTION_AUDIOMUTE, TRUE);
740 }
741
742 /* Start the display thread... */
743 res = sv_openex(&s->sv, name, SV_OPENPROGRAM_DEFAULT, SV_OPENTYPE_DEFAULT, 0, 0);
744 if (res != SV_OK) {
745 fprintf(stderr, "Cannot open DVS display device.\n");
746 fprintf(stderr, "Error %s\n", sv_geterrortext(res));
747 goto error;
748 }
749
750 s->worker_waiting = TRUE;
751 s->first_run = TRUE;
752
753 if(s->mode) {
754 struct video_desc desc;
755 desc.width = s->mode->width;
756 desc.height = s->mode->height;
758 switch(s->mode->aux) {
759 case AUX_INTERLACED:
761 break;
762 case AUX_PROGRESSIVE:
764 break;
765 case AUX_SF:
767 break;
768 default:
769 /* could not reach here */
770 abort();
771 }
772 desc.fps = s->mode->fps;
773
775 desc);
777 }
778
779 pthread_mutex_init(&s->lock, NULL);
780 pthread_cond_init(&s->boss_cv, NULL);
781 pthread_cond_init(&s->worker_cv, NULL);
782 s->work_to_do = FALSE;
783 s->boss_waiting = FALSE;
785 s->display_buffer = NULL;
786
787 pthread_mutex_init(&s->audio_reconf_lock, NULL);
788 pthread_cond_init(&s->audio_reconf_possible_cv, NULL);
789 pthread_cond_init(&s->audio_reconf_done_cv, NULL);
793
794 /*if (pthread_create(&(s->thread_id), NULL, display_thread_hd, (void *)s)
795 != 0) {
796 perror("Unable to create display thread\n");
797 return NULL;
798 }*/
799
800 free(name);
801
802 pthread_create(&s->thread_id, NULL, display_aggregate_run, s);
803 return (void *)s;
804
805error:
806 free(name);
807 free(fmt);
808 vf_free(s->frame);
809 free(s);
810 return NULL;
811}
812
813static void display_dvs_done(void *state)
814{
815 struct state_hdsp *s = (struct state_hdsp *)state;
816
817 pthread_join(s->thread_id, NULL);
818 sv_fifo_free(s->sv, s->fifo);
819 sv_close(s->sv);
820 vf_free(s->frame);
821 free(s);
822}
823
824static bool display_dvs_get_property(void *state, int property, void *val, size_t *len)
825{
826 codec_t codecs[] = {DVS10, UYVY, RGBA, RGB};
827 int rgb_shift[] = {0, 8, 16};
828
829 UNUSED(state);
830
831 switch (property) {
833 if(sizeof(codecs) <= *len) {
834 memcpy(val, codecs, sizeof(codecs));
835 } else {
836 return false;
837 }
838
839 *len = sizeof(codecs);
840 break;
842 if(sizeof(rgb_shift) > *len) {
843 return false;
844 }
845 memcpy(val, rgb_shift, sizeof(rgb_shift));
846 *len = sizeof(rgb_shift);
847 break;
849 *(int *) val = PITCH_DEFAULT;
850 *len = sizeof(int);
851 break;
853 {
854 assert(*len == sizeof(struct audio_desc));
855 struct audio_desc *desc = (struct audio_desc *) val;
856 desc->sample_rate = 48000;
857 desc->ch_count = 2;
858 if (desc->ch_count > 2) {
859 desc->ch_count = 16;
860 }
861 desc->codec = AC_PCM;
862 desc->bps = 4;
863 }
864 break;
865 default:
866 return false;
867 }
868 return true;
869}
870
871/*
872 * AUDIO
873 */
874static void display_dvs_put_audio_frame(void *state, const struct audio_frame *frame)
875{
876 struct state_hdsp *s = (struct state_hdsp *)state;
877
878 if(!s->play_audio)
879 return;
880
881 ring_buffer_write(s->audio_ring_buffer, frame->data, frame->data_len);
882}
883
885 int sample_rate) {
886 bool ret;
887 struct state_hdsp *s = (struct state_hdsp *)state;
888 int res = SV_OK;
889
890 pthread_mutex_lock(&s->audio_reconf_lock);
892 while(!s->audio_reconf_possible)
893 pthread_cond_wait(&s->audio_reconf_possible_cv, &s->audio_reconf_lock);
894
895 if(s->sv)
896 sv_fifo_free(s->sv, s->fifo);
897
899 free(s->audio_fifo_data);
900 s->audio_ring_buffer = NULL;
901 s->audio_fifo_data = NULL;
902
903 if (quant_samples != 32) {
904 fprintf(stderr, "[dvs] Unsupported number of audio samples: %d\n",
906 goto error;
907 }
908
909 if (channels != 2 && channels != 16) {
910 fprintf(stderr, "[DVS] requested channel count isn't supported: "
911 "%d\n", channels);
912 goto error;
913 }
914
915 if(sample_rate != 48000) {
916 fprintf(stderr, "[dvs] Unsupported audio sample rate: %d\n",
918 goto error;
919 }
920
921 res = sv_option(s->sv, SV_OPTION_AUDIOCHANNELS, channels/2); /* channels are in pairs ! */
922 if (res != SV_OK) {
923 goto error;
924 }
925 res = sv_option(s->sv, SV_OPTION_AUDIOFREQ, sample_rate);
926 if (res != SV_OK) {
927 goto error;
928 }
929 res = sv_option(s->sv, SV_OPTION_AUDIOBITS, 32);
930 if (res != SV_OK) {
931 goto error;
932 }
933
934 int ring_buffer_size = 5 * sizeof(int32_t) * channels * sample_rate;
935 s->audio_ring_buffer = ring_buffer_init(ring_buffer_size);
936
937 s->audio_fifo_data = (char *) calloc(1,
939
940 res = sv_fifo_init(s->sv, &s->fifo, 0, /* must be zero for output */
941 0, /* obsolete, must be zero */
942 SV_FIFO_DMA_ON,
943 SV_FIFO_FLAG_NODMAADDR, /* SV_FIFO_FLAG_* */
944 0); /* default maximal numer of FIFO buffer frames */
945 if (res != SV_OK) {
946 fprintf(stderr, "Cannot initialize audio FIFO %s\n",
947 sv_geterrortext(res));
948 goto error;
949 }
950 res = sv_fifo_start(s->sv, s->fifo);
951 if (res != SV_OK) {
952 fprintf(stderr, "Cannot start audio FIFO %s\n",
953 sv_geterrortext(res));
954 goto error;
955 }
956
958
959 ret = true;
960 goto unlock;
961error:
962 fprintf(stderr, "Setting audio error %s\n",
963 sv_geterrortext(res));
964 s->play_audio = FALSE;
965 ret = false;
966
967unlock:
969 pthread_cond_signal(&s->audio_reconf_done_cv);
970 pthread_mutex_unlock(&s->audio_reconf_lock);
971
972 return ret;
973}
974
988
#define UNUSED(x)
void ** state
int void * val
struct video_desc desc
int int int sample_rate
int int channels
struct video_frame * frame
const char * fmt
int void size_t * len
const char unsigned int flags
int void(** deleter)(void *))
int property
int quant_samples
struct video_frame * vf_alloc(int count)
Allocates blank video frame.
void vf_free(struct video_frame *buf)
Frees video_frame structure.
int vc_get_linesize(unsigned int width, codec_t codec)
codec_t get_codec_from_name(const char *name)
This file contains definition of some common audio types.
@ AC_PCM
Definition types.h:53
#define TRUE
#define FALSE
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_INFO
normal reporting
Definition debug.h:62
#define PITCH_DEFAULT
default pitch, i. e. respective linesize
#define PUTF_BLOCKING
#define VIDEO_DISPLAY_ABI_VERSION
#define DISPLAY_NO_GENERIC_FPS_INDICATOR
#define DISPLAY_FLAG_AUDIO_EMBEDDED
@ DISPLAY_PROPERTY_BUF_PITCH
requested framebuffer pitch - int (bytes), may be PITCH_DEFAULT
@ DISPLAY_PROPERTY_RGB_SHIFT
red,green,blue shift - int[3] (bits)
@ DISPLAY_PROPERTY_CODECS
list of natively supported codecs - codec_t[]
@ DISPLAY_PROPERTY_AUDIO_FORMAT
int count
Definition hd-rum.c:44
#define INIT_NOERR
Definition host.h:73
@ LIBRARY_CLASS_VIDEO_DISPLAY
Definition lib_common.h:79
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
Definition lib_common.h:144
enum openssl_mode mode
int ring_get_size(struct ring_buffer *ring)
void ring_buffer_destroy(struct ring_buffer *ring)
struct ring_buffer * ring_buffer_init(int size)
int ring_buffer_read(struct ring_buffer *ring, char *out, int max_len)
void ring_buffer_write(struct ring_buffer *ring, const char *in, int len)
uint32_t hd_video_mode
Definition run_tests.c:70
const char * parent
Definition settings.cpp:198
const char * name
Definition settings.cpp:193
struct used to comunicate with audio capture/playback device
Definition types.h:99
char extra[1024]
Definition types.h:389
char dev[1024]
Definition types.h:383
unsigned int height
Definition dvs.h:46
double fps
Definition dvs.h:47
unsigned int width
Definition dvs.h:45
const hdsp_mode_table_t * mode
Definition dvs.c:307
pthread_cond_t audio_reconf_possible_cv
Definition dvs.c:312
volatile int work_to_do
Definition dvs.c:299
int audio_fifo_required_size
Definition dvs.c:321
char * audio_fifo_data
Definition dvs.c:319
struct ring_buffer * audio_ring_buffer
Definition dvs.c:318
struct tile * tile
Definition dvs.c:306
bool should_exit
Definition dvs.c:329
volatile int boss_waiting
Definition dvs.c:300
sv_fifo_buffer * tmp_buffer
Definition dvs.c:295
pthread_mutex_t audio_reconf_lock
Definition dvs.c:311
volatile int audio_reconf_pending
Definition dvs.c:314
unsigned first_run
Definition dvs.c:308
sv_fifo_buffer * display_buffer
Definition dvs.c:294
unsigned play_audio
Definition dvs.c:309
pthread_t thread_id
Definition dvs.c:290
int frames
Definition dvs.c:325
uint32_t magic
Definition dvs.c:302
volatile int worker_waiting
Definition dvs.c:301
volatile int audio_reconf_possible
Definition dvs.c:315
sv_fifo_buffer * fifo_buffer
Definition dvs.c:293
pthread_cond_t boss_cv
Definition dvs.c:297
int bufs_index
Definition dvs.c:304
pthread_mutex_t lock
Definition dvs.c:296
unsigned int mode_set_manually
Definition dvs.c:323
struct video_frame * frame
Definition dvs.c:305
sv_fifo * fifo
Definition dvs.c:292
pthread_cond_t audio_reconf_done_cv
Definition dvs.c:313
struct timeval t t0
Definition dvs.c:326
pthread_cond_t worker_cv
Definition dvs.c:298
volatile int audio_reconf_done
Definition dvs.c:316
char * bufs[2]
Definition dvs.c:303
sv_handle * sv
Definition dvs.c:291
Struct tile is an area of video_frame.
Definition types.h:279
unsigned int width
Definition types.h:280
char * data
Raw tile data. Pointer must be at least 4B aligned.
Definition types.h:287
unsigned int data_len
length of the data
Definition types.h:288
unsigned int height
Definition types.h:281
codec_t color_spec
Definition types.h:182
enum interlacing_t interlacing
Definition types.h:184
double fps
Definition types.h:183
unsigned int width
width of every tile (!)
Definition types.h:179
unsigned int height
height of every tile (!)
Definition types.h:180
Struct video_frame represents a video frame and contains video description.
Definition types.h:305
enum interlacing_t interlacing
Definition types.h:307
double fps
Definition types.h:308
codec_t color_spec
Definition types.h:306
double tv_diff(struct timeval curr_time, struct timeval prev_time)
Definition tv.c:97
@ PROGRESSIVE
progressive frame
Definition types.h:164
@ SEGMENTED_FRAME
Segmented frame. Contains the same data as progressive frame.
Definition types.h:168
@ INTERLACED_MERGED
Columngs of both fields are interlaced together.
Definition types.h:167
codec_t
Definition types.h:65
@ RGB
RGB 8-bit (packed into 24-bit word)
Definition types.h:80
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
Definition types.h:71
@ VIDEO_CODEC_NONE
dummy color spec
Definition types.h:66
@ DVS10
DVS 10-bit format.
Definition types.h:76
@ RGBA
RGBA 8-bit, big-endian.
Definition types.h:70
This is an umbrella header for video functions.
static void show_help(void)
Definition dvs.c:174
static struct @76 codecs[]
static void * display_aggregate_run(void *state)
Definition aggregate.c:80
static int display_dvs_reconfigure_audio(void *state, int quant_samples, int channels, int sample_rate)
Definition dvs.c:884
static const struct video_display_info display_dvs_info
Definition dvs.c:975
static void * display_dvs_run(void *arg)
Definition dvs.c:385
static void display_dvs_probe(struct device_info **available_cards, int *count, void(**deleter)(void *))
Definition dvs.c:648
static void * display_dvs_init(struct module *parent, const char *cfg, unsigned int flags)
Definition dvs.c:659
static struct video_frame * display_dvs_getf(void *state)
Definition dvs.c:448
const hdsp_mode_table_t hdsp_mode_table[]
Definition dvs.c:71
static bool display_dvs_get_property(void *state, int property, void *val, size_t *len)
Definition dvs.c:824
static bool display_dvs_putf(void *state, struct video_frame *frame, long long flags)
Definition dvs.c:496
static void display_dvs_put_audio_frame(void *state, const struct audio_frame *frame)
Definition dvs.c:874
#define HDSP_MAGIC
Definition dvs.c:69
static bool display_dvs_reconfigure(void *state, struct video_desc desc)
Definition dvs.c:534
static void display_dvs_done(void *state)
Definition dvs.c:813
struct tile * vf_get_tile(struct video_frame *buf, int pos)
Returns pointer to n-th tile from video frame Equivalent to &video_frame::tiles[pos].
const char * get_interlacing_description(enum interlacing_t interlacing)
Returns description of interlacing Eg. "progressive".
#define AUX_SF
#define AUX_INTERLACED
#define AUX_PROGRESSIVE