#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include <math.h>
#include "spandsp/telephony.h"
#include "spandsp/logging.h"
#include "spandsp/queue.h"
#include "spandsp/async.h"
#include "spandsp/biquad.h"
#include "spandsp/ec_disable_tone.h"
#include "spandsp/power_meter.h"
#include "spandsp/fsk.h"
#include "spandsp/v8.h"
Defines | |
#define | ms_to_samples(t) (((t)*SAMPLE_RATE)/1000) |
#define | V8_CI_SYNC 1 |
#define | V8_CM_SYNC 2 |
Enumerations | |
enum | { V8_WAIT_1S, V8_CI, V8_CI_ON, V8_CI_OFF, V8_HEARD_ANSAM, V8_CM_ON, V8_CJ_ON, V8_CM_WAIT, V8_SIGC, V8_WAIT_200MS, V8_JM_ON, V8_SIGA, V8_PARKED } |
Functions | |
void | v8_log_supported_modulations (v8_state_t *s, int modulation_schemes) |
Log the list of supported modulations. | |
void | v8_log_selected_modulation (v8_state_t *s, int modulation_scheme) |
Log the selected modulation. | |
int | v8_tx (v8_state_t *s, int16_t *amp, int max_len) |
Generate a block of V.8 audio samples. | |
int | v8_rx (v8_state_t *s, const int16_t *amp, int len) |
Process a block of received V.8 audio samples. | |
v8_state_t * | v8_init (v8_state_t *s, int caller, int available_modulations, v8_result_handler_t *result_handler, void *user_data) |
Initialise a V.8 context. | |
int | v8_release (v8_state_t *s) |
Release a V.8 context. | |
Variables | |
enum { ... } | v8_states_e |
v8_state_t* v8_init | ( | v8_state_t * | s, | |
int | caller, | |||
int | available_modulations, | |||
v8_result_handler_t * | result_handler, | |||
void * | user_data | |||
) |
Initialise a V.8 context.
Initialise a V.8 context.
s | The V.8 context. | |
caller | TRUE if caller mode, else answerer mode. | |
available_modulations | A bitwise list of the modulation schemes to be advertised as available here. | |
result_handler | The callback routine used to handle the results of negotiation. | |
user_data | An opaque pointer passed to the result_handler routine. |
void v8_log_selected_modulation | ( | v8_state_t * | s, | |
int | modulation_scheme | |||
) |
Log the selected modulation.
Log the selected modulation.
s | The V.8 context. | |
modulation_scheme | The selected modulation. |
void v8_log_supported_modulations | ( | v8_state_t * | s, | |
int | modulation_schemes | |||
) |
Log the list of supported modulations.
Log the list of supported modulations.
s | The V.8 context. | |
modulation_schemes | The list of supported modulations. |
int v8_release | ( | v8_state_t * | s | ) |
Release a V.8 context.
Release a V.8 context.
s | The V.8 context. |
int v8_rx | ( | v8_state_t * | s, | |
const int16_t * | amp, | |||
int | len | |||
) |
Process a block of received V.8 audio samples.
Process a block of received V.8 audio samples.
s | The V.8 context. | |
amp | The audio sample buffer. | |
len | The number of samples in the buffer. |
int v8_tx | ( | v8_state_t * | s, | |
int16_t * | amp, | |||
int | max_len | |||
) |
Generate a block of V.8 audio samples.
Generate a block of V.8 audio samples.
s | The V.8 context. | |
amp | The audio sample buffer. | |
max_len | The number of samples to be generated. |