![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include "audio/audio.h"#include "audio/utils.h"#include "audio/wav_writer.h"#include "debug.h"#include "export.h"#include "utils/misc.h"#include "utils/ring_buffer.h"
Go to the source code of this file.
Classes | |
| struct | audio_export |
Macros | |
| #define | CACHE_SECONDS 10 |
Functions | |
| void | audio_export (struct audio_export *s, const struct audio_frame *frame) |
| bool | audio_export_configure_raw (struct audio_export *s, int bps, int sample_rate, int ch_count) |
| void | audio_export_destroy (struct audio_export *s) |
| struct audio_export * | audio_export_init (const char *filename) |
| void | audio_export_raw (struct audio_export *s, void *data, unsigned len) |
| void | audio_export_raw_ch (struct audio_export *s, const void **channels_data, unsigned sample_count) |
| static void * | audio_export_thread (void *arg) |
| static bool | configure (struct audio_export *s, struct audio_desc fmt) |
| static int | write_samples (char *out, const void **channels_data, int bps, int ch_count, int size, int start_sample) |
Definition in file export.c.
| #define CACHE_SECONDS 10 |
Definition at line 57 of file export.c.
Referenced by configure().
| void audio_export | ( | struct audio_export * | s, |
| const struct audio_frame * | frame ) |
Definition at line 221 of file export.c.
References audio_desc_eq(), audio_desc_from_frame(), audio_export_raw(), audio_export_thread(), audio_desc::ch_count, configure(), frame, audio_export::saved_format, and audio_export::thread_id.
Referenced by audio_play_dump_put_frame(), and export_audio().

| bool audio_export_configure_raw | ( | struct audio_export * | s, |
| int | bps, | ||
| int | sample_rate, | ||
| int | ch_count ) |
Configure audio export for exporting samples directly from a sample buffer. Cannot be called when export is already configured by a previous call to this function, or by audio_export().
Definition at line 136 of file export.c.
References AC_PCM, audio_export_thread(), audio_desc::bps, audio_desc::ch_count, audio_desc::codec, configure(), fmt, sample_rate, audio_export::saved_format, and audio_export::thread_id.
Referenced by reconfigure_echo().

| void audio_export_destroy | ( | struct audio_export * | s | ) |
Definition at line 182 of file export.c.
References audio_export::filename, audio_export::lock, audio_export::new_work_ready, audio_export::ring, ring_buffer_destroy(), audio_export::should_exit_worker, audio_export::thread_id, audio_export::wav, wav_writer_close(), audio_export::worker_cv, and audio_export::worker_waiting.
Referenced by disable_export().

| struct audio_export * audio_export_init | ( | const char * | filename | ) |
Definition at line 159 of file export.c.
References audio_export::filename, audio_export::lock, audio_export::new_work_ready, audio_export::ring, audio_export::saved_format, audio_export::should_exit_worker, audio_export::thread_id, audio_export::worker_cv, and audio_export::worker_waiting.
Referenced by audio_play_dump_reconfigure(), enable_export(), and reconfigure_echo().
| void audio_export_raw | ( | struct audio_export * | s, |
| void * | data, | ||
| unsigned | len ) |
For exporting audio directly from a sample buffer. Before using this, the audio_export needs to be configured with audio_export_configure_raw()
| len | size of data in bytes |
Definition at line 209 of file export.c.
References audio_desc::ch_count, len, audio_export::lock, audio_export::new_work_ready, audio_export::ring, ring_buffer_write(), audio_export::saved_format, audio_export::worker_cv, and audio_export::worker_waiting.
Referenced by audio_export().

| void audio_export_raw_ch | ( | struct audio_export * | s, |
| const void ** | channels_data, | ||
| unsigned | sample_count ) |
Export audio from separate sample buffers for each channel.
| channels_data | array of pointers to sample buffers |
| sample_count | number of samples to export |
Definition at line 262 of file export.c.
References audio_desc::bps, audio_desc::ch_count, len, audio_export::lock, audio_export::new_work_ready, audio_export::ring, ring_advance_write_idx(), ring_get_write_regions(), audio_export::saved_format, audio_export::worker_cv, audio_export::worker_waiting, and write_samples().
Referenced by echo_cancel().

|
static |
Definition at line 82 of file export.c.
References audio_desc::bps, audio_desc::ch_count, audio_export::lock, audio_export::new_work_ready, audio_export::ring, ring_buffer_read(), ring_get_current_size(), audio_export::saved_format, audio_export::should_exit_worker, ug_strerror(), audio_export::wav, wav_writer_write(), audio_export::worker_cv, and audio_export::worker_waiting.
Referenced by audio_export(), and audio_export_configure_raw().

|
static |
Definition at line 122 of file export.c.
References CACHE_SECONDS, audio_export::filename, fmt, audio_export::ring, ring_buffer_init(), audio_export::saved_format, audio_export::wav, and wav_writer_create().
Referenced by audio_export(), and audio_export_configure_raw().

|
static |
Definition at line 245 of file export.c.
Referenced by audio_export_raw_ch().