mediastreamer2 5.2.0
|
Audio streaming API - Easily run audio streams from soundcard or wav files to RTP. More...
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 |
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) |
AudioStream * | audio_stream_start (MSFactory *factory, RtpProfile *prof, int locport, const char *remip, int remport, int payload_type, int jitt_comp, bool_t echo_cancel) |
AudioStream * | audio_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) |
AudioStream * | audio_stream_new (MSFactory *factory, int loc_rtp_port, int loc_rtcp_port, bool_t ipv6) |
AudioStream * | audio_stream_new2 (MSFactory *factory, const char *ip, int loc_rtp_port, int loc_rtcp_port) |
AudioStream * | audio_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) |
MSFilter * | audio_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) |
MSFilter * | audio_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) |
Audio streaming API - Easily run audio streams from soundcard or wav files to RTP.
#define AUDIO_STREAM_FEATURE_ALL |
typedef struct _AudioStream AudioStream |
The AudioStream holds all resources to create and run typical VoIP audiostream.
typedef struct _MSMediaResource 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
typedef struct _MSMediaStreamIO MSMediaStreamIO |
Structure describing the input/output of a MediaStream. Input and output are described as MSMediaResource.
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.
stream | The stream. |
disable | True if you wish to entirely stop the audio recording when muting the microphone. |
void audio_stream_enable_automatic_gain_control | ( | AudioStream * | stream, |
bool_t | val | ||
) |
enable automatic gain control, to be done before start()
void audio_stream_enable_echo_canceller | ( | AudioStream * | st, |
bool_t | enabled | ||
) |
to be done before start
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
void audio_stream_enable_equalizer | ( | AudioStream * | stream, |
EqualizerLocation | location, | ||
bool_t | enabled | ||
) |
Enable a parametric equalizer
[in] | stream | An AudioStream |
[in] | location | Location of the equalizer to enable (speaker or microphone) |
[in] | enabled | Whether the equalizer must be enabled |
void audio_stream_enable_gain_control | ( | AudioStream * | stream, |
bool_t | val | ||
) |
enable gain control, to be done before start()
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@
stream | The stream. |
enable | Wether the microphone must be enabled. |
void audio_stream_enable_noise_gate | ( | AudioStream * | stream, |
bool_t | val | ||
) |
enable noise gate, must be done before start()
void audio_stream_equalizer_set_gain | ( | AudioStream * | stream, |
EqualizerLocation | location, | ||
const MSEqualizerGain * | gain | ||
) |
Apply a gain on a given frequency band.
[in] | stream | An AudioStream |
[in] | location | Location of the concerned equalizer (speaker or microphone) |
[in] | gain | Description of the band and the gain to apply. |
int audio_stream_get_participant_volume | ( | const AudioStream * | stream, |
uint32_t | participant_ssrc | ||
) |
Retrieve the volume of the given participant.
stream | the audio stream |
participant_ssrc | the ssrc of the participant |
uint32_t audio_stream_get_recv_ssrc | ( | const AudioStream * | stream | ) |
Retrieve the receive ssrc of the stream
stream | the audio stream |
uint32_t audio_stream_get_send_ssrc | ( | const AudioStream * | stream | ) |
Retrieve the send ssrc of the stream
stream | the audio stream |
float audio_stream_get_sound_card_input_gain | ( | const AudioStream * | stream | ) |
Get microphone volume gain.
stream | The audio stream. |
float audio_stream_get_sound_card_output_gain | ( | const AudioStream * | stream | ) |
Get speaker volume gain.
stream | The audio stream. |
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.
void audio_stream_mute_rtp | ( | AudioStream * | stream, |
bool_t | val | ||
) |
enable/disable rtp stream
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.
loc_rtp_port | the local UDP port to listen for RTP packets. |
loc_rtcp_port | the local UDP port to listen for RTCP packets |
ipv6 | TRUE if ipv6 must be used. |
factory |
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.
loc_ip | the local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses |
loc_rtp_port | the local UDP port to listen for RTP packets. |
loc_rtcp_port | the local UDP port to listen for RTCP packets |
factory |
AudioStream * audio_stream_new_with_sessions | ( | MSFactory * | factory, |
const MSMediaStreamSessions * | sessions | ||
) |
Creates an AudioStream object from initialized MSMediaStreamSessions.
sessions | the MSMediaStreamSessions |
factory | the MSFActory from the core object |
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.
int audio_stream_send_dtmf | ( | AudioStream * | stream, |
char | dtmf | ||
) |
send a dtmf
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.
stream | the audio stream |
extension_id | the extension id |
void audio_stream_set_echo_canceller_params | ( | AudioStream * | st, |
int | tail_len_ms, | ||
int | delay_ms, | ||
int | framesize | ||
) |
to be done before start
void audio_stream_set_mic_gain | ( | AudioStream * | stream, |
float | gain | ||
) |
stream | The stream. |
gain | Gain to apply in percentage of the max supported gain. |
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.
stream | The stream. |
gain_db | Gain to apply in dB. |
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.
stream | the audio stream |
extension_id | the extension id |
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().
stream | The audio stream. |
gain | Percentage of the max supported volume gain. Valid values are in [0.0 : 1.0]. |
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.
stream | The audio stream. |
gain | Percentage of the max supported volume gain. Valid values are in [0.0 : 1.0]. |
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.
stream | The stream. |
gain | Gain to apply in percentage of the max supported gain. |
void audio_stream_set_spk_gain_db | ( | AudioStream * | stream, |
float | gain_db | ||
) |
Apply a gain on received RTP packets.
stream | An AudioStream. |
gain_db | Gain to apply in dB. |
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.
[in] | stream | AudioStream object previously created with audio_stream_new(). |
[in] | profile | RtpProfile object holding the PayloadType that can be used during the audio session. |
[in] | rem_rtp_ip | The remote IP address where to send the encoded audio to. |
[in] | rem_rtp_port | The remote port where to send the encoded audio to. |
[in] | rem_rtcp_ip | The remote IP address for RTCP. |
[in] | rem_rtcp_port | The remote port for RTCP. |
[in] | payload_type | The payload type number used to send the audio stream. A valid PayloadType must be available at this index in the profile. |
[in] | io | A MSMediaStreamIO describing the local input/output of the audio stream. |
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.
stream | an AudioStream previously created with audio_stream_new(). |
profile | a RtpProfile containing all PayloadType possible during the audio session. |
rem_rtp_ip | remote IP address where to send the encoded audio. |
rem_rtp_port | remote IP port where to send the encoded audio. |
rem_rtcp_ip | remote IP address for RTCP. |
rem_rtcp_port | remote port for RTCP. |
payload | payload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile. |
jitt_comp | Nominal jitter buffer size in milliseconds. |
infile | path to wav file to play out (can be NULL) |
outfile | path to wav file to record into (can be NULL) |
playcard | The soundcard to be used for playback (can be NULL) |
captcard | The soundcard to be used for catpure. (can be NULL) |
use_ec | whether echo cancellation is to be performed. |
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.
stream | an AudioStream previously created with audio_stream_new(). |
prof | a RtpProfile containing all PayloadType possible during the audio session. |
remip | remote IP address where to send the encoded audio. |
remport | remote IP port where to send the encoded audio |
rem_rtcp_port | remote port for RTCP. |
payload_type | payload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile. |
jitt_comp | Nominal jitter buffer size in milliseconds. |
playcard | The soundcard to be used for playback |
captcard | The soundcard to be used for catpure. |
echo_cancel | whether echo cancellation is to be performed. |
void audio_stream_stop | ( | AudioStream * | stream | ) |
stop the audio streaming thread and free everything
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 #
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.
bool_t media_stream_avpf_enabled | ( | const MediaStream * | stream | ) |
Tells whether AVPF is enabled or not.
[in] | stream | MediaStream object. |
uint16_t media_stream_get_avpf_rr_interval | ( | const MediaStream * | stream | ) |
Gets the AVPF Regular RTCP report interval.
[in] | stream | MediaStream object. |
float media_stream_get_down_bw | ( | const MediaStream * | stream | ) |
get current stream download bitrate. Value is updated every seconds
stream |
uint32_t media_stream_get_recv_ssrc | ( | const MediaStream * | stream | ) |
Retrieve the receive ssrc of the stream
stream | the media stream |
float media_stream_get_rtcp_down_bw | ( | const MediaStream * | stream | ) |
get current stream rtcp download bitrate. Value is updated every seconds
stream |
float media_stream_get_rtcp_up_bw | ( | const MediaStream * | stream | ) |
get current stream rtcp upload bitrate. Value is updated every seconds
stream |
RtpSession * media_stream_get_rtp_session | ( | const MediaStream * | stream | ) |
Gets the RTP session of the media stream.
[in] | stream | MediaStream object. |
uint32_t media_stream_get_send_ssrc | ( | const MediaStream * | stream | ) |
Retrieve the send ssrc of the stream
stream | the media stream |
MSStreamState media_stream_get_state | ( | const MediaStream * | stream | ) |
int media_stream_get_target_network_bitrate | ( | const MediaStream * | stream | ) |
get the stream target bitrate.
stream | stream to apply parameter on |
float media_stream_get_up_bw | ( | const MediaStream * | stream | ) |
get current stream upload bitrate. Value is updated every seconds
stream |
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.
bool_t media_stream_secured | ( | const MediaStream * | stream | ) |
[in] | stream | MediaStream object |
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.
stream | stream to apply parameter on |
target_bitrate | in bit per seconds |
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
stream | stream to apply parameter on |
target_bitrate | in bit per seconds |