UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
cineform.cpp
Go to the documentation of this file.
1
6/* Copyright (c) 2019-2023 CESNET z.s.p.o.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, is permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 *
22 * This product includes software developed by CESNET z.s.p.o.
23 *
24 * 4. Neither the name of the CESNET nor the names of its contributors may be
25 * used to endorse or promote products derived from this software without
26 * specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
30 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
32 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
38 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
39 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 */
42
43#ifdef HAVE_CONFIG_H
44#include "config.h"
45#include "config_unix.h"
46#include "config_win32.h"
47#endif // HAVE_CONFIG_H
48
49#include "debug.h"
50#include "host.h"
51#include "lib_common.h"
52#include "module.h"
53#include "tv.h"
54#include "video_compress.h"
55
56#include <CFHDTypes.h>
57#include <CFHDEncoder.h>
58
59#include "video.h"
60#include "video_codec.h"
61#include <memory>
62#include <map>
63#include <mutex>
64#include <thread>
65#include <vector>
66#include <queue>
67#include <condition_variable>
68
69#ifdef MEASUREMENT
70#include <time.h>
71#endif
72#include "utils/misc.h" // to_fourcc
73
74#define DEFAULT_POOL_SIZE 16
75#define DEFAULT_THREAD_COUNT 8
76#define MOD_NAME "[cineform] "
77
80
81 std::mutex mutex;
82
86
88
89 CFHD_EncodingQuality requested_quality;
92
93 CFHD_EncoderPoolRef encoderPoolRef;
94 CFHD_MetadataRef metadataRef;
95
96 uint32_t frame_seq_in;
97 uint32_t frame_seq_out;
98
99 std::queue<std::unique_ptr<video_frame, decltype(&vf_free)>> frame_queue;
100
102 bool stop;
103 std::condition_variable cv;
104
105#ifdef MEASUREMENT
106 std::map<uint32_t, struct timespec> times_map;
107#endif
108};
109
110static void cineform_compress_done(struct module *mod){
112
113 s->mutex.lock();
114
115 CFHD_StopEncoderPool(s->encoderPoolRef);
116 CFHD_ReleaseEncoderPool(s->encoderPoolRef);
117 CFHD_MetadataClose(s->metadataRef);
118
119 s->mutex.unlock();
120 delete s;
121}
122
123struct {
124 const char *label;
125 const char *key;
126 const char *description;
127 const char *opt_str;
128 const char *placeholder;
129} usage_opts[] = {
130 {"Quality", "quality", "specifies encode quality, range 1-6 (default: 4)", ":quality=", "4"},
131 {"Threads", "num_threads", "specifies number of threads for encoding (default: " TOSTRING(DEFAULT_THREAD_COUNT) ")", ":num_threads=", ""},
132 {"Pool size", "pool_size", "specifies the size of encoding pool (default: " TOSTRING(DEFAULT_POOL_SIZE) ")", ":pool_size=", ""},
134
135static void usage() {
136 printf("Cineform encoder usage:\n");
137 printf("\t-c cineform[:quality=<quality>][:threads=<num_threads>][:pool_size=<pool_size>]\n");
138
139 for(const auto& opt : usage_opts){
140 printf("\t\t<%s> %s\n", opt.key, opt.description);
141 }
142}
143
144static int parse_fmt(struct state_video_compress_cineform *s, char *fmt) {
145 char *item, *save_ptr = NULL;
146 if(fmt) {
147 while((item = strtok_r(fmt, ":", &save_ptr)) != NULL) {
148 if(strncasecmp("help", item, strlen("help")) == 0) {
149 usage();
150 return 1;
151 } else if(strncasecmp("quality=", item, strlen("quality=")) == 0) {
152 char *quality = item + strlen("quality=");
153 int qual = atoi(quality);
154 if(qual >= 1 && qual <= 6){
155 s->requested_quality = static_cast<CFHD_EncodingQuality>(qual);
156 } else {
157 log_msg(LOG_LEVEL_ERROR, "[cineform] Error: Quality must be in range 1-6.\n");
158 return -1;
159 }
160 } else if(strncasecmp("threads=", item, strlen("threads=")) == 0) {
161 char *threads = item + strlen("threads=");
162 s->requested_threads = atoi(threads);
163 } else if(strncasecmp("pool_size=", item, strlen("pool_size=")) == 0) {
164 char *pool_size = item + strlen("pool_size=");
165 s->requested_pool_size = atoi(pool_size);
166 } else {
167 log_msg(LOG_LEVEL_ERROR, "[cineform] Error: unknown option %s.\n",
168 item);
169 return -1;
170 }
171 fmt = NULL;
172 }
173 }
174
175 return 0;
176}
177
178static struct module * cineform_compress_init(struct module *parent, const char *opts)
179{
181
183
184 memset(&s->saved_desc, 0, sizeof(s->saved_desc));
185 s->requested_quality = CFHD_ENCODING_QUALITY_DEFAULT;
188
189 char *fmt = strdup(opts);
190 int ret = parse_fmt(s, fmt);
191 free(fmt);
192 if(ret != 0) {
193 delete s;
194 return ret > 0 ? static_cast<module*>(INIT_NOERR) : nullptr;
195 }
196
197 log_msg(LOG_LEVEL_NOTICE, "[cineform] : Threads: %d.\n", s->requested_threads);
198 CFHD_Error status = CFHD_ERROR_OKAY;
199 status = CFHD_CreateEncoderPool(&s->encoderPoolRef,
202 nullptr);
203 if(status != CFHD_ERROR_OKAY){
204 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to create encoder pool\n");
205 delete s;
206 return nullptr;
207 }
208 status = CFHD_MetadataOpen(&s->metadataRef);
209 if(status != CFHD_ERROR_OKAY){
210 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to create metadataRef\n");
211 CFHD_ReleaseEncoderPool(s->encoderPoolRef);
212 delete s;
213 return nullptr;
214 }
215
216 s->frame_seq_in = 0;
217 s->frame_seq_out = 0;
218 s->started = false;
219 s->stop = false;
220
223 s->module_data.priv_data = s;
226
227 return &s->module_data;
228}
229
230static struct {
232 CFHD_PixelFormat cfhd_pixel_format;
233 CFHD_EncodedFormat cfhd_encoded_format;
234} codecs[] = {
235 {UYVY, CFHD_PIXEL_FORMAT_2VUY, CFHD_ENCODED_FORMAT_YUV_422},
236 {RGB, CFHD_PIXEL_FORMAT_RG24, CFHD_ENCODED_FORMAT_RGB_444},
237 {RGBA, CFHD_PIXEL_FORMAT_BGRa, CFHD_ENCODED_FORMAT_RGBA_4444},
238 {v210, CFHD_PIXEL_FORMAT_V210, CFHD_ENCODED_FORMAT_YUV_422},
239 {R10k, CFHD_PIXEL_FORMAT_DPX0, CFHD_ENCODED_FORMAT_RGB_444},
240 {RG48, CFHD_PIXEL_FORMAT_RG48, CFHD_ENCODED_FORMAT_RGB_444},
242
244{
245 CFHD_Error status = CFHD_ERROR_OKAY;
246
247 if(s->started){
248 status = CFHD_StopEncoderPool(s->encoderPoolRef);
249 if(status != CFHD_ERROR_OKAY){
250 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to stop encoder pool\n");
251 return false;
252 }
253 }
254
256 int i = 0;
257 for(const auto &codec : codecs) {
258 to_convs[i++] = codec.ug_codec;
259 }
262 LOG(LOG_LEVEL_VERBOSE) << MOD_NAME << "Using " << get_codec_name(s->precompress_desc.color_spec) << " as intermediate.\n";
263
264 CFHD_PixelFormat pix_fmt = CFHD_PIXEL_FORMAT_UNKNOWN;
265 CFHD_EncodedFormat enc_fmt = CFHD_ENCODED_FORMAT_UNKNOWN;
266 for(const auto &codec : codecs){
267 if (codec.ug_codec == s->precompress_desc.color_spec){
268 pix_fmt = codec.cfhd_pixel_format;
269 enc_fmt = codec.cfhd_encoded_format;
270 break;
271 }
272 }
273
274 if(pix_fmt == CFHD_PIXEL_FORMAT_UNKNOWN){
275 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to find suitable pixel format\n");
276 return false;
277 }
278
279 status = CFHD_PrepareEncoderPool(s->encoderPoolRef,
280 desc.width,
281 desc.height,
282 pix_fmt,
283 enc_fmt,
284 CFHD_ENCODING_FLAGS_NONE,
286
287 if(status != CFHD_ERROR_OKAY){
288 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to prepare to encode\n");
289 return false;
290 }
291
295
296 s->saved_desc = desc;
297
298 status = CFHD_AttachEncoderPoolMetadata(s->encoderPoolRef, s->metadataRef);
299 if(status != CFHD_ERROR_OKAY){
300 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to attach metadata to encoder pool\n");
301 }
302
303 uint32_t fcc_tag = to_fourcc('U', 'G', 'P', 'F');
304 uint32_t val = desc.color_spec;
305 status = CFHD_MetadataAdd(s->metadataRef,
306 fcc_tag,
307 METADATATYPE_UINT32,
308 sizeof(uint32_t),
309 &val,
310 false);
311 if(status != CFHD_ERROR_OKAY){
312 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to add metadata %u\n", status);
313 }
314
315 status = CFHD_AttachEncoderPoolMetadata(s->encoderPoolRef, s->metadataRef);
316 if(status != CFHD_ERROR_OKAY){
317 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to attach metadata to encoder pool\n");
318 }
319
320 log_msg(LOG_LEVEL_INFO, "[cineform] start encoder pool\n");
321 status = CFHD_StartEncoderPool(s->encoderPoolRef);
322 if(status != CFHD_ERROR_OKAY){
323 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to start encoder pool\n");
324 return false;
325 }
326
327 s->started = true;
328 s->cv.notify_all();
329
330 return true;
331}
332
335 vf_copy_metadata(ret, frame); // seq and compress_start
336 int src_linesize = vc_get_linesize(frame->tiles[0].width, frame->color_spec);
337 int dst_linesize = vc_get_linesize(frame->tiles[0].width, ret->color_spec);
338 auto *dst = (unsigned char *) ret->tiles[0].data;
339 int dst_sign = 1;
340 if (s->precompress_desc.color_spec == RGB) { // upside down
341 dst += static_cast<size_t>(dst_linesize) *
342 (frame->tiles[0].height - 1);
343 dst_sign = -1;
344 }
345 for (long int i = 0; i < (long int) frame->tiles[0].height; ++i) {
346 s->dec(dst + dst_sign * i * dst_linesize, (unsigned char *) frame->tiles[0].data + i * src_linesize, dst_linesize, 16, 8, 0);
347 }
348
349 return ret;
350}
351
352static void cineform_compress_push(struct module *state, std::shared_ptr<video_frame> tx)
353{
354 struct state_video_compress_cineform *s = (struct state_video_compress_cineform *) state->priv_data;
355
356 CFHD_Error status = CFHD_ERROR_OKAY;
357 std::unique_lock<std::mutex> lock(s->mutex);
358
359 if(s->stop)
360 return;
361
362 if(!tx){
363 if (!s->started) {
364 video_desc desc{1920, 1080, UYVY, 25.0, PROGRESSIVE, 1};
366 }
367 std::unique_ptr<video_frame, decltype(&vf_free)> dummy(vf_alloc_desc_data(s->precompress_desc), vf_free);
368 video_frame *dummy_ptr = dummy.get();
369 vf_clear(dummy_ptr);
370
371 s->stop = true;
372 s->frame_queue.push(std::move(dummy));
373 lock.unlock();
374
375 status = CFHD_EncodeAsyncSample(s->encoderPoolRef,
376 s->frame_seq_in++,
377 dummy_ptr->tiles[0].data,
379 nullptr);
380 if(status != CFHD_ERROR_OKAY){
381 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to push null %i pool\n", status);
382 }
383 return;
384 }
385
386 assert(tx->tile_count == 1); // TODO
387
390 {
391 //cleanup(s);
392 int ret = configure_with(s, video_desc_from_frame(tx.get()));
393 if(!ret) {
394 return;
395 }
396 }
397
398 std::unique_ptr<video_frame, decltype(&vf_free)> frame_copy(get_copy(s, tx.get()), vf_free);
399 video_frame *frame_ptr = frame_copy.get();
400
401 s->frame_queue.push(std::move(frame_copy));
402
403#ifdef MEASUREMENT
404 struct timespec t_0;
405 clock_gettime(CLOCK_MONOTONIC_RAW, &t_0);
406
407 s->times_map[s->frame_seq_in] = t_0;
408#endif
409 lock.unlock();
410
411 status = CFHD_EncodeAsyncSample(s->encoderPoolRef,
412 s->frame_seq_in++,
413 frame_ptr->tiles[0].data,
415 nullptr);
416
417 if(status != CFHD_ERROR_OKAY){
418 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to push sample to encode pool\n");
419 return;
420 }
421}
422
423#ifdef MEASUREMENT
424static void timespec_diff(struct timespec *start, struct timespec *stop,
425 struct timespec *result)
426{
427 if ((stop->tv_nsec - start->tv_nsec) < 0) {
428 result->tv_sec = stop->tv_sec - start->tv_sec - 1;
429 result->tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000;
430 } else {
431 result->tv_sec = stop->tv_sec - start->tv_sec;
432 result->tv_nsec = stop->tv_nsec - start->tv_nsec;
433 }
434 return;
435}
436#endif
437
438static std::shared_ptr<video_frame> cineform_compress_pop(struct module *state)
439{
440 struct state_video_compress_cineform *s = (struct state_video_compress_cineform *) state->priv_data;
441
442 std::unique_lock<std::mutex> lock(s->mutex);
443
444 if(s->stop){
445 CFHD_SampleBufferRef buf;
446 uint32_t frame_num;
447 while(CFHD_TestForSample(s->encoderPoolRef, &frame_num, &buf) == CFHD_ERROR_OKAY){
448 CFHD_ReleaseSampleBuffer(s->encoderPoolRef, buf);
449 }
450 return {};
451 }
452
453 const auto& started = s->started;
454 while(!started)
455 s->cv.wait(lock, [&started](){return started;});
456
457 lock.unlock();
458
459 CFHD_Error status = CFHD_ERROR_OKAY;
460 uint32_t frame_num;
461 CFHD_SampleBufferRef buf;
462 status = CFHD_WaitForSample(s->encoderPoolRef,
463 &frame_num,
464 &buf);
465#if MEASUREMENT
466 struct timespec t_0, t_1, t_res;
467 clock_gettime(CLOCK_MONOTONIC_RAW, &t_1);
468 t_0 = s->times_map[frame_num];
469
470 timespec_diff(&t_0, &t_1, &t_res);
471
472 printf("[cineform] Encoding %u frame took %f miliseconds.\n", frame_num, t_res.tv_nsec / 1000000.0);
473#endif
474 if(status != CFHD_ERROR_OKAY){
475 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to wait for sample %d\n", status);
476 return {};
477 }
478
479 static auto dispose = [](struct video_frame *frame) {
480 std::tuple<CFHD_EncoderPoolRef, CFHD_SampleBufferRef> *t =
481 static_cast<std::tuple<CFHD_EncoderPoolRef, CFHD_SampleBufferRef> *>(frame->callbacks.dispose_udata);
482 if(t)
483 CFHD_ReleaseSampleBuffer(std::get<0>(*t), std::get<1>(*t));
484 vf_free(frame);
485 };
486
487 std::shared_ptr<video_frame> out = std::shared_ptr<video_frame>(vf_alloc_desc(s->compressed_desc), dispose);
488 size_t encoded_len;
489 status = CFHD_GetEncodedSample(buf,
490 (void **) &out->tiles[0].data,
491 &encoded_len);
492 out->tiles[0].data_len = encoded_len;
493 if(status != CFHD_ERROR_OKAY){
494 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to get sample data\n");
495 return {};
496 }
497 out->callbacks.dispose_udata = new std::tuple<CFHD_EncoderPoolRef, CFHD_SampleBufferRef>(s->encoderPoolRef, buf);
498 out->seq = frame_num;
499
500 lock.lock();
501 if(s->frame_queue.empty()){
502 log_msg(LOG_LEVEL_ERROR, "[cineform] Failed to pop\n");
503 } else {
504 auto &src = s->frame_queue.front();
505 vf_copy_metadata(out.get(), src.get());
506 }
507 s->frame_queue.pop();
508
509 out->compress_end = get_time_in_ns();
510
511 return out;
512}
513
515 compress_module_info module_info;
516 module_info.name = "cineform";
517
518 for(const auto& opt : usage_opts){
519 module_info.opts.emplace_back(module_option{opt.label,
520 opt.description, opt.placeholder, opt.key, opt.opt_str, false});
521 }
522
524 codec_info.name = "Cineform";
525 codec_info.priority = 400;
526 codec_info.encoders.emplace_back(encoder{"default", ""});
527
528 module_info.codecs.emplace_back(std::move(codec_info));
529
530 return module_info;
531}
532
534 "cineform",
536 NULL,
537 NULL,
538 NULL,
539 NULL,
543};
544
void ** state
int void * val
struct video_desc desc
struct video_frame * frame
const char * fmt
void vf_free(struct video_frame *buf)
Frees video_frame structure.
struct video_desc video_desc_from_frame(const struct video_frame *frame)
Returns struct video_desc from video frame.
int vc_get_linesize(unsigned int width, codec_t codec)
struct video_frame * vf_alloc_desc(struct video_desc desc)
Allocates video frame accordig given desc.
struct video_frame * vf_alloc_desc_data(struct video_desc desc)
const char * get_codec_name(codec_t codec)
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
#define LOG_LEVEL_VERBOSE
Definition debug.h:63
#define LOG(level)
Definition debug.h:313
void module_init_default(struct module *module_data)
Definition module.c:48
void module_register(struct module *module_data, struct module *parent)
Definition module.c:82
@ MODULE_CLASS_DATA
Definition module.h:86
#define VIDEO_COMPRESS_ABI_VERSION
#define INIT_NOERR
Definition host.h:73
@ LIBRARY_CLASS_VIDEO_COMPRESS
Definition lib_common.h:82
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
Definition lib_common.h:144
#define TOSTRING(A)
Definition macros.h:49
#define to_fourcc(a, b, c, d)
Creates FourCC word.
Definition macros.h:114
decoder_t get_best_decoder_from(codec_t in, const codec_t *out_candidates, codec_t *out)
decoder_func_t * decoder_t
Definition pixfmt_conv.h:96
static void start()
Definition sdp.c:202
const char * parent
Definition settings.cpp:198
const char * name
displayed name
std::vector< codec > codecs
std::vector< module_option > opts
Definition hd-rum.c:27
enum module_class cls
Definition module.h:115
void * priv_data
Definition module.h:126
module_deleter_t deleter
Definition module.h:118
struct video_desc compressed_desc
Definition cineform.cpp:85
CFHD_MetadataRef metadataRef
Definition cineform.cpp:94
CFHD_EncodingQuality requested_quality
Definition cineform.cpp:89
struct video_desc precompress_desc
Definition cineform.cpp:84
struct video_desc saved_desc
Definition cineform.cpp:83
std::queue< std::unique_ptr< video_frame, decltype(&vf_free)> > frame_queue
Definition cineform.cpp:99
std::condition_variable cv
Definition cineform.cpp:103
CFHD_EncoderPoolRef encoderPoolRef
Definition cineform.cpp:93
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 height
Definition types.h:281
unsigned int tile_count
Definition types.h:185
codec_t color_spec
Definition types.h:182
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
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
Definition types.h:345
struct video_frame_callbacks callbacks
Definition types.h:324
codec_t color_spec
Definition types.h:306
static time_ns_t get_time_in_ns()
Definition tv.h:101
@ PROGRESSIVE
progressive frame
Definition types.h:164
codec_t
Definition types.h:65
@ R10k
RGB 10-bit packed - RGBX, big-endian (2 bit padding)
Definition types.h:73
@ 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
@ RG48
16-bit RGB little-endian (RlRhGl...)
Definition types.h:95
@ CFHD
Cineform.
Definition types.h:94
@ VIDEO_CODEC_COUNT
count of known video codecs (including VIDEO_CODEC_NONE)
Definition types.h:108
@ RGBA
RGBA 8-bit, big-endian.
Definition types.h:70
@ v210
YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/),...
Definition types.h:75
This is an umbrella header for video functions.
static const struct codec_info_t codec_info[]
const char * placeholder
Definition cineform.cpp:128
codec_t ug_codec
Definition cineform.cpp:231
static video_frame * get_copy(struct state_video_compress_cineform *s, video_frame *frame)
Definition cineform.cpp:333
const char * opt_str
Definition cineform.cpp:127
#define DEFAULT_POOL_SIZE
Definition cineform.cpp:74
struct @75 usage_opts[]
static void cineform_compress_push(struct module *state, std::shared_ptr< video_frame > tx)
Definition cineform.cpp:352
static bool configure_with(struct state_video_compress_cineform *s, struct video_desc desc)
Definition cineform.cpp:243
static void usage()
Definition cineform.cpp:135
static struct module * cineform_compress_init(struct module *parent, const char *opts)
Definition cineform.cpp:178
CFHD_PixelFormat cfhd_pixel_format
Definition cineform.cpp:232
const char * description
Definition cineform.cpp:126
CFHD_EncodedFormat cfhd_encoded_format
Definition cineform.cpp:233
static std::shared_ptr< video_frame > cineform_compress_pop(struct module *state)
Definition cineform.cpp:438
static int parse_fmt(struct state_video_compress_cineform *s, char *fmt)
Definition cineform.cpp:144
#define MOD_NAME
Definition cineform.cpp:76
const char * label
Definition cineform.cpp:124
const struct video_compress_info cineform_info
Definition cineform.cpp:533
#define DEFAULT_THREAD_COUNT
Definition cineform.cpp:75
const char * key
Definition cineform.cpp:125
static void cineform_compress_done(struct module *mod)
Definition cineform.cpp:110
static struct @76 codecs[]
static compress_module_info get_cineform_module_info()
Definition cineform.cpp:514
API for video compress drivers.
void vf_clear(struct video_frame *f)
bool video_desc_eq_excl_param(struct video_desc a, struct video_desc b, unsigned int excluded_params)
Compares two video descriptions.
void vf_copy_metadata(struct video_frame *dest, const struct video_frame *src)
#define PARAM_TILE_COUNT
Definition video_frame.h:68