mediastreamer2 5.1.64
Data Structures | Typedefs | Functions
Mediastreamer2_video_conference

Data Structures

struct  _MSVideoConferenceParams
 

Typedefs

typedef struct _MSVideoConferenceParams MSVideoConferenceParams
 
typedef struct _MSVideoConference MSVideoConference
 
typedef struct _MSVideoEndpoint MSVideoEndpoint
 

Functions

MSVideoConferencems_video_conference_new (MSFactory *factory, const MSVideoConferenceParams *params)
 
const MSVideoConferenceParamsms_video_conference_get_params (MSVideoConference *obj)
 
void ms_video_conference_add_member (MSVideoConference *obj, MSVideoEndpoint *ep)
 
void ms_video_conference_remove_member (MSVideoConference *obj, MSVideoEndpoint *ep)
 
void ms_video_conference_set_focus (MSVideoConference *obj, MSVideoEndpoint *ep)
 
MSVideoEndpointms_video_conference_get_video_placeholder_member (const MSVideoConference *obj)
 
const bctbx_list_t * ms_video_conference_get_members (const MSVideoConference *obj)
 
void ms_video_conference_set_audio_conference (MSVideoConference *obj, MSAudioConference *audioconf)
 
int ms_video_conference_get_size (MSVideoConference *obj)
 
void ms_video_conference_destroy (MSVideoConference *obj)
 
MSVideoEndpointms_video_endpoint_get_from_stream (VideoStream *st, bool_t is_remote)
 
void ms_video_endpoint_set_user_data (MSVideoEndpoint *ep, void *user_data)
 
void * ms_video_endpoint_get_user_data (const MSVideoEndpoint *ep)
 
void ms_video_endpoint_release_from_stream (MSVideoEndpoint *obj)
 

Detailed Description

Typedef Documentation

◆ MSVideoConference

typedef struct _MSVideoConference MSVideoConference

The MSVideoConference is the object representing a video conference.

First, the conference has to be created with ms_video_conference_new(), with parameters supplied. Then, participants to the conference can be added with ms_video_conference_add_member(). Participants can be removed from the conference with ms_video_conference_remove_member(). The conference processing is performed in a new thread run by a MSTicker object, which is owned by the conference. When all participants are removed, the MSVideoConference object can then be safely destroyed with ms_video_conference_destroy().

◆ MSVideoConferenceParams

Typedef to structure that holds conference parameters

◆ MSVideoEndpoint

typedef struct _MSVideoEndpoint MSVideoEndpoint

The MSVideoEndpoint represents a participant in the conference. It can be constructed from an existing VideoStream object with ms_video_endpoint_get_from_stream().

Function Documentation

◆ ms_video_conference_add_member()

void ms_video_conference_add_member ( MSVideoConference obj,
MSVideoEndpoint ep 
)

Adds a participant to the conference.

Parameters
objthe conference
epthe participant, represented as a MSVideoEndpoint object

◆ ms_video_conference_destroy()

void ms_video_conference_destroy ( MSVideoConference obj)

Destroys a conference.

Parameters
objthe conference All participants must have been removed before destroying the conference.

◆ ms_video_conference_get_members()

const bctbx_list_t * ms_video_conference_get_members ( const MSVideoConference obj)

Get the list of members, as MSVideoEndpoints.

Parameters
objthe conference
Returns
a list of MSVideoEndpoint objects.

◆ ms_video_conference_get_params()

const MSVideoConferenceParams * ms_video_conference_get_params ( MSVideoConference obj)

Gets conference's current parameters.

Parameters
objthe conference.
Returns
a read-only pointer to the conference parameters.

◆ ms_video_conference_get_size()

int ms_video_conference_get_size ( MSVideoConference obj)

Returns the size (ie the number of participants) of a conference.

Parameters
objthe conference

◆ ms_video_conference_get_video_placeholder_member()

MSVideoEndpoint * ms_video_conference_get_video_placeholder_member ( const MSVideoConference obj)

Get the video placeholder member, as MSVideoEndpoint.

Parameters
objthe conference
Returns
a MSVideoEndpoint object.

◆ ms_video_conference_new()

MSVideoConference * ms_video_conference_new ( MSFactory factory,
const MSVideoConferenceParams params 
)

Creates a conference.

Parameters
paramsa MSVideoConferenceParams structure, containing conference parameters.
Returns
a MSVideoConference object.

◆ ms_video_conference_remove_member()

void ms_video_conference_remove_member ( MSVideoConference obj,
MSVideoEndpoint ep 
)

Removes a participant from the conference.

Parameters
objthe conference
epthe participant, represented as a MSVideoEndpoint object

◆ ms_video_conference_set_audio_conference()

void ms_video_conference_set_audio_conference ( MSVideoConference obj,
MSAudioConference audioconf 
)

Put an audio conference and a video conference in relationship. The audio conference will monitor the active speaker, and notify the video conference.

Parameters
objthe video conference
objthe audio conference

◆ ms_video_conference_set_focus()

void ms_video_conference_set_focus ( MSVideoConference obj,
MSVideoEndpoint ep 
)

Switch the focus of the video conf on a given member.

Parameters
objthe conference
epthe participant, represented as a MSVideoEndpoint object

◆ ms_video_endpoint_get_from_stream()

MSVideoEndpoint * ms_video_endpoint_get_from_stream ( VideoStream st,
bool_t  is_remote 
)

Creates an MSVideoEndpoint from an existing VideoStream.

In order to create graphs for video processing of each participant, the VideoStream object is used, because this object already handles all the processing for encoding, decoding, etc...

The construction of the participants depends whether it is a remote participant, that is somebody in the network sending and receiving video through RTP, or a local participant, that is somebody using the local camera to capture and local screen to display video.

To create a remote participant, first create and start a VideoStream for the participant with video_stream_new() and video_stream_start() with NULL MSWebCam argument. Then, create a MSVideoEndpoint representing this participant by calling ms_video_endpoint_get_from_stream() with is_remote=TRUE.

To create a local participant, first create and start a VideoStream with video_stream_new() and video_stream_start(), with the correct MSWebCam to use. Arguments controlling RTP should be filled with placeholders value and will not be used for conferencing. Then, create a MSVideoEndpoint representing this local participant by calling ms_video_endpoint_get_from_stream() with the video stream and is_remote=FALSE.
For example:

VideoStream *st=video_stream_new(65000,65001,FALSE);
video_stream_start(st, conf->local_dummy_profile,
                        "127.0.0.1",
                        65000,
                        "127.0.0.1",
                        65001,
                        0,
                        40,
                        webcam
                        );
MSVideoEndpoint *local_endpoint=ms_video_endpoint_get_from_stream(st,FALSE);

◆ ms_video_endpoint_get_user_data()

void * ms_video_endpoint_get_user_data ( const MSVideoEndpoint ep)

Get the user pointer associated to the endpoint.

Parameters
epthe endpoint
Returns
the user data

◆ ms_video_endpoint_release_from_stream()

void ms_video_endpoint_release_from_stream ( MSVideoEndpoint obj)

Destroys a MSVideoEndpoint that was created from a VideoStream with ms_video_endpoint_get_from_stream(). The VideoStream can then be destroyed if needed.

◆ ms_video_endpoint_set_user_data()

void ms_video_endpoint_set_user_data ( MSVideoEndpoint ep,
void *  user_data 
)

Associate a user pointer to the endpoint.

Parameters
epthe endpoint
user_datathe user data