mediastreamer2 5.2.0
Data Structures | Macros | Typedefs | Enumerations | Functions
Audio streaming API - Create and run VoIP audio streams.

Audio streaming API - Easily run audio streams from soundcard or wav files to RTP. More...

Collaboration diagram for Audio streaming API - Create and run VoIP audio streams.:

Data Structures

struct  _MSMediaResource
 
struct  _MSMediaStreamIO
 
struct  _AudioStream
 

Macros

#define media_stream_is_secured   media_stream_secured
 
#define ms_media_resource_get_file(r)   (((r)->type == MSResourceFile) ? (r)->file : NULL)
 
#define ms_media_resource_get_rtp_session(r)   (((r)->type == MSResourceRtp) ? (r)->session : NULL)
 
#define ms_media_resource_get_camera(r)   (((r)->type == MSResourceCamera) ? (r)->camera : NULL)
 
#define ms_media_resource_get_soundcard(r)   (((r)->type == MSResourceSoundcard) ? (r)->soundcard : NULL)
 
#define MS_MEDIA_STREAM_IO_INITIALIZER   { {MSResourceInvalid}, {MSResourceInvalid} }
 
#define AUDIO_STREAM_FEATURE_PLC   (1 << 0)
 
#define AUDIO_STREAM_FEATURE_EC   (1 << 1)
 
#define AUDIO_STREAM_FEATURE_EQUALIZER   (1 << 2)
 
#define AUDIO_STREAM_FEATURE_VOL_SND   (1 << 3)
 
#define AUDIO_STREAM_FEATURE_VOL_RCV   (1 << 4)
 
#define AUDIO_STREAM_FEATURE_DTMF   (1 << 5)
 
#define AUDIO_STREAM_FEATURE_DTMF_ECHO   (1 << 6)
 
#define AUDIO_STREAM_FEATURE_MIXED_RECORDING   (1 << 7)
 
#define AUDIO_STREAM_FEATURE_LOCAL_PLAYING   (1 << 8)
 
#define AUDIO_STREAM_FEATURE_REMOTE_PLAYING   (1 << 9)
 
#define AUDIO_STREAM_FEATURE_FLOW_CONTROL   (1 << 10)
 
#define AUDIO_STREAM_FEATURE_ALL
 
#define AUDIOSTREAMVOLUMES_NOT_FOUND   INT16_MIN
 

Typedefs

typedef enum EchoLimiterType EchoLimiterType
 
typedef enum EqualizerLocation EqualizerLocation
 
typedef enum MSResourceType MSResourceType
 
typedef struct _MSMediaResource MSMediaResource
 
typedef struct _MSMediaStreamIO MSMediaStreamIO
 
typedef void(* AudioStreamIsSpeakingCallback) (void *user_pointer, uint32_t speaker_ssrc, bool_t is_speaking)
 
typedef void(* AudioStreamIsMutedCallback) (void *user_pointer, uint32_t speaker_ssrc, bool_t is_muted)
 
typedef void(* MSAudioRouteChangedCallback) (void *audioStream, bool_t needReloadSoundDevices, char *newInputPort, char *newOutputPort)
 
typedef struct _AudioStream AudioStream
 
typedef struct _AudioStreamVolumes AudioStreamVolumes
 

Enumerations

enum  EchoLimiterType {
  ELInactive ,
  ELControlMic ,
  ELControlFull
}
 
enum  EqualizerLocation {
  MSEqualizerHP = 0 ,
  MSEqualizerMic
}
 
enum  MSResourceType {
  MSResourceInvalid ,
  MSResourceDefault ,
  MSResourceFile ,
  MSResourceRtp ,
  MSResourceCamera ,
  MSResourceSoundcard ,
  MSResourceVoid ,
  MSResourceItc
}
 

Functions

bool_t media_stream_started (MediaStream *stream)
 
int media_stream_join_multicast_group (MediaStream *stream, const char *ip)
 
bool_t media_stream_dtls_supported (void)
 
void media_stream_enable_dtls (MediaStream *stream, const MSDtlsSrtpParams *params)
 
void media_stream_set_rtcp_information (MediaStream *stream, const char *cname, const char *tool)
 
void media_stream_get_local_rtp_stats (MediaStream *stream, rtp_stats_t *stats)
 
int media_stream_set_dscp (MediaStream *stream, int dscp)
 
void media_stream_enable_adaptive_bitrate_control (MediaStream *stream, bool_t enabled)
 
void media_stream_set_adaptive_bitrate_algorithm (MediaStream *stream, MSQosAnalyzerAlgorithm algorithm)
 
void media_stream_enable_adaptive_jittcomp (MediaStream *stream, bool_t enabled)
 
void media_stream_set_ice_check_list (MediaStream *stream, IceCheckList *cl)
 
void media_stream_set_stun_allowed (MediaStream *stream, bool_t value)
 
bool_t media_stream_enable_srtp (MediaStream *stream, MSCryptoSuite suite, const char *snd_key, const char *rcv_key)
 
bool_t media_stream_secured (const MediaStream *stream)
 
bool_t media_stream_avpf_enabled (const MediaStream *stream)
 
uint16_t media_stream_get_avpf_rr_interval (const MediaStream *stream)
 
RtpSession * media_stream_get_rtp_session (const MediaStream *stream)
 
const MSQualityIndicator * media_stream_get_quality_indicator (MediaStream *stream)
 
float media_stream_get_quality_rating (MediaStream *stream)
 
float media_stream_get_average_quality_rating (MediaStream *stream)
 
float media_stream_get_lq_quality_rating (MediaStream *stream)
 
float media_stream_get_average_lq_quality_rating (MediaStream *stream)
 
int media_stream_set_target_network_bitrate (MediaStream *stream, int target_bitrate)
 
int media_stream_set_max_network_bitrate (MediaStream *stream, int max_bitrate)
 
int media_stream_get_target_network_bitrate (const MediaStream *stream)
 
float media_stream_get_up_bw (const MediaStream *stream)
 
float media_stream_get_down_bw (const MediaStream *stream)
 
float media_stream_get_rtcp_up_bw (const MediaStream *stream)
 
float media_stream_get_rtcp_down_bw (const MediaStream *stream)
 
void media_stream_reclaim_sessions (MediaStream *stream, MSMediaStreamSessions *sessions)
 
void media_stream_iterate (MediaStream *stream)
 
void media_stream_set_direction (MediaStream *stream, MediaStreamDir dir)
 
MediaStreamDir media_stream_get_direction (const MediaStream *stream)
 
bool_t media_stream_alive (MediaStream *stream, int timeout_seconds)
 
MSStreamState media_stream_get_state (const MediaStream *stream)
 
OrtpEvDispatcher * media_stream_get_event_dispatcher (const MediaStream *stream)
 
uint32_t media_stream_get_recv_ssrc (const MediaStream *stream)
 
uint32_t media_stream_get_send_ssrc (const MediaStream *stream)
 
const char * ms_resource_type_to_string (MSResourceType type)
 
bool_t ms_media_resource_is_consistent (const MSMediaResource *r)
 
bool_t ms_media_stream_io_is_consistent (const MSMediaStreamIO *io)
 
AudioStreamaudio_stream_start (MSFactory *factory, RtpProfile *prof, int locport, const char *remip, int remport, int payload_type, int jitt_comp, bool_t echo_cancel)
 
AudioStreamaudio_stream_start_with_sndcards (MSFactory *factory, RtpProfile *prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t echocancel)
 
int audio_stream_start_with_files (AudioStream *stream, RtpProfile *prof, const char *remip, int remport, int rem_rtcp_port, int pt, int jitt_comp, const char *infile, const char *outfile)
 
int audio_stream_start_from_io (AudioStream *stream, RtpProfile *profile, const char *rem_rtp_ip, int rem_rtp_port, const char *rem_rtcp_ip, int rem_rtcp_port, int payload_type, const MSMediaStreamIO *io)
 
int audio_stream_start_full (AudioStream *stream, RtpProfile *profile, const char *rem_rtp_ip, int rem_rtp_port, const char *rem_rtcp_ip, int rem_rtcp_port, int payload, int jitt_comp, const char *infile, const char *outfile, MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec)
 
void audio_stream_play (AudioStream *st, const char *name)
 
void audio_stream_record (AudioStream *st, const char *name)
 
void audio_stream_play_received_dtmfs (AudioStream *st, bool_t yesno)
 
AudioStreamaudio_stream_new (MSFactory *factory, int loc_rtp_port, int loc_rtcp_port, bool_t ipv6)
 
AudioStreamaudio_stream_new2 (MSFactory *factory, const char *ip, int loc_rtp_port, int loc_rtcp_port)
 
AudioStreamaudio_stream_new_with_sessions (MSFactory *factory, const MSMediaStreamSessions *sessions)
 
uint32_t audio_stream_get_features (AudioStream *st)
 
void audio_stream_set_features (AudioStream *st, uint32_t features)
 
void audio_stream_prepare_sound (AudioStream *st, MSSndCard *playcard, MSSndCard *captcard)
 
void audio_stream_unprepare_sound (AudioStream *st)
 
bool_t audio_stream_started (AudioStream *stream)
 
int audio_stream_start_now (AudioStream *stream, RtpProfile *prof, const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t echo_cancel)
 
void audio_stream_set_relay_session_id (AudioStream *stream, const char *relay_session_id)
 
bool_t audio_stream_alive (AudioStream *stream, int timeout)
 
void audio_stream_iterate (AudioStream *stream)
 
void audio_stream_enable_echo_limiter (AudioStream *stream, EchoLimiterType type)
 
void audio_stream_enable_gain_control (AudioStream *stream, bool_t val)
 
void audio_stream_enable_automatic_gain_control (AudioStream *stream, bool_t val)
 
void audio_stream_set_echo_canceller_params (AudioStream *st, int tail_len_ms, int delay_ms, int framesize)
 
void audio_stream_enable_echo_canceller (AudioStream *st, bool_t enabled)
 
void audio_stream_disable_record_on_mute (AudioStream *stream, bool_t disable)
 
void audio_stream_enable_mic (AudioStream *stream, bool_t enable)
 
void audio_stream_set_mic_gain_db (AudioStream *stream, float gain_db)
 
void audio_stream_set_mic_gain (AudioStream *stream, float gain)
 
void audio_stream_mute_rtp (AudioStream *stream, bool_t val)
 
void audio_stream_set_spk_gain_db (AudioStream *stream, float gain_db)
 
void audio_stream_set_spk_gain (AudioStream *stream, float gain)
 
void audio_stream_set_sound_card_input_gain (AudioStream *stream, float gain)
 
float audio_stream_get_sound_card_input_gain (const AudioStream *stream)
 
void audio_stream_set_sound_card_output_gain (AudioStream *stream, float volume)
 
float audio_stream_get_sound_card_output_gain (const AudioStream *stream)
 
void audio_stream_enable_noise_gate (AudioStream *stream, bool_t val)
 
void audio_stream_enable_equalizer (AudioStream *stream, EqualizerLocation location, bool_t enabled)
 
void audio_stream_equalizer_set_gain (AudioStream *stream, EqualizerLocation location, const MSEqualizerGain *gain)
 
void audio_stream_stop (AudioStream *stream)
 
int audio_stream_send_dtmf (AudioStream *stream, char dtmf)
 
MSFilteraudio_stream_get_local_player (AudioStream *stream)
 
int audio_stream_set_mixed_record_file (AudioStream *st, const char *filename)
 
int audio_stream_mixed_record_start (AudioStream *st)
 
int audio_stream_mixed_record_stop (AudioStream *st)
 
MSFilteraudio_stream_open_remote_play (AudioStream *stream, const char *filename)
 
void audio_stream_close_remote_play (AudioStream *stream)
 
void audio_stream_set_default_card (int cardindex)
 
float audio_stream_get_quality_rating (AudioStream *stream)
 
float audio_stream_get_average_quality_rating (AudioStream *stream)
 
float audio_stream_get_lq_quality_rating (AudioStream *stream)
 
float audio_stream_get_average_lq_quality_rating (AudioStream *stream)
 
void audio_stream_enable_zrtp (AudioStream *stream, MSZrtpParams *params)
 
void audio_stream_start_zrtp (AudioStream *stream)
 
bool_t audio_stream_zrtp_enabled (const AudioStream *stream)
 
void audio_stream_set_mixer_to_client_extension_id (AudioStream *stream, int extension_id)
 
void audio_stream_set_client_to_mixer_extension_id (AudioStream *stream, int extension_id)
 
void audio_stream_set_is_speaking_callback (AudioStream *s, AudioStreamIsSpeakingCallback cb, void *user_pointer)
 
void audio_stream_set_is_muted_callback (AudioStream *s, AudioStreamIsMutedCallback cb, void *user_pointer)
 
int audio_stream_get_participant_volume (const AudioStream *stream, uint32_t participant_ssrc)
 
uint32_t audio_stream_get_recv_ssrc (const AudioStream *stream)
 
uint32_t audio_stream_get_send_ssrc (const AudioStream *stream)
 
AudioStreamVolumes * audio_stream_volumes_new (void)
 
void audio_stream_volumes_delete (AudioStreamVolumes *volumes)
 
void audio_stream_volumes_insert (AudioStreamVolumes *volumes, uint32_t ssrc, int volume)
 
void audio_stream_volumes_erase (AudioStreamVolumes *volumes, uint32_t ssrc)
 
void audio_stream_volumes_clear (AudioStreamVolumes *volumes)
 
int audio_stream_volumes_size (AudioStreamVolumes *volumes)
 
int audio_stream_volumes_find (AudioStreamVolumes *volumes, uint32_t ssrc)
 
int audio_stream_volumes_append (AudioStreamVolumes *volumes, AudioStreamVolumes *append)
 
void audio_stream_volumes_reset_values (AudioStreamVolumes *volumes)
 
void audio_stream_volumes_populate_audio_levels (AudioStreamVolumes *volumes, rtp_audio_level_t *audio_levels)
 
bool_t audio_stream_volumes_is_speaking (AudioStreamVolumes *volumes)
 
uint32_t audio_stream_volumes_get_best (AudioStreamVolumes *volumes)
 

Detailed Description

Audio streaming API - Easily run audio streams from soundcard or wav files to RTP.

Macro Definition Documentation

◆ AUDIO_STREAM_FEATURE_ALL

#define AUDIO_STREAM_FEATURE_ALL
Value:
(\
AUDIO_STREAM_FEATURE_PLC | \
AUDIO_STREAM_FEATURE_EC | \
AUDIO_STREAM_FEATURE_EQUALIZER | \
AUDIO_STREAM_FEATURE_VOL_SND | \
AUDIO_STREAM_FEATURE_VOL_RCV | \
AUDIO_STREAM_FEATURE_DTMF | \
AUDIO_STREAM_FEATURE_DTMF_ECHO |\
AUDIO_STREAM_FEATURE_MIXED_RECORDING |\
AUDIO_STREAM_FEATURE_LOCAL_PLAYING | \
AUDIO_STREAM_FEATURE_REMOTE_PLAYING | \
AUDIO_STREAM_FEATURE_FLOW_CONTROL \
)

Typedef Documentation

◆ AudioStream

typedef struct _AudioStream AudioStream

The AudioStream holds all resources to create and run typical VoIP audiostream.

◆ MSMediaResource

Structure describing the input or the output of a MediaStream. type must be set to one the member of the MSResourceType enum, and the correspoding resource argument must be set: the file name (const char*) for MSResourceFile, the RtpSession for MSResourceRtp, an MSWebCam for MSResourceCamera, an MSSndCard for MSResourceSoundcard. an MSFilter for MSResourceItc

Warning
due to implementation, if RTP is to be used for input and output, the same RtpSession must be passed for both sides.

◆ MSMediaStreamIO

Structure describing the input/output of a MediaStream. Input and output are described as MSMediaResource.

Function Documentation

◆ audio_stream_disable_record_on_mute()

void audio_stream_disable_record_on_mute ( AudioStream stream,
bool_t  disable 
)

Calling this method with disable=true will cause the microhone to be completely deactivated when muted Currently only implemented for IOS, this will cause the playback sound to be interrupted for a short moment while the audio is reconfigured. On IOS 14, it will also disable Apple's microphone recording indicator when microphone is muted.

Parameters
streamThe stream.
disableTrue if you wish to entirely stop the audio recording when muting the microphone.

◆ audio_stream_enable_automatic_gain_control()

void audio_stream_enable_automatic_gain_control ( AudioStream stream,
bool_t  val 
)

enable automatic gain control, to be done before start()

◆ audio_stream_enable_echo_canceller()

void audio_stream_enable_echo_canceller ( AudioStream st,
bool_t  enabled 
)

to be done before start

◆ audio_stream_enable_echo_limiter()

void audio_stream_enable_echo_limiter ( AudioStream stream,
EchoLimiterType  type 
)

enable echo-limiter dispositve: one MSVolume in input branch controls a MSVolume in the output branch

◆ audio_stream_enable_equalizer()

void audio_stream_enable_equalizer ( AudioStream stream,
EqualizerLocation  location,
bool_t  enabled 
)

Enable a parametric equalizer

Parameters
[in]streamAn AudioStream
[in]locationLocation of the equalizer to enable (speaker or microphone)
[in]enabledWhether the equalizer must be enabled

◆ audio_stream_enable_gain_control()

void audio_stream_enable_gain_control ( AudioStream stream,
bool_t  val 
)

enable gain control, to be done before start()

◆ audio_stream_enable_mic()

void audio_stream_enable_mic ( AudioStream stream,
bool_t  enable 
)

Mute or unmute the microphone For IOS, if "audio_stream_disable_record_on_mute" was enabled, this will completely stop the microphone recording. Else, sound recording remains active but silence is sent instead of recorded audiow@

Parameters
streamThe stream.
enableWether the microphone must be enabled.

◆ audio_stream_enable_noise_gate()

void audio_stream_enable_noise_gate ( AudioStream stream,
bool_t  val 
)

enable noise gate, must be done before start()

◆ audio_stream_equalizer_set_gain()

void audio_stream_equalizer_set_gain ( AudioStream stream,
EqualizerLocation  location,
const MSEqualizerGain gain 
)

Apply a gain on a given frequency band.

Parameters
[in]streamAn AudioStream
[in]locationLocation of the concerned equalizer (speaker or microphone)
[in]gainDescription of the band and the gain to apply.

◆ audio_stream_get_participant_volume()

int audio_stream_get_participant_volume ( const AudioStream stream,
uint32_t  participant_ssrc 
)

Retrieve the volume of the given participant.

Parameters
streamthe audio stream
participant_ssrcthe ssrc of the participant
Returns
the volume of the participant in dbm0, if participant isn't found it will return the lowest volume.

◆ audio_stream_get_recv_ssrc()

uint32_t audio_stream_get_recv_ssrc ( const AudioStream stream)

Retrieve the receive ssrc of the stream

Parameters
streamthe audio stream
Returns
the receive ssrc of the stream

◆ audio_stream_get_send_ssrc()

uint32_t audio_stream_get_send_ssrc ( const AudioStream stream)

Retrieve the send ssrc of the stream

Parameters
streamthe audio stream
Returns
the send ssrc of the stream

◆ audio_stream_get_sound_card_input_gain()

float audio_stream_get_sound_card_input_gain ( const AudioStream stream)

Get microphone volume gain.

Parameters
streamThe audio stream.
Returns
double Volume gain in percentage of the max suppored gain. Valid returned values are in [0.0 : 1.0]. A negative value is returned in case of failure.

◆ audio_stream_get_sound_card_output_gain()

float audio_stream_get_sound_card_output_gain ( const AudioStream stream)

Get speaker volume gain.

Parameters
streamThe audio stream.
Returns
Volume gain in percentage of the max suppored gain. Valid returned values are in [0.0 : 1.0]. A negative value is returned in case of failure.

◆ audio_stream_iterate()

void audio_stream_iterate ( AudioStream stream)

Executes background low priority tasks related to audio processing (RTP statistics analysis). It should be called periodically, for example with an interval of 100 ms or so.

◆ audio_stream_mute_rtp()

void audio_stream_mute_rtp ( AudioStream stream,
bool_t  val 
)

enable/disable rtp stream

◆ audio_stream_new()

AudioStream * audio_stream_new ( MSFactory factory,
int  loc_rtp_port,
int  loc_rtcp_port,
bool_t  ipv6 
)

Creates an AudioStream object listening on a RTP port.

Parameters
loc_rtp_portthe local UDP port to listen for RTP packets.
loc_rtcp_portthe local UDP port to listen for RTCP packets
ipv6TRUE if ipv6 must be used.
factory
Returns
a new AudioStream.

◆ audio_stream_new2()

AudioStream * audio_stream_new2 ( MSFactory factory,
const char *  ip,
int  loc_rtp_port,
int  loc_rtcp_port 
)

Creates an AudioStream object listening on a RTP port for a dedicated address.

Parameters
loc_ipthe local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses
loc_rtp_portthe local UDP port to listen for RTP packets.
loc_rtcp_portthe local UDP port to listen for RTCP packets
factory
Returns
a new AudioStream.

◆ audio_stream_new_with_sessions()

AudioStream * audio_stream_new_with_sessions ( MSFactory factory,
const MSMediaStreamSessions sessions 
)

Creates an AudioStream object from initialized MSMediaStreamSessions.

Parameters
sessionsthe MSMediaStreamSessions
factorythe MSFActory from the core object
Returns
a new AudioStream

◆ audio_stream_open_remote_play()

MSFilter * audio_stream_open_remote_play ( AudioStream stream,
const char *  filename 
)

Open a player to play an audio/video file to remote end. The player is returned as a MSFilter so that application can make usual player controls on it using the MSPlayerInterface.

◆ audio_stream_send_dtmf()

int audio_stream_send_dtmf ( AudioStream stream,
char  dtmf 
)

send a dtmf

◆ audio_stream_set_client_to_mixer_extension_id()

void audio_stream_set_client_to_mixer_extension_id ( AudioStream stream,
int  extension_id 
)

Sets the header extension id for client to mixer audio level indication. This has to be called before starting the audio stream.

Parameters
streamthe audio stream
extension_idthe extension id

◆ audio_stream_set_echo_canceller_params()

void audio_stream_set_echo_canceller_params ( AudioStream st,
int  tail_len_ms,
int  delay_ms,
int  framesize 
)

to be done before start

◆ audio_stream_set_mic_gain()

void audio_stream_set_mic_gain ( AudioStream stream,
float  gain 
)
Deprecated:
Like audio_stream_set_mic_gain_db() excepted that the gain is specified in percentage.
Parameters
streamThe stream.
gainGain to apply in percentage of the max supported gain.

◆ audio_stream_set_mic_gain_db()

void audio_stream_set_mic_gain_db ( AudioStream stream,
float  gain_db 
)

Apply a software gain on the microphone. Be note that this method neither changes the volume gain of the sound card nor the system mixer one. If you intends to control the volume gain at sound card level, you should use audio_stream_set_sound_card_input_gain() instead.

Parameters
streamThe stream.
gain_dbGain to apply in dB.

◆ audio_stream_set_mixer_to_client_extension_id()

void audio_stream_set_mixer_to_client_extension_id ( AudioStream stream,
int  extension_id 
)

Sets the header extension id for mixer to client audio level indication. This has to be called before starting the audio stream.

Parameters
streamthe audio stream
extension_idthe extension id

◆ audio_stream_set_sound_card_input_gain()

void audio_stream_set_sound_card_input_gain ( AudioStream stream,
float  gain 
)

Set microphone volume gain. If the sound backend supports it, the set volume gain will be synchronized with the host system mixer. If you intended to apply a static software gain, you should use audio_stream_set_mic_gain_db() or audio_stream_set_mic_gain().

Parameters
streamThe audio stream.
gainPercentage of the max supported volume gain. Valid values are in [0.0 : 1.0].

◆ audio_stream_set_sound_card_output_gain()

void audio_stream_set_sound_card_output_gain ( AudioStream stream,
float  volume 
)

Set speaker volume gain. If the sound backend supports it, the set volume gain will be synchronized with the host system mixer.

Parameters
streamThe audio stream.
gainPercentage of the max supported volume gain. Valid values are in [0.0 : 1.0].

◆ audio_stream_set_spk_gain()

void audio_stream_set_spk_gain ( AudioStream stream,
float  gain 
)

Like audio_stream_set_spk_gain_db() excepted that the gain is specified in percentage.

Parameters
streamThe stream.
gainGain to apply in percentage of the max supported gain.

◆ audio_stream_set_spk_gain_db()

void audio_stream_set_spk_gain_db ( AudioStream stream,
float  gain_db 
)

Apply a gain on received RTP packets.

Parameters
streamAn AudioStream.
gain_dbGain to apply in dB.

◆ audio_stream_start_from_io()

int audio_stream_start_from_io ( AudioStream stream,
RtpProfile *  profile,
const char *  rem_rtp_ip,
int  rem_rtp_port,
const char *  rem_rtcp_ip,
int  rem_rtcp_port,
int  payload_type,
const MSMediaStreamIO io 
)

Start an audio stream according to the specified AudioStreamIO.

Parameters
[in]streamAudioStream object previously created with audio_stream_new().
[in]profileRtpProfile object holding the PayloadType that can be used during the audio session.
[in]rem_rtp_ipThe remote IP address where to send the encoded audio to.
[in]rem_rtp_portThe remote port where to send the encoded audio to.
[in]rem_rtcp_ipThe remote IP address for RTCP.
[in]rem_rtcp_portThe remote port for RTCP.
[in]payload_typeThe payload type number used to send the audio stream. A valid PayloadType must be available at this index in the profile.
[in]ioA MSMediaStreamIO describing the local input/output of the audio stream.

◆ audio_stream_start_full()

int audio_stream_start_full ( AudioStream stream,
RtpProfile *  profile,
const char *  rem_rtp_ip,
int  rem_rtp_port,
const char *  rem_rtcp_ip,
int  rem_rtcp_port,
int  payload,
int  jitt_comp,
const char *  infile,
const char *  outfile,
MSSndCard playcard,
MSSndCard captcard,
bool_t  use_ec 
)

Starts an audio stream from/to local wav files or soundcards.

This method starts the processing of the audio stream, that is playing from wav file or soundcard, voice processing, encoding, sending through RTP, receiving from RTP, decoding, voice processing and wav file recording or soundcard playback.

Parameters
streaman AudioStream previously created with audio_stream_new().
profilea RtpProfile containing all PayloadType possible during the audio session.
rem_rtp_ipremote IP address where to send the encoded audio.
rem_rtp_portremote IP port where to send the encoded audio.
rem_rtcp_ipremote IP address for RTCP.
rem_rtcp_portremote port for RTCP.
payloadpayload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile.
jitt_compNominal jitter buffer size in milliseconds.
infilepath to wav file to play out (can be NULL)
outfilepath to wav file to record into (can be NULL)
playcardThe soundcard to be used for playback (can be NULL)
captcardThe soundcard to be used for catpure. (can be NULL)
use_ecwhether echo cancellation is to be performed.
Returns
0 if sucessful, -1 otherwise.

◆ audio_stream_start_now()

int audio_stream_start_now ( AudioStream stream,
RtpProfile *  prof,
const char *  remip,
int  remport,
int  rem_rtcp_port,
int  payload_type,
int  jitt_comp,
MSSndCard playcard,
MSSndCard captcard,
bool_t  echo_cancel 
)

Starts an audio stream from local soundcards.

This method starts the processing of the audio stream, that is capture from soundcard, voice processing, encoding, sending through RTP, receiving from RTP, decoding, voice processing and soundcard playback.

Parameters
streaman AudioStream previously created with audio_stream_new().
profa RtpProfile containing all PayloadType possible during the audio session.
remipremote IP address where to send the encoded audio.
remportremote IP port where to send the encoded audio
rem_rtcp_portremote port for RTCP.
payload_typepayload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile.
jitt_compNominal jitter buffer size in milliseconds.
playcardThe soundcard to be used for playback
captcardThe soundcard to be used for catpure.
echo_cancelwhether echo cancellation is to be performed.

◆ audio_stream_stop()

void audio_stream_stop ( AudioStream stream)

stop the audio streaming thread and free everything

◆ audio_stream_zrtp_enabled()

bool_t audio_stream_zrtp_enabled ( const AudioStream stream)

return TRUE if zrtp is enabled, it does not mean that stream is encrypted, but only that zrtp is configured to know encryption status, uses #

◆ media_stream_alive()

bool_t media_stream_alive ( MediaStream stream,
int  timeout_seconds 
)

Returns TRUE if stream was still actively receiving packets (RTP or RTCP) in the last period specified in timeout_seconds.

◆ media_stream_avpf_enabled()

bool_t media_stream_avpf_enabled ( const MediaStream stream)

Tells whether AVPF is enabled or not.

Parameters
[in]streamMediaStream object.
Returns
True if AVPF is enabled, false otherwise.

◆ media_stream_get_avpf_rr_interval()

uint16_t media_stream_get_avpf_rr_interval ( const MediaStream stream)

Gets the AVPF Regular RTCP report interval.

Parameters
[in]streamMediaStream object.
Returns
The AVPF Regular RTCP report interval in seconds.

◆ media_stream_get_down_bw()

float media_stream_get_down_bw ( const MediaStream stream)

get current stream download bitrate. Value is updated every seconds

Parameters
stream
Returns
bitrate in bit per seconds

◆ media_stream_get_recv_ssrc()

uint32_t media_stream_get_recv_ssrc ( const MediaStream stream)

Retrieve the receive ssrc of the stream

Parameters
streamthe media stream
Returns
the receive ssrc of the stream

◆ media_stream_get_rtcp_down_bw()

float media_stream_get_rtcp_down_bw ( const MediaStream stream)

get current stream rtcp download bitrate. Value is updated every seconds

Parameters
stream
Returns
bitrate in bit per seconds

◆ media_stream_get_rtcp_up_bw()

float media_stream_get_rtcp_up_bw ( const MediaStream stream)

get current stream rtcp upload bitrate. Value is updated every seconds

Parameters
stream
Returns
bitrate in bit per seconds

◆ media_stream_get_rtp_session()

RtpSession * media_stream_get_rtp_session ( const MediaStream stream)

Gets the RTP session of the media stream.

Parameters
[in]streamMediaStream object.
Returns
The RTP session of the media stream.

◆ media_stream_get_send_ssrc()

uint32_t media_stream_get_send_ssrc ( const MediaStream stream)

Retrieve the send ssrc of the stream

Parameters
streamthe media stream
Returns
the send ssrc of the stream

◆ media_stream_get_state()

MSStreamState media_stream_get_state ( const MediaStream stream)
Returns
current streams state

◆ media_stream_get_target_network_bitrate()

int media_stream_get_target_network_bitrate ( const MediaStream stream)

get the stream target bitrate.

Parameters
streamstream to apply parameter on
Returns
target_bitrate in bit per seconds

◆ media_stream_get_up_bw()

float media_stream_get_up_bw ( const MediaStream stream)

get current stream upload bitrate. Value is updated every seconds

Parameters
stream
Returns
bitrate in bit per seconds

◆ media_stream_reclaim_sessions()

void media_stream_reclaim_sessions ( MediaStream stream,
MSMediaStreamSessions sessions 
)

Returns the sessions that were used in the media stream (RTP, SRTP, ZRTP...) so that they can be re-used. As a result of calling this function, the media stream no longer owns the sessions and thus will not free them.

◆ media_stream_secured()

bool_t media_stream_secured ( const MediaStream stream)
Parameters
[in]streamMediaStream object
Returns
true if stream is encrypted

◆ media_stream_set_max_network_bitrate()

int media_stream_set_max_network_bitrate ( MediaStream stream,
int  max_bitrate 
)

Set a maximum target bitrate for the stream. Indeed, the MSBandwidthController may adapt the target bitrate according to network conditions, which includes the possibility to increase it if remote side sends a TMMBR to invite to increase bitrate. The max_network_bitrate defines the upper limit for increasing the bitrate usage automatically.

Parameters
streamstream to apply parameter on
target_bitratein bit per seconds

◆ media_stream_set_target_network_bitrate()

int media_stream_set_target_network_bitrate ( MediaStream stream,
int  target_bitrate 
)

For multirate codecs like OPUS, encoder output target bitrate must be set.
Encoder will compute output codec bitrate from this value.
default value is the value corresponding the rtp PayloadType

Parameters
streamstream to apply parameter on
target_bitratein bit per seconds
Returns
0 if succeed