UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
deltacast.cpp
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2012-2023 CESNET, z. s. p. o.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, is permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * 3. Neither the name of CESNET nor the names of its contributors may be
21 * used to endorse or promote products derived from this software without
22 * specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
26 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
28 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifdef HAVE_CONFIG_H
39#include "config.h"
40#include "config_unix.h"
41#include "config_win32.h"
42#endif // HAVE_CONFIG_H
43
44#include "host.h"
45#include "debug.h"
46#include "deltacast_common.hpp"
47#include "lib_common.h"
48#include "tv.h"
49#include "video.h"
50#include "video_display.h"
51#include "audio/types.h"
52#include "audio/utils.h"
53#include "utils/ring_buffer.h"
54
55#include <algorithm>
56
57#define DELTACAST_MAGIC 0x01005e02
58
60 uint32_t magic;
61
62 struct timeval tv;
64 struct tile *tile;
65
66 unsigned long int frames;
67 unsigned long int frames_last;
70 HANDLE SlotHandle;
71
72 pthread_mutex_t lock;
73
74 unsigned int play_audio:1;
75 unsigned int audio_configured:1;
76 VHD_AUDIOINFO AudioInfo;
77 SHORT *pSample;
80 char *audio_tmp;
81 };
82
83static void show_help(void);
84
85static void show_help(void)
86{
87 printf("deltacast (output) options:\n");
88 printf("\t-d deltacast[:device=<index>]\n");
89
91
92 printf("\nDefault board is 0.\n");
93
94}
95
96static struct video_frame *
98{
99 struct state_deltacast *s = (struct state_deltacast *)state;
100 BYTE *pBuffer;
101 ULONG BufferSize;
102 ULONG Result;
103
104 assert(s->magic == DELTACAST_MAGIC);
105
106 if(!s->initialized)
107 return s->frame;
108
109 Result = VHD_LockSlotHandle(s->StreamHandle, &s->SlotHandle);
110 if (Result != VHDERR_NOERROR) {
111 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Unable to lock slot.\n");
112 return NULL;
113 }
114 Result = VHD_GetSlotBuffer(s->SlotHandle,VHD_SDI_BT_VIDEO,&pBuffer,&BufferSize);
115 if (Result != VHDERR_NOERROR) {
116 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Unable to get buffer.\n");
117 return NULL;
118 }
119
120 s->tile->data = (char *) pBuffer;
121 s->tile->data_len = BufferSize;
122
123 return s->frame;
124}
125
126static bool display_deltacast_putf(void *state, struct video_frame *frame, long long nonblock)
127{
128 struct state_deltacast *s = (struct state_deltacast *)state;
129 struct timeval tv;
130 int i;
131 ULONG Result;
132
133 UNUSED(frame);
135
136 assert(s->magic == DELTACAST_MAGIC);
137
138 pthread_mutex_lock(&s->lock);
139 if(s->play_audio && s->audio_configured) {
140 /* Retrieve the number of needed samples */
141 for(i = 0; i < s->audio_desc.ch_count; ++i) {
142 s->AudioInfo.pAudioGroups[i / 4].pAudioChannels[i % 4].DataSize = 0;
143 }
144 Result = VHD_SlotEmbedAudio(s->SlotHandle,&s->AudioInfo);
145 if (Result != VHDERR_BUFFERTOOSMALL)
146 {
147 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] ERROR : Cannot embed audio on TX0 stream. Result = 0x%08" PRIX_ULONG "\n", Result);
148 } else {
149 for(i = 0; i < s->audio_desc.ch_count; ++i) {
150 int ret;
151 ret = ring_buffer_read(s->audio_channels[i], (char *) s->AudioInfo.pAudioGroups[i / 4].pAudioChannels[i % 4].pData, s->AudioInfo.pAudioGroups[i / 4].pAudioChannels[i % 4].DataSize);
152 if(!ret) {
153 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Buffer underflow for channel %d.\n", i);
154 }
155 s->AudioInfo.pAudioGroups[0].pAudioChannels[0].DataSize = ret;
156 }
157 }
158 /* Embed audio */
159 Result = VHD_SlotEmbedAudio(s->SlotHandle,&s->AudioInfo);
160 if (Result != VHDERR_NOERROR)
161 {
162 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] ERROR : Cannot embed audio on TX0 stream. Result = 0x%08" PRIX_ULONG "\n",Result);
163 }
164 }
165 pthread_mutex_unlock(&s->lock);
166
167 VHD_UnlockSlotHandle(s->SlotHandle);
168 s->SlotHandle = NULL;
169
170 gettimeofday(&tv, NULL);
171 double seconds = tv_diff(tv, s->tv);
172 if (seconds > 5) {
173 double fps = s->frames / seconds;
174 log_msg(LOG_LEVEL_INFO, "[DELTACAST display] %lu frames in %g seconds = %g FPS\n",
175 s->frames, seconds, fps);
176 s->tv = tv;
177 s->frames = 0;
178 }
179 s->frames++;
180
181 return true;
182}
183
184static bool
186{
187 struct state_deltacast *s = (struct state_deltacast *)state;
188 int VideoStandard = 0;
189 int i;
190 ULONG Result;
191
192 if(s->initialized) {
193 if(s->SlotHandle)
194 VHD_UnlockSlotHandle(s->SlotHandle);
195 VHD_StopStream(s->StreamHandle);
196 VHD_CloseStreamHandle(s->StreamHandle);
197 }
198
199 assert(desc.tile_count == 1);
200
201 s->tile->width = desc.width;
202 s->tile->height = desc.height;
205 s->frame->fps = desc.fps;
206
207 for (i = 0; i < deltacast_frame_modes_count; ++i)
208 {
209 if(fabs(desc.fps - deltacast_frame_modes[i].fps) < 0.01 &&
213 VideoStandard = deltacast_frame_modes[i].mode;
214 log_msg(LOG_LEVEL_NOTICE, "[DELTACAST] %s mode selected.\n", deltacast_frame_modes[i].name);
215 break;
216 }
217 }
219 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Failed to obtain video format for incoming video: %dx%d @ %2.2f %s\n", desc.width, desc.height,
221
222 goto error;
223 }
224
225 if(desc.color_spec == RAW) {
226 Result = VHD_OpenStreamHandle(s->BoardHandle,VHD_ST_TX0,VHD_SDI_STPROC_RAW,NULL,&s->StreamHandle,NULL);
227 } else if (s->play_audio == TRUE) {
228 Result = VHD_OpenStreamHandle(s->BoardHandle,VHD_ST_TX0,VHD_SDI_STPROC_JOINED,NULL,&s->StreamHandle,NULL);
229 } else {
230 Result = VHD_OpenStreamHandle(s->BoardHandle,VHD_ST_TX0,VHD_SDI_STPROC_DISJOINED_VIDEO,NULL,&s->StreamHandle,NULL);
231 }
232
233 if (Result != VHDERR_NOERROR) {
234 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Failed to open stream handle.\n");
235 goto error;
236 }
237
238 VHD_SetStreamProperty(s->StreamHandle,VHD_SDI_SP_VIDEO_STANDARD,VideoStandard);
239 VHD_SetStreamProperty(s->StreamHandle,VHD_CORE_SP_BUFFERQUEUE_DEPTH,2);
240 VHD_SetStreamProperty(s->StreamHandle,VHD_CORE_SP_BUFFERQUEUE_PRELOAD,0);
241
242 Result = VHD_StartStream(s->StreamHandle);
243 if (Result != VHDERR_NOERROR) {
244 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Unable to start stream.\n");
245 goto error;
246 }
247
248 s->initialized = TRUE;
249 return true;
250
251error:
252 return false;
253}
254
255static void display_deltacast_probe(struct device_info **available_cards, int *count, void (**deleter)(void *))
256{
258 *count = 0;
259 *available_cards = nullptr;
260
261 ULONG Result,DllVersion,NbBoards;
262 Result = VHD_GetApiInfo(&DllVersion,&NbBoards);
263 if (Result != VHDERR_NOERROR) {
264 return;
265 }
266 if (NbBoards == 0) {
267 return;
268 }
269
270 /* Query DELTA boards information */
271 for (ULONG i = 0; i < NbBoards; i++)
272 {
273 ULONG BoardType;
274 HANDLE BoardHandle = NULL;
275 ULONG Result = VHD_OpenBoardHandle(i,&BoardHandle,NULL,0);
276 VHD_GetBoardProperty(BoardHandle, VHD_CORE_BP_BOARD_TYPE, &BoardType);
277
278 *count += 1;
279 *available_cards = (struct device_info *)
280 realloc(*available_cards, *count * sizeof(struct device_info));
281 memset(*available_cards + *count - 1, 0, sizeof(struct device_info));
282 snprintf((*available_cards)[*count - 1].dev, sizeof (*available_cards)[*count - 1].dev, ":device=%d", *count - 1);
283 snprintf((*available_cards)[*count - 1].extra, sizeof (*available_cards)[*count - 1].extra, R"("embeddedAudioAvailable":"t")");
284 (*available_cards)[*count - 1].repeatable = false;
285
286 if (Result == VHDERR_NOERROR)
287 {
288 std::string board{"Unknown DELTACAST type"};
289 auto it = board_type_map.find(BoardType);
290 if (it != board_type_map.end()) {
291 board = it->second;
292 }
293 snprintf((*available_cards)[*count - 1].name,
294 sizeof (*available_cards)[*count - 1].name - 1,
295 "DELTACAST %s", board.c_str());
296 VHD_CloseBoardHandle(BoardHandle);
297 }
298 }
299
300}
301
302static void *display_deltacast_init(struct module *parent, const char *fmt, unsigned int flags)
303{
304 UNUSED(parent);
305 struct state_deltacast *s;
306 ULONG Result,DllVersion,NbBoards,ChnType;
307 ULONG BrdId = 0;
308
309 s = (struct state_deltacast *)calloc(1, sizeof(struct state_deltacast));
311
312 s->frame = vf_alloc(1);
313 s->tile = vf_get_tile(s->frame, 0);
314 s->frames = 0;
315
316 gettimeofday(&s->tv, NULL);
317
318 s->initialized = FALSE;
320 s->play_audio = TRUE;
321 } else {
322 s->play_audio = FALSE;
323 }
324
325 s->BoardHandle = s->StreamHandle = s->SlotHandle = NULL;
327
328 if(fmt && strcmp(fmt, "help") == 0) {
329 show_help();
330 vf_free(s->frame);
331 free(s);
332 return INIT_NOERR;
333 }
334
335 if(fmt)
336 {
337 char *tmp = strdup(fmt);
338 char *save_ptr = NULL;
339 char *tok;
340
341 tok = strtok_r(tmp, ":", &save_ptr);
342 if(!tok)
343 {
344 free(tmp);
345 show_help();
346 goto error;
347 }
348 if (strncasecmp(tok, "device=", strlen("device=")) == 0) {
349 BrdId = atoi(tok + strlen("device="));
350 } else {
351 log_msg(LOG_LEVEL_ERROR, "Unknown option: %s\n\n", tok);
352 free(tmp);
353 show_help();
354 goto error;
355 }
356 free(tmp);
357 }
358
359 /* Query VideoMasterHD information */
360 Result = VHD_GetApiInfo(&DllVersion,&NbBoards);
361 if (Result != VHDERR_NOERROR) {
362 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] ERROR : Cannot query VideoMasterHD"
363 " information. Result = 0x%08" PRIX_ULONG "\n",
364 Result);
365 goto error;
366 }
367 if (NbBoards == 0) {
368 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] No DELTA board detected, exiting...\n");
369 goto error;
370 }
371
372 if(BrdId >= NbBoards) {
373 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Wrong index %" PRIu_ULONG ". Found %" PRIu_ULONG " cards.\n", BrdId, NbBoards);
374 goto error;
375 }
376
377 /* Open a handle on first DELTA-hd/sdi/codec board */
378 Result = VHD_OpenBoardHandle(BrdId,&s->BoardHandle,NULL,0);
379 if (Result != VHDERR_NOERROR)
380 {
381 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] ERROR : Cannot open DELTA board %" PRIu_ULONG " handle. Result = 0x%08" PRIX_ULONG "\n", BrdId, Result);
382 goto error;
383 }
384
385 if (!delta_set_nb_channels(BrdId, s->BoardHandle, 0, 1)) {
386 goto error;
387 }
388
389 VHD_GetBoardProperty(s->BoardHandle, VHD_CORE_BP_TX0_TYPE, &ChnType);
390 if((ChnType!=VHD_CHNTYPE_SDSDI)&&(ChnType!=VHD_CHNTYPE_HDSDI)&&(ChnType!=VHD_CHNTYPE_3GSDI)) {
391 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] ERROR : The selected channel is not an SDI one\n");
392 goto bad_channel;
393 }
394
395 /* Disable RX0-TX0 by-pass relay loopthrough */
396 VHD_SetBoardProperty(s->BoardHandle,VHD_CORE_BP_BYPASS_RELAY_0,FALSE);
397
398 /* Select a 1/1 clock system */
399 VHD_SetBoardProperty(s->BoardHandle,VHD_SDI_BP_CLOCK_SYSTEM,VHD_CLOCKDIV_1);
400
401 pthread_mutex_init(&s->lock, NULL);
402
403 return s;
404
405bad_channel:
406 VHD_CloseBoardHandle(s->BoardHandle);
407error:
408 vf_free(s->frame);
409 free(s);
410 return NULL;
411}
412
414{
415 struct state_deltacast *s = (struct state_deltacast *)state;
416
417 if(s->initialized) {
418 if(s->SlotHandle)
419 VHD_UnlockSlotHandle(s->SlotHandle);
420 VHD_StopStream(s->StreamHandle);
421 VHD_CloseStreamHandle(s->StreamHandle);
422 VHD_SetBoardProperty(s->BoardHandle,VHD_CORE_BP_BYPASS_RELAY_0,TRUE);
423 VHD_CloseBoardHandle(s->BoardHandle);
424 }
425
426 vf_free(s->frame);
427 free(s);
428}
429
430static bool
432 size_t *len)
433{
434 UNUSED(state);
435 codec_t codecs[] = {v210, UYVY, RAW};
437 int rgb_shift[] = {0, 8, 16};
438
439 switch (property) {
441 if(sizeof(codecs) <= *len) {
442 memcpy(val, codecs, sizeof(codecs));
443 } else {
444 return false;
445 }
446
447 *len = sizeof(codecs);
448 break;
450 if(sizeof(rgb_shift) > *len) {
451 return false;
452 }
453 memcpy(val, rgb_shift, sizeof(rgb_shift));
454 *len = sizeof(rgb_shift);
455 break;
457 *(int *) val = PITCH_DEFAULT;
458 *len = sizeof(int);
459 break;
461 if(sizeof(supported_il_modes) <= *len) {
462 memcpy(val, supported_il_modes, sizeof(supported_il_modes));
463 } else {
464 return false;
465 }
466 *len = sizeof(supported_il_modes);
467 break;
469 {
470 assert(*len == sizeof(struct audio_desc));
471 struct audio_desc *desc = (struct audio_desc *) val;
472 desc->sample_rate = 48000;
473 desc->ch_count = std::max(desc->ch_count, 16);
474 desc->codec = AC_PCM;
475 desc->bps = desc->bps < 3 ? 2 : 3;
476 }
477 break;
478 default:
479 return false;
480 }
481 return true;
482}
483
484static bool
486 int channels, int sample_rate)
487{
488 struct state_deltacast *s = (struct state_deltacast *)state;
489 int i;
490
491 assert(channels <= 16);
492
493 pthread_mutex_lock(&s->lock);
495 for(i = 0; i < 16; ++i) {
497 s->audio_channels[i] = NULL;
498 }
499 free(s->audio_tmp);
500
504
505 for(i = 0; i < channels; ++i) {
507 }
508 s->audio_tmp = (char *) malloc(s->audio_desc.bps * s->audio_desc.sample_rate);
509
510 /* Configure audio info */
511 memset(&s->AudioInfo, 0, sizeof(VHD_AUDIOINFO));
512 for(i = 0; i < channels; ++i) {
513 VHD_AUDIOCHANNEL *pAudioChn=NULL;
514 pAudioChn = &s->AudioInfo.pAudioGroups[i / 4].pAudioChannels[i % 4];
515 pAudioChn->Mode = VHD_AM_MONO;
516 switch(quant_samples) {
517 case 16:
518 pAudioChn->BufferFormat = VHD_AF_16;
519 break;
520 case 20:
521 pAudioChn->BufferFormat = VHD_AF_20;
522 break;
523 case 24:
524 pAudioChn->BufferFormat = VHD_AF_24;
525 break;
526 default:
527 log_msg(LOG_LEVEL_ERROR, "[DELTACAST] Unsupported PCM audio: %d bits.\n", quant_samples);
528 pthread_mutex_unlock(&s->lock);
529 return false;
530 }
531 pAudioChn->pData = new BYTE[s->audio_desc.bps * s->audio_desc.sample_rate];
532 }
533
535 pthread_mutex_unlock(&s->lock);
536
537 return true;
538}
539
541{
542 struct state_deltacast *s = (struct state_deltacast *)state;
543 int i;
544 int channel_len = frame->data_len / frame->ch_count;
545
546 pthread_mutex_lock(&s->lock);
547 for(i = 0; i < frame->ch_count; ++i) {
548 demux_channel(s->audio_tmp, frame->data, frame->bps, frame->data_len, frame->ch_count, i);
549 ring_buffer_write(s->audio_channels[i], s->audio_tmp, channel_len);
550 }
551 pthread_mutex_unlock(&s->lock);
552}
553
567
569
#define UNUSED(x)
void ** state
struct video_frame long long nonblock
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.
This file contains definition of some common audio types.
@ AC_PCM
Definition types.h:53
#define TRUE
#define FALSE
unsigned char BYTE
Definition crypt_aes.h:71
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define LOG_LEVEL_NOTICE
information that may be interesting
Definition debug.h:61
#define LOG_LEVEL_INFO
normal reporting
Definition debug.h:62
#define LOG_LEVEL_ERROR
general errors
Definition debug.h:59
static void print_available_delta_boards()
static const int deltacast_frame_modes_count
static bool delta_set_nb_channels(ULONG BrdId, HANDLE BoardHandle, ULONG RequestedRx, ULONG RequestedTx)
#define PRIX_ULONG
static std::unordered_map< ULONG, std::string > board_type_map
static const struct deltacast_frame_mode_t deltacast_frame_modes[]
#define PRIu_ULONG
#define PITCH_DEFAULT
default pitch, i. e. respective linesize
#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_SUPPORTED_IL_MODES
display supported interlacing modes - enum interlacing_t[]
@ 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
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)
const char * parent
Definition settings.cpp:198
const char * name
Definition settings.cpp:193
int sample_rate
Definition types.h:78
int ch_count
Definition types.h:79
int bps
Definition types.h:77
struct used to comunicate with audio capture/playback device
Definition types.h:99
enum interlacing_t interlacing
char extra[1024]
Definition types.h:389
char dev[1024]
Definition types.h:383
struct ring_buffer * audio_channels[16]
Definition deltacast.cpp:79
struct tile * tile
Definition deltacast.cpp:64
VHD_AUDIOINFO AudioInfo
Definition deltacast.cpp:76
pthread_mutex_t lock
Definition deltacast.cpp:72
unsigned long int frames
Definition deltacast.cpp:66
unsigned long int frames_last
Definition deltacast.cpp:67
struct timeval tv
Definition deltacast.cpp:62
struct audio_desc audio_desc
Definition deltacast.cpp:78
unsigned int audio_configured
Definition deltacast.cpp:75
unsigned int play_audio
Definition deltacast.cpp:74
HANDLE StreamHandle
Definition deltacast.cpp:69
struct video_frame * frame
Definition deltacast.cpp:63
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
unsigned int tile_count
Definition types.h:185
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
interlacing_t
Definition types.h:163
@ UPPER_FIELD_FIRST
First stored field is top, followed by bottom.
Definition types.h:165
@ PROGRESSIVE
progressive frame
Definition types.h:164
@ SEGMENTED_FRAME
Segmented frame. Contains the same data as progressive frame.
Definition types.h:168
codec_t
Definition types.h:65
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
Definition types.h:71
@ RAW
RAW HD-SDI frame.
Definition types.h:82
@ v210
YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/),...
Definition types.h:75
void demux_channel(char *out, char *in, int bps, int in_len, int in_stream_channels, int pos_in_stream)
Definition utils.cpp:334
This is an umbrella header for video functions.
static struct @76 codecs[]
static bool display_deltacast_reconfigure(void *state, struct video_desc desc)
static bool display_deltacast_get_property(void *state, int property, void *val, size_t *len)
static bool display_deltacast_reconfigure_audio(void *state, int quant_samples, int channels, int sample_rate)
static void * display_deltacast_init(struct module *parent, const char *fmt, unsigned int flags)
#define DELTACAST_MAGIC
Definition deltacast.cpp:57
static bool display_deltacast_putf(void *state, struct video_frame *frame, long long nonblock)
static void display_deltacast_put_audio_frame(void *state, const struct audio_frame *frame)
static void display_deltacast_done(void *state)
static void display_deltacast_probe(struct device_info **available_cards, int *count, void(**deleter)(void *))
static const struct video_display_info display_deltacast_info
static void show_help(void)
Definition deltacast.cpp:85
static struct video_frame * display_deltacast_getf(void *state)
Definition deltacast.cpp:97
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".