program to record audio data from the microphone (GStreamer version) More...
#include "platform.h"
#include "gnunet_protocols.h"
#include "conversation.h"
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <gst/audio/gstaudiobasesrc.h>
#include <glib.h>
Go to the source code of this file.
Macros | |
#define | DEBUG_RECORD_PURE_OGG 1 |
#define | OPUS_CHANNELS 1 |
Number of channels. More... | |
#define | MAX_PAYLOAD_SIZE (1024 / OPUS_CHANNELS) |
Maximal size of a single opus packet. More... | |
#define | OPUS_FRAME_SIZE 40 |
Size of a single frame fed to the encoder, in ms. More... | |
#define | PACKET_LOSS_PERCENTAGE 1 |
Expected packet loss to prepare for, in percents. More... | |
#define | INBAND_FEC_MODE 1 |
Set to 1 to enable forward error correction. More... | |
#define | BUFFER_TIME 1000 /* 1ms */ |
Max number of microseconds to buffer in audiosource. More... | |
#define | LATENCY_TIME 1000 /* 1ms */ |
Min number of microseconds to buffer in audiosource. More... | |
#define | OGG_MAX_DELAY 0 |
Maximum delay in multiplexing streams, in ns. More... | |
#define | OGG_MAX_PAGE_DELAY 0 |
Maximum delay for sending out a page, in ns. More... | |
Functions | |
static void | quit () |
static gboolean | bus_call (GstBus *bus, GstMessage *msg, gpointer data) |
static void | source_child_added (GstChildProxy *child_proxy, GObject *object, gchar *name, gpointer user_data) |
static void | signalhandler (int s) |
int | main (int argc, char **argv) |
Variables | |
static GstElement * | pipeline |
Main pipeline. More... | |
static int | dump_pure_ogg |
program to record audio data from the microphone (GStreamer version)
Definition in file gnunet-helper-audio-record-gst.c.
#define DEBUG_RECORD_PURE_OGG 1 |
Definition at line 34 of file gnunet-helper-audio-record-gst.c.
#define OPUS_CHANNELS 1 |
Number of channels.
Must be one of the following (from libopusenc documentation): 1, 2
Definition at line 41 of file gnunet-helper-audio-record-gst.c.
#define MAX_PAYLOAD_SIZE (1024 / OPUS_CHANNELS) |
Maximal size of a single opus packet.
Definition at line 46 of file gnunet-helper-audio-record-gst.c.
#define OPUS_FRAME_SIZE 40 |
Size of a single frame fed to the encoder, in ms.
Must be one of the following (from libopus documentation): 2.5, 5, 10, 20, 40 or 60
Definition at line 53 of file gnunet-helper-audio-record-gst.c.
#define PACKET_LOSS_PERCENTAGE 1 |
Expected packet loss to prepare for, in percents.
Definition at line 58 of file gnunet-helper-audio-record-gst.c.
#define INBAND_FEC_MODE 1 |
Set to 1 to enable forward error correction.
Set to 0 to disable.
Definition at line 64 of file gnunet-helper-audio-record-gst.c.
#define BUFFER_TIME 1000 /* 1ms */ |
Max number of microseconds to buffer in audiosource.
Default is 200000
Definition at line 70 of file gnunet-helper-audio-record-gst.c.
#define LATENCY_TIME 1000 /* 1ms */ |
Min number of microseconds to buffer in audiosource.
Default is 10000
Definition at line 76 of file gnunet-helper-audio-record-gst.c.
#define OGG_MAX_DELAY 0 |
Maximum delay in multiplexing streams, in ns.
Setting this to 0 forces page flushing, which decreases delay, but increases overhead.
Definition at line 83 of file gnunet-helper-audio-record-gst.c.
#define OGG_MAX_PAGE_DELAY 0 |
Maximum delay for sending out a page, in ns.
Setting this to 0 forces page flushing, which decreases delay, but increases overhead.
Definition at line 90 of file gnunet-helper-audio-record-gst.c.
|
static |
Definition at line 102 of file gnunet-helper-audio-record-gst.c.
References pipeline.
Referenced by bus_call(), main(), and signalhandler().
|
static |
Definition at line 110 of file gnunet-helper-audio-record-gst.c.
References find_typedefs::debug, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, msg, and quit().
Referenced by main().
|
static |
Definition at line 144 of file gnunet-helper-audio-record-gst.c.
References BUFFER_TIME, and LATENCY_TIME.
Referenced by main().
|
static |
Definition at line 154 of file gnunet-helper-audio-record-gst.c.
References quit().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 161 of file gnunet-helper-audio-record-gst.c.
References audio_message, bus_call(), conv, dump_pure_ogg, filter, getenv(), GNUNET_assert, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_log_setup(), GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO, GNUNET_OK, gst_element_factory_make, AudioMessage::header, INBAND_FEC_MODE, consensus-simulation::int, m, MAX_PAYLOAD_SIZE, OGG_MAX_DELAY, OGG_MAX_PAGE_DELAY, OPUS_CHANNELS, OPUS_FRAME_SIZE, PACKET_LOSS_PERCENTAGE, phase, pipeline, quit(), resampler, ret, signalhandler(), sink, GNUNET_MessageHeader::size, source, source_child_added(), and GNUNET_MessageHeader::type.
|
static |
Main pipeline.
Definition at line 95 of file gnunet-helper-audio-record-gst.c.
|
static |
Definition at line 98 of file gnunet-helper-audio-record-gst.c.
Referenced by main().