From 55a4b5a77ed450198a5079c6baac9607f81fbd2b Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 20 Oct 2015 12:29:32 +0200 Subject: [PATCH] Fix part of the quality report test with realtime text problem --- coreapi/call_params.c | 5 +++++ coreapi/call_params.h | 7 +++++++ coreapi/quality_reporting.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/coreapi/call_params.c b/coreapi/call_params.c index bd53be849..823f14f54 100644 --- a/coreapi/call_params.c +++ b/coreapi/call_params.c @@ -234,6 +234,11 @@ const LinphonePayloadType* linphone_call_params_get_used_video_codec(const Linph return cp->video_codec; } +const LinphonePayloadType* linphone_call_params_get_used_text_codec(const LinphoneCallParams *cp) { + return cp->text_codec; +} + + bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp) { return cp->low_bandwidth; } diff --git a/coreapi/call_params.h b/coreapi/call_params.h index 5e42e0950..e3e6d1ee4 100644 --- a/coreapi/call_params.h +++ b/coreapi/call_params.h @@ -208,6 +208,13 @@ LINPHONE_PUBLIC const LinphonePayloadType* linphone_call_params_get_used_audio_c **/ LINPHONE_PUBLIC const LinphonePayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp); +/** + * Get the text codec used in the call, described as a LinphonePayloadType structure. + * @param[in] cp LinphoneCallParams object + * @return The LinphonePayloadType object corresponding to the text codec being used in the call. +**/ +LINPHONE_PUBLIC const LinphonePayloadType* linphone_call_params_get_used_text_codec(const LinphoneCallParams *cp); + /** * Tell whether the call has been configured in low bandwidth mode or not. * This mode can be automatically discovered thanks to a stun server when activate_edge_workarounds=1 in section [net] of configuration file. diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index e16f5f0d3..bebade118 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -539,6 +539,10 @@ void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) { stream = &call->videostream->ms; local_payload = linphone_call_params_get_used_video_codec(current_params); remote_payload = local_payload; + } else if (stats_type == LINPHONE_CALL_STATS_TEXT && call->textstream != NULL) { + stream = &call->textstream->ms; + local_payload = linphone_call_params_get_used_text_codec(current_params); + remote_payload = local_payload; } if (stream != NULL) {