mediastreamer2 5.2.0
Macros | Functions
Init API - Starting mediastreamer2 library

Starting mediastreamer2 library. More...

Collaboration diagram for Init API - Starting mediastreamer2 library:

Macros

#define ms_init()   ms_base_init(), ms_voip_init(), ms_plugins_init()
 
#define ms_exit()   ms_voip_exit(), ms_plugins_exit(), ms_base_exit()
 

Functions

void ms_base_init (void)
 
void ms_voip_init (void)
 
void ms_plugins_init (void)
 
void ms_set_plugins_dir (const char *path)
 
int ms_load_plugins (const char *directory)
 
void ms_base_exit (void)
 
void ms_voip_exit (void)
 
void ms_plugins_exit (void)
 
void ms_sleep (int seconds)
 
void ms_usleep (uint64_t usec)
 
int ms_get_payload_max_size (void)
 
void ms_set_payload_max_size (int size)
 
int ms_discover_mtu (const char *destination_host)
 
void ms_set_mtu (int mtu)
 
int ms_get_mtu (void)
 
void ms_set_cpu_count (unsigned int c)
 
unsigned int ms_get_cpu_count (void)
 
void ms_sound_device_description_add (const char *manufacturer, const char *model, const char *platform, unsigned int flags, int delay, int recommended_rate)
 
bool_t ms_is_ipv6 (const char *address)
 
bool_t ms_is_multicast_addr (const struct sockaddr *address)
 
bool_t ms_is_multicast (const char *address)
 
char * ms_load_file_content (FILE *file, size_t *nbytes)
 
char * ms_load_path_content (const char *path, size_t *nbytes)
 

Detailed Description

Starting mediastreamer2 library.

Macro Definition Documentation

◆ ms_exit

#define ms_exit ( )    ms_voip_exit(), ms_plugins_exit(), ms_base_exit()

Helper macro for backward compatibility. Use ms_base_exit() and ms_voip_exit() instead.

◆ ms_init

#define ms_init ( )    ms_base_init(), ms_voip_init(), ms_plugins_init()

Helper macro for backward compatibility. Use ms_base_init() and ms_voip_init() instead.

Function Documentation

◆ ms_base_exit()

void ms_base_exit ( void  )

Release resource allocated in the mediastreamer2 base library.

This must be called once before closing program.

Deprecated:
use ms_factory_destroy().

◆ ms_base_init()

void ms_base_init ( void  )

Initialize the mediastreamer2 base library.

This must be called once before calling any other API.

Deprecated:
use ms_factory_new()

◆ ms_discover_mtu()

int ms_discover_mtu ( const char *  destination_host)

Returns the network Max Transmission Unit to reach destination_host. This will attempt to send one or more big packets to destination_host, to a random port. Those packets are filled with zeroes.

◆ ms_get_cpu_count()

unsigned int ms_get_cpu_count ( void  )
Deprecated:
use ms_factory_get_cpu_count().

◆ ms_get_mtu()

int ms_get_mtu ( void  )

Get mediastreamer default mtu, used to compute the default RTP max payload size.

Deprecated:
use ms_factory_get_mtu().

◆ ms_get_payload_max_size()

int ms_get_payload_max_size ( void  )

The max payload size allowed. Filters that generate data that can be sent through RTP should make packets whose size is below ms_get_payload_max_size(). The default value is 1440 computed as the standard internet MTU minus IPv6 header, UDP header and RTP header. As IPV4 header is smaller than IPv6 header, this value works for both.

Deprecated:
use ms_factory_get_payload_max_size().

◆ ms_is_ipv6()

bool_t ms_is_ipv6 ( const char *  address)
Returns
TRUE if address is ipv6

◆ ms_is_multicast()

bool_t ms_is_multicast ( const char *  address)
Returns
TRUE if address is multicast

◆ ms_is_multicast_addr()

bool_t ms_is_multicast_addr ( const struct sockaddr *  address)
Returns
TRUE if address is multicast

◆ ms_load_file_content()

char * ms_load_file_content ( FILE *  file,
size_t *  nbytes 
)

Utility function to load a file into memory.

Parameters
filea FILE handle
nbytes(optional) number of bytes read

◆ ms_load_path_content()

char * ms_load_path_content ( const char *  path,
size_t *  nbytes 
)

Utility function to load a file into memory.

Parameters
patha FILE handle
nbytes(optional) number of bytes read

◆ ms_load_plugins()

int ms_load_plugins ( const char *  directory)

Load plugins from a specific directory. This method basically loads all libraries in the specified directory and attempts to call a C function called <libraryname>_init. For example if a library 'libdummy.so' or 'libdummy.dll' is found, then the loader tries to locate a C function called 'libdummy_init()' and calls it if it exists. ms_load_plugins() can be used to load non-mediastreamer2 plugins as it does not expect mediastreamer2 specific entry points.

Parameters
directoryA directory where plugins library are available.
Returns
>0 if successfull, 0 if not plugins loaded, -1 otherwise.
Deprecated:
use ms_factory_load_plugins().

◆ ms_plugins_exit()

void ms_plugins_exit ( void  )

Unload the plugins loaded by ms_plugins_init().

Deprecated:
use ms_factory_destroy().

◆ ms_plugins_init()

void ms_plugins_init ( void  )

Load the plugins from the default plugin directory.

This is just a wrapper around ms_load_plugins(). This must be called after ms_base_init() and after ms_voip_init().

Deprecated:
use ms_factory_init_plugins(), or ms_factory_new_with_voip() that does it automatically.

◆ ms_set_cpu_count()

void ms_set_cpu_count ( unsigned int  c)

Declare how many cpu (cores) are available on the platform

Deprecated:
use ms_factory_set_cpu_count().

◆ ms_set_mtu()

void ms_set_mtu ( int  mtu)

Set mediastreamer default mtu, used to compute the default RTP max payload size. This function will call ms_set_payload_max_size(mtu-[ipv6 header size]).

Deprecated:
use ms_factory_set_mtu()

◆ ms_set_payload_max_size()

void ms_set_payload_max_size ( int  size)

Set the maximum payload size allowed.

Deprecated:
use ms_factory_set_payload_max_size().

◆ ms_set_plugins_dir()

void ms_set_plugins_dir ( const char *  path)

Set the directory from where the plugins are to be loaded when calling ms_plugins_init().

Parameters
[in]pathThe path to the plugins directory.
Deprecated:
use ms_factory_set_plugins_dir().

◆ ms_sound_device_description_add()

void ms_sound_device_description_add ( const char *  manufacturer,
const char *  model,
const char *  platform,
unsigned int  flags,
int  delay,
int  recommended_rate 
)

Adds a new entry in the SoundDeviceDescription table

◆ ms_voip_exit()

void ms_voip_exit ( void  )

Release resource allocated in the mediastreamer2 VoIP library.

This must be called once before closing program.

Deprecated:
use ms_factory_destroy().

◆ ms_voip_init()

void ms_voip_init ( void  )

Initialize the mediastreamer2 VoIP library.

This must be called one before calling any other API.

Deprecated:
use ms_factory_new_with_voip().