program to playback audio data to the speaker (GStreamer version) More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "conversation.h"
#include <gst/gst.h>
#include <gst/audio/gstaudiobasesrc.h>
#include <gst/app/gstappsrc.h>
#include <glib.h>
Go to the source code of this file.
Macros | |
#define | DEBUG_READ_PURE_OGG 1 |
#define | MAXLINE 4096 |
How much data to read in one go. More... | |
#define | BUFFER_TIME 1000 |
Max number of microseconds to buffer in audiosink. More... | |
#define | LATENCY_TIME 1000 |
Min number of microseconds to buffer in audiosink. More... | |
Functions | |
static void | sink_child_added (GstChildProxy *child_proxy, GObject *object, gchar *name, gpointer user_data) |
static void | ogg_pad_added (GstElement *element, GstPad *pad, gpointer data) |
static void | quit () |
static gboolean | bus_call (GstBus *bus, GstMessage *msg, gpointer data) |
static void | signalhandler (int s) |
static int | feed_buffer_to_gst (const char *audio, size_t b_len) |
static int | stdin_receiver (void *cls, const struct GNUNET_MessageHeader *msg) |
Message callback. More... | |
int | main (int argc, char **argv) |
Variables | |
struct GNUNET_MessageStreamTokenizer * | stdin_mst |
Tokenizer for the data we get from stdin. More... | |
static GstElement * | pipeline |
Main pipeline. More... | |
static GstElement * | source |
Appsrc instance into which we write data for the pipeline. More... | |
static GstElement * | demuxer |
static GstElement * | decoder |
static GstElement * | conv |
static GstElement * | resampler |
static GstElement * | sink |
static int | abort_read |
Set to 1 to break the reading loop. More... | |
program to playback audio data to the speaker (GStreamer version)
Definition in file gnunet-helper-audio-playback-gst.c.
#define DEBUG_READ_PURE_OGG 1 |
Definition at line 35 of file gnunet-helper-audio-playback-gst.c.
#define MAXLINE 4096 |
How much data to read in one go.
Definition at line 40 of file gnunet-helper-audio-playback-gst.c.
#define BUFFER_TIME 1000 |
Max number of microseconds to buffer in audiosink.
Default is 1000
Definition at line 46 of file gnunet-helper-audio-playback-gst.c.
#define LATENCY_TIME 1000 |
Min number of microseconds to buffer in audiosink.
Default is 1000
Definition at line 52 of file gnunet-helper-audio-playback-gst.c.
|
static |
Definition at line 82 of file gnunet-helper-audio-playback-gst.c.
References BUFFER_TIME, and LATENCY_TIME.
Referenced by main().
|
static |
Definition at line 96 of file gnunet-helper-audio-playback-gst.c.
References conv, data, resampler, and sink.
Referenced by main().
|
static |
Definition at line 115 of file gnunet-helper-audio-playback-gst.c.
References abort_read, pipeline, and source.
Referenced by bus_call(), main(), and signalhandler().
|
static |
Definition at line 126 of file gnunet-helper-audio-playback-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 164 of file gnunet-helper-audio-playback-gst.c.
References quit().
Referenced by main().
|
static |
Definition at line 171 of file gnunet-helper-audio-playback-gst.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_INFO, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_OK, GNUNET_SYSERR, and source.
Referenced by main(), and stdin_receiver().
|
static |
Message callback.
msg | message we received. |
Definition at line 233 of file gnunet-helper-audio-playback-gst.c.
References feed_buffer_to_gst(), GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO, GNUNET_OK, AudioMessage::header, msg, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 256 of file gnunet-helper-audio-playback-gst.c.
References _, abort_read, bus_call(), conv, decoder, demuxer, feed_buffer_to_gst(), getenv(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_log, GNUNET_log_setup(), GNUNET_MST_create(), GNUNET_MST_destroy(), GNUNET_MST_from_buffer(), GNUNET_NO, GNUNET_OK, gst_element_factory_make, consensus-simulation::int, MAXLINE, ogg_pad_added(), pipeline, quit(), resampler, ret, signalhandler(), sink, sink_child_added(), source, stdin_mst, and stdin_receiver().
struct GNUNET_MessageStreamTokenizer* stdin_mst |
Tokenizer for the data we get from stdin.
Definition at line 57 of file gnunet-helper-audio-playback-gst.c.
Referenced by main().
|
static |
Main pipeline.
Definition at line 62 of file gnunet-helper-audio-playback-gst.c.
Referenced by main(), pl_graph(), and quit().
|
static |
Appsrc instance into which we write data for the pipeline.
Definition at line 67 of file gnunet-helper-audio-playback-gst.c.
Referenced by callback_room_connect(), channel_new_cb(), convert_from_ed_to_curve(), feed_buffer_to_gst(), get_audiobin(), GNUNET_BIO_write_spec_commit(), GNUNET_BIO_write_spec_object(), main(), quit(), t_ax_hmac_hash(), t_hmac_derive_key(), u_address_add(), write_spec_handler_int32(), write_spec_handler_int64(), write_spec_handler_meta_data(), write_spec_handler_object(), write_spec_handler_string(), write_to_buffer(), and write_to_file().
|
static |
Definition at line 69 of file gnunet-helper-audio-playback-gst.c.
Referenced by get_coder(), and main().
|
static |
Definition at line 70 of file gnunet-helper-audio-playback-gst.c.
Referenced by decoder_ogg_pad_added(), get_coder(), and main().
|
static |
Definition at line 71 of file gnunet-helper-audio-playback-gst.c.
Referenced by get_audiobin(), GNUNET_SQ_bind(), GNUNET_SQ_extract_result(), main(), and ogg_pad_added().
|
static |
Definition at line 72 of file gnunet-helper-audio-playback-gst.c.
Referenced by get_audiobin(), main(), and ogg_pad_added().
|
static |
Definition at line 73 of file gnunet-helper-audio-playback-gst.c.
Referenced by get_audiobin(), main(), and ogg_pad_added().
|
static |
Set to 1 to break the reading loop.
Definition at line 78 of file gnunet-helper-audio-playback-gst.c.