UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
export.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void export_audio (struct exporter *state, struct audio_frame *frame)
 
void export_destroy (struct exporter *state)
 
struct exporter * export_init (struct module *parent, const char *cfg, bool should_export)
 
void export_video (struct exporter *state, struct video_frame *frame)
 

Detailed Description

Author
Martin Pulec pulec.nosp@m.@ces.nosp@m.net.c.nosp@m.z

Definition in file export.h.

Function Documentation

◆ export_audio()

void export_audio ( struct exporter * state,
struct audio_frame * frame )

Definition at line 341 of file export.c.

342{
343 if(!s){
344 return;
345 }
346
348
349 pthread_mutex_lock(&s->lock);
350 if (s->exporting) {
351 audio_export(s->audio_export, frame);
352 }
353 pthread_mutex_unlock(&s->lock);
354}
struct video_frame * frame
void audio_export(struct audio_export *s, const struct audio_frame *frame)
Definition export.c:221
static void process_messages(struct exporter *s)
Definition export.c:317

References audio_export(), exporter::audio_export, exporter::exporting, frame, exporter::lock, and process_messages().

Referenced by audio_sender_thread().

Here is the call graph for this function:

◆ export_destroy()

void export_destroy ( struct exporter * state)

Definition at line 308 of file export.c.

308 {
310
311 pthread_mutex_destroy(&s->lock);
312 module_done(&s->mod);
313 free(s->dir);
314 free(s);
315}
static void disable_export(struct exporter *s)
Definition export.c:296
void module_done(struct module *module_data)
Definition module.c:93

References exporter::dir, disable_export(), exporter::lock, exporter::mod, and module_done().

Referenced by display_dump_done(), and main().

Here is the call graph for this function:

◆ export_init()

struct exporter * export_init ( struct module * parent,
const char * cfg,
bool should_export )

Definition at line 149 of file export.c.

150{
151 struct exporter *s = calloc(1, sizeof(struct exporter));
152 pthread_mutex_init(&s->lock, NULL);
153 s->limit = -1;
154
155 if (!parse_options(s, cfg, &should_export)) {
157 }
158 if (s->dir == NULL) {
159 s->dir_auto = true;
160 }
161
162 if (should_export) {
163 if (!enable_export(s)) {
165 }
166 }
167
171 s->mod.priv_data = s;
173
174 return s;
175}
static bool enable_export(struct exporter *s)
Definition export.c:177
static bool parse_options(struct exporter *s, const char *ccfg, bool *should_export)
Definition export.c:106
#define HANDLE_ERROR
Definition export.c:147
static void new_msg(struct module *mod)
Definition export.c:85
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_EXPORTER
Definition module.h:96
const char * parent
Definition settings.cpp:198
pthread_mutex_t lock
Definition export.c:74
struct module mod
Definition export.c:65
long long int limit
number of video frames to record, -1 == unlimited (default)
Definition export.c:76
bool dir_auto
Definition export.c:68
char * dir
Definition export.c:66
enum module_class cls
Definition module.h:115
void * priv_data
Definition module.h:126
notify_t new_message
if set, notifies module that new message is in queue, receiver lock is hold during the call
Definition module.h:119

References module::cls, exporter::dir, exporter::dir_auto, enable_export(), HANDLE_ERROR, exporter::limit, exporter::lock, exporter::mod, MODULE_CLASS_EXPORTER, module_init_default(), module_register(), module::new_message, new_msg(), parent, parse_options(), and module::priv_data.

Referenced by display_dump_init(), and main().

Here is the call graph for this function:

◆ export_video()

void export_video ( struct exporter * state,
struct video_frame * frame )

Definition at line 356 of file export.c.

357{
358 if(!s){
359 return;
360 }
361
363
364 pthread_mutex_lock(&s->lock);
365 if (s->exporting) {
366 video_export(s->video_export, frame);
367 }
368 if (s->limit > 0) {
369 if (--s->limit == 0) {
370 log_msg(LOG_LEVEL_NOTICE, MOD_NAME "Stopping export - limit reached.\n");
372 if (s->exit_on_limit) {
373 exit_uv(0);
374 }
375 }
376 }
377 pthread_mutex_unlock(&s->lock);
378}
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 MOD_NAME
Definition export.c:62
void exit_uv(int status)
Definition host.cpp:625
void video_export(struct video_export *s, struct video_frame *frame)

References disable_export(), exporter::exit_on_limit, exit_uv(), exporter::exporting, frame, exporter::limit, exporter::lock, LOG_LEVEL_NOTICE, log_msg(), MOD_NAME, process_messages(), exporter::video_export, and video_export().

Referenced by display_dump_putf(), and video_rxtx::sender_loop().

Here is the call graph for this function: