Commit cb7d8ff9 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Change API to access sent and received video size via call parameters.

parent 67962422
......@@ -815,6 +815,18 @@ void linphone_call_unref(LinphoneCall *obj){
* Returns current parameters associated to the call.
**/
const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call){
VideoStream *vstream;
MS_VIDEO_SIZE_ASSIGN(call->current_params.sent_vsize, UNKNOWN);
MS_VIDEO_SIZE_ASSIGN(call->current_params.recv_vsize, UNKNOWN);
#ifdef VIDEO_ENABLED
vstream = call->videostream;
if (vstream != NULL) {
call->current_params.sent_vsize = video_stream_get_sent_video_size(vstream);
call->current_params.recv_vsize = video_stream_get_received_video_size(vstream);
}
#endif
return &call->current_params;
}
......@@ -1061,6 +1073,14 @@ const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallP
return cp->video_codec;
}
MSVideoSize linphone_call_params_get_sent_video_size(const LinphoneCallParams *cp) {
return cp->sent_vsize;
}
MSVideoSize linphone_call_params_get_received_video_size(const LinphoneCallParams *cp) {
return cp->recv_vsize;
}
/**
* @ingroup call_control
* Use to know if this call has been configured in low bandwidth mode.
......@@ -2508,32 +2528,6 @@ void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx,
}else ms_warning("Could not apply zoom: video output wasn't activated.");
}
MSVideoSize linphone_call_get_sent_video_size(const LinphoneCall *call) {
MSVideoSize vsize;
VideoStream *vstream;
MS_VIDEO_SIZE_ASSIGN(vsize, UNKNOWN);
#ifdef VIDEO_ENABLED
vstream = call->videostream;
if (vstream != NULL) {
vsize = video_stream_get_sent_video_size(vstream);
}
#endif
return vsize;
}
MSVideoSize linphone_call_get_received_video_size(const LinphoneCall *call) {
MSVideoSize vsize;
VideoStream *vstream;
MS_VIDEO_SIZE_ASSIGN(vsize, UNKNOWN);
#ifdef VIDEO_ENABLED
vstream = call->videostream;
if (vstream != NULL) {
vsize = video_stream_get_received_video_size(vstream);
}
#endif
return vsize;
}
#ifndef USE_BELLESIP
static char *get_fixed_contact(LinphoneCore *lc, LinphoneCall *call , LinphoneProxyConfig *dest_proxy){
#else
......
......@@ -283,6 +283,21 @@ LINPHONE_PUBLIC const char *linphone_call_params_get_record_file(const LinphoneC
LINPHONE_PUBLIC void linphone_call_params_add_custom_header(LinphoneCallParams *params, const char *header_name, const char *header_value);
LINPHONE_PUBLIC const char *linphone_call_params_get_custom_header(const LinphoneCallParams *params, const char *header_name);
/**
* Gets the size of the video that is sent.
* @param[in] cp The call parameters for which to get the sent video size.
* @return The sent video size or MS_VIDEO_SIZE_UNKNOWN if not available.
*/
LINPHONE_PUBLIC MSVideoSize linphone_call_params_get_sent_video_size(const LinphoneCallParams *cp);
/**
* Gets the size of the video that is received.
* @param[in] cp The call paramaters for which to get the received video size.
* @return The received video size or MS_VIDEO_SIZE_UNKNOWN if not available.
*/
LINPHONE_PUBLIC MSVideoSize linphone_call_params_get_received_video_size(const LinphoneCallParams *cp);
/*
* Note for developers: this enum must be kept synchronized with the SalPrivacy enum declared in sal.h
*/
......@@ -592,20 +607,6 @@ LINPHONE_PUBLIC void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_
**/
LINPHONE_PUBLIC bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
/**
* Gets the size of the video that is sent.
* @param[in] call The call for which to get the sent video size.
* @return The sent video size or MS_VIDEO_SIZE_UNKNOWN if not available.
*/
LINPHONE_PUBLIC MSVideoSize linphone_call_get_sent_video_size(const LinphoneCall *call);
/**
* Gets the size of the video that is received.
* @param[in] call The call for which to get the received video size.
* @return The received video size or MS_VIDEO_SIZE_UNKNOWN if not available.
*/
LINPHONE_PUBLIC MSVideoSize linphone_call_get_received_video_size(const LinphoneCall *call);
/*keep this in sync with mediastreamer2/msvolume.h*/
/**
......
......@@ -80,6 +80,8 @@ struct _LinphoneCallParams{
LinphoneMediaEncryption media_encryption;
PayloadType *audio_codec; /*audio codec currently in use */
PayloadType *video_codec; /*video codec currently in use */
MSVideoSize sent_vsize; /* Size of the video currently being sent */
MSVideoSize recv_vsize; /* Size of the video currently being received */
int down_bw;
int up_bw;
int down_ptime;
......
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