61 static char *playback_helper_argv[] = {
62 (
char*)
"gnunet-helper-audio-playback",
68 "gnunet-helper-audio-playback",
75 _ (
"Could not start playback audio helper.\n"));
constants for network protocols
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static struct GNUNET_SPEAKER_Handle * speaker
Handle to the speaker.
static char * data
The data to insert into the dht.
static size_t data_size
Number of bytes in data.
API to access an audio speaker; provides access to hardware speakers.
struct GNUNET_HELPER_SendHandle * GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h, const struct GNUNET_MessageHeader *msg, bool can_drop, GNUNET_HELPER_Continuation cont, void *cont_cls)
Send an message to the helper.
struct GNUNET_HELPER_Handle * GNUNET_HELPER_start(const struct GNUNET_OS_ProjectData *pd, int with_control_pipe, const char *binary_name, char *const binary_argv[], GNUNET_MessageTokenizerCallback cb, GNUNET_HELPER_ExceptionCallback exp_cb, void *cb_cls)
Starts a helper and begins reading from it.
enum GNUNET_GenericReturnValue GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
void GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h)
Free's the resources occupied by the helper handle.
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_log(kind,...)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
Message to transmit the audio between helper and speaker/microphone library.
struct GNUNET_SPEAKER_Handle * GNUNET_SPEAKER_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle *cfg)
Create a speaker that corresponds to the speaker hardware of our system.
void GNUNET_SPEAKER_destroy(struct GNUNET_SPEAKER_Handle *speaker)
Destroy a speaker.
static void disable(void *cls)
Function that disables a speaker.
static int enable(void *cls)
Function that enables a speaker.
static void destroy(void *cls)
Function to destroy a speaker.
static void play(void *cls, size_t data_size, const void *data)
Function to cause a speaker to play audio data.
Message to transmit the audio (between client and helpers).
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO.
The handle to a helper process.
A speaker is a device that can play or record audio data.
GNUNET_SPEAKER_DestroyCallback destroy_speaker
Destroy the speaker.
void * cls
Closure for the callbacks.
GNUNET_SPEAKER_PlayCallback play
Play audio.
GNUNET_SPEAKER_EnableCallback enable_speaker
Turn on the speaker.
GNUNET_SPEAKER_DisableCallback disable_speaker
Turn the speaker off.
Internal data structures for the speaker.
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct GNUNET_HELPER_Handle * playback_helper
Handle for the playback helper.