Commit 5dbc6693 authored by Simon Morlat's avatar Simon Morlat
Browse files

rename LinphoneCallParamsMediaDirection into LinphoneMediaDirection, as it has...

rename LinphoneCallParamsMediaDirection into LinphoneMediaDirection, as it has no reason to be attached to LinphoneCallParams and could be re-used in other contexts.
parent 7b62f331
......@@ -33,30 +33,32 @@ SalMediaProto get_proto_from_call_params(const LinphoneCallParams *params) {
return SalProtoRtpAvp;
}
SalStreamDir sal_dir_from_call_params_dir(LinphoneCallParamsMediaDirection cpdir) {
SalStreamDir sal_dir_from_call_params_dir(LinphoneMediaDirection cpdir) {
switch (cpdir) {
case LinphoneCallParamsMediaDirectionInactive:
case LinphoneMediaDirectionInactive:
return SalStreamInactive;
case LinphoneCallParamsMediaDirectionSendOnly:
case LinphoneMediaDirectionSendOnly:
return SalStreamSendOnly;
case LinphoneCallParamsMediaDirectionRecvOnly:
case LinphoneMediaDirectionRecvOnly:
return SalStreamRecvOnly;
case LinphoneCallParamsMediaDirectionSendRecv:
case LinphoneMediaDirectionSendRecv:
return SalStreamSendRecv;
}
return SalStreamSendRecv;
}
LinphoneCallParamsMediaDirection media_direction_from_sal_stream_dir(SalStreamDir dir){
LinphoneMediaDirection media_direction_from_sal_stream_dir(SalStreamDir dir){
switch (dir) {
case SalStreamInactive:
return LinphoneCallParamsMediaDirectionInactive;
return LinphoneMediaDirectionInactive;
case SalStreamSendOnly:
return LinphoneCallParamsMediaDirectionSendOnly;
return LinphoneMediaDirectionSendOnly;
case SalStreamRecvOnly:
return LinphoneCallParamsMediaDirectionRecvOnly;
return LinphoneMediaDirectionRecvOnly;
case SalStreamSendRecv:
return LinphoneCallParamsMediaDirectionSendRecv;
return LinphoneMediaDirectionSendRecv;
}
return LinphoneMediaDirectionSendRecv;
}
SalStreamDir get_audio_dir_from_call_params(const LinphoneCallParams *params) {
......@@ -103,8 +105,8 @@ void linphone_call_params_enable_low_bandwidth(LinphoneCallParams *cp, bool_t en
void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled){
cp->has_video=enabled;
if (cp->video_dir==LinphoneCallParamsMediaDirectionInactive)
cp->video_dir=LinphoneCallParamsMediaDirectionSendRecv;
if (cp->video_dir==LinphoneMediaDirectionInactive)
cp->video_dir=LinphoneMediaDirectionSendRecv;
}
const char *linphone_call_params_get_custom_header(const LinphoneCallParams *params, const char *header_name){
......@@ -195,19 +197,19 @@ bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp){
return cp->has_video;
}
LinphoneCallParamsMediaDirection linphone_call_params_get_audio_direction(const LinphoneCallParams *cp) {
LinphoneMediaDirection linphone_call_params_get_audio_direction(const LinphoneCallParams *cp) {
return cp->audio_dir;
}
LinphoneCallParamsMediaDirection linphone_call_params_get_video_direction(const LinphoneCallParams *cp) {
LinphoneMediaDirection linphone_call_params_get_video_direction(const LinphoneCallParams *cp) {
return cp->video_dir;
}
void linphone_call_params_set_audio_direction(LinphoneCallParams *cp,LinphoneCallParamsMediaDirection dir) {
void linphone_call_params_set_audio_direction(LinphoneCallParams *cp,LinphoneMediaDirection dir) {
cp->audio_dir=dir;
}
void linphone_call_params_set_video_direction(LinphoneCallParams *cp,LinphoneCallParamsMediaDirection dir) {
void linphone_call_params_set_video_direction(LinphoneCallParams *cp,LinphoneMediaDirection dir) {
cp->video_dir=dir;
}
......@@ -244,8 +246,8 @@ static void _linphone_call_params_destroy(LinphoneCallParams *cp){
LinphoneCallParams * linphone_call_params_new(void) {
LinphoneCallParams *cp=belle_sip_object_new(LinphoneCallParams);
cp->audio_dir=LinphoneCallParamsMediaDirectionSendRecv;
cp->video_dir=LinphoneCallParamsMediaDirectionSendRecv;
cp->audio_dir=LinphoneMediaDirectionSendRecv;
cp->video_dir=LinphoneMediaDirectionSendRecv;
return cp;
}
......
......@@ -33,17 +33,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/**
* Indicates for a given media the stream direction
* */
enum _LinphoneCallParamsMediaDirection {
LinphoneCallParamsMediaDirectionInactive, /** No active media not supported yet*/
LinphoneCallParamsMediaDirectionSendOnly, /** Send only mode*/
LinphoneCallParamsMediaDirectionRecvOnly, /** recv only mode*/
LinphoneCallParamsMediaDirectionSendRecv, /*send receive mode not supported yet*/
enum _LinphoneMediaDirection {
LinphoneMediaDirectionInactive, /** No active media not supported yet*/
LinphoneMediaDirectionSendOnly, /** Send only mode*/
LinphoneMediaDirectionRecvOnly, /** recv only mode*/
LinphoneMediaDirectionSendRecv, /*send receive mode not supported yet*/
};
/**
* Typedef for enum
**/
typedef enum _LinphoneCallParamsMediaDirection LinphoneCallParamsMediaDirection;
typedef enum _LinphoneMediaDirection LinphoneMediaDirection;
/**
* Private structure definition for LinphoneCallParams.
......@@ -266,28 +266,28 @@ LINPHONE_PUBLIC bool_t linphone_call_params_video_enabled(const LinphoneCallPara
* @param[in] cl LinphoneCallParams object
* @return The audio stream direction associated with the call params.
**/
LINPHONE_PUBLIC LinphoneCallParamsMediaDirection linphone_call_params_get_audio_direction(const LinphoneCallParams *cp);
LINPHONE_PUBLIC LinphoneMediaDirection linphone_call_params_get_audio_direction(const LinphoneCallParams *cp);
/**
* Get the video stream direction.
* @param[in] cl LinphoneCallParams object
* @return The video stream direction associated with the call params.
**/
LINPHONE_PUBLIC LinphoneCallParamsMediaDirection linphone_call_params_get_video_direction(const LinphoneCallParams *cp);
LINPHONE_PUBLIC LinphoneMediaDirection linphone_call_params_get_video_direction(const LinphoneCallParams *cp);
/**
* Set the audio stream direction. Only relevant for multicast
* @param[in] cl LinphoneCallParams object
* @param[in] The audio stream direction associated with this call params.
**/
LINPHONE_PUBLIC void linphone_call_params_set_audio_direction(LinphoneCallParams *cp, LinphoneCallParamsMediaDirection dir);
LINPHONE_PUBLIC void linphone_call_params_set_audio_direction(LinphoneCallParams *cp, LinphoneMediaDirection dir);
/**
* Set the video stream direction. Only relevant for multicast
* @param[in] cl LinphoneCallParams object
* @param[in] The video stream direction associated with this call params.
**/
LINPHONE_PUBLIC void linphone_call_params_set_video_direction(LinphoneCallParams *cp, LinphoneCallParamsMediaDirection dir);
LINPHONE_PUBLIC void linphone_call_params_set_video_direction(LinphoneCallParams *cp, LinphoneMediaDirection dir);
/*******************************************************************************
......
......@@ -1422,9 +1422,9 @@ const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
}
if (md){
SalStreamDescription *sd=sal_media_description_find_best_stream(md,SalAudio);
call->current_params->audio_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneCallParamsMediaDirectionInactive;
call->current_params->audio_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneMediaDirectionInactive;
sd=sal_media_description_find_best_stream(md,SalVideo);
call->current_params->video_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneCallParamsMediaDirectionInactive;
call->current_params->video_dir=sd ? media_direction_from_sal_stream_dir(sd->dir) : LinphoneMediaDirectionInactive;
}
return call->current_params;
......
......@@ -6907,8 +6907,8 @@ void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *para
params->in_conference=FALSE;
params->privacy=LinphonePrivacyDefault;
params->avpf_enabled=FALSE;
params->audio_dir=LinphoneCallParamsMediaDirectionSendRecv;
params->video_dir=LinphoneCallParamsMediaDirectionSendRecv;
params->audio_dir=LinphoneMediaDirectionSendRecv;
params->video_dir=LinphoneMediaDirectionSendRecv;
params->real_early_media=lp_config_get_int(lc->config,"misc","real_early_media",FALSE);
}
......
......@@ -108,8 +108,8 @@ struct _LinphoneCallParams{
bool_t no_user_consent;/*when set to TRUE an UPDATE request will be used instead of reINVITE*/
uint16_t avpf_rr_interval; /*in milliseconds*/
LinphonePrivacyMask privacy;
LinphoneCallParamsMediaDirection audio_dir;
LinphoneCallParamsMediaDirection video_dir;
LinphoneMediaDirection audio_dir;
LinphoneMediaDirection video_dir;
};
......@@ -1105,8 +1105,8 @@ void linphone_core_notify_log_collection_upload_progress_indication(LinphoneCore
void set_mic_gain_db(AudioStream *st, float gain);
void set_playback_gain_db(AudioStream *st, float gain);
LinphoneCallParamsMediaDirection media_direction_from_sal_stream_dir(SalStreamDir dir);
SalStreamDir sal_dir_from_call_params_dir(LinphoneCallParamsMediaDirection cpdir);
LinphoneMediaDirection media_direction_from_sal_stream_dir(SalStreamDir dir);
SalStreamDir sal_dir_from_call_params_dir(LinphoneMediaDirection cpdir);
#ifdef ANDROID
void linphone_core_wifi_lock_acquire(LinphoneCore *lc);
......
......@@ -121,8 +121,8 @@ static void early_media_video_call_state_changed(LinphoneCore *lc, LinphoneCall
case LinphoneCallIncomingReceived:
params = linphone_core_create_default_call_parameters(lc);
linphone_call_params_enable_video(params, TRUE);
linphone_call_params_set_audio_direction(params, LinphoneCallParamsMediaDirectionSendOnly);
linphone_call_params_set_video_direction(params, LinphoneCallParamsMediaDirectionRecvOnly);
linphone_call_params_set_audio_direction(params, LinphoneMediaDirectionSendOnly);
linphone_call_params_set_video_direction(params, LinphoneMediaDirectionRecvOnly);
linphone_core_accept_early_media_with_params(lc, call, params);
linphone_call_params_unref(params);
break;
......@@ -302,8 +302,8 @@ static void two_incoming_early_media_video_calls_test(void) {
CU_ASSERT_PTR_NOT_NULL(call);
if (call != NULL) {
LinphoneCallParams *params = linphone_call_params_copy(linphone_call_get_current_params(call));
linphone_call_params_set_audio_direction(params, LinphoneCallParamsMediaDirectionSendRecv);
linphone_call_params_set_video_direction(params, LinphoneCallParamsMediaDirectionSendRecv);
linphone_call_params_set_audio_direction(params, LinphoneMediaDirectionSendRecv);
linphone_call_params_set_video_direction(params, LinphoneMediaDirectionSendRecv);
linphone_core_accept_call_with_params(marie->lc, call, params);
/* Wait for 5s. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment