diff --git a/coreapi/conference.cc b/coreapi/conference.cc index 7f47b19aa..9defb80d3 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -66,7 +66,7 @@ public: bool microphoneIsMuted() const {return m_isMuted;} float getInputVolume() const; - virtual int getParticipantCount() const {return m_participants.size() + (isIn()?1:0);} + virtual int getSize() const {return m_participants.size() + (isIn()?1:0);} const std::list &getParticipants() const {return m_participants;} virtual int startRecording(const char *path) = 0; @@ -98,7 +98,7 @@ public: virtual int enter(); virtual int leave(); virtual bool isIn() const {return m_localParticipantStream!=NULL;} - virtual int getParticipantCount() const; + virtual int getSize() const; virtual int startRecording(const char *path); virtual int stopRecording(); @@ -380,7 +380,7 @@ int LocalConference::removeFromConference(LinphoneCall *call, bool_t active){ } int LocalConference::remoteParticipantsCount() { - int count=getParticipantCount(); + int count=getSize(); if (count==0) return 0; if (!m_localParticipantStream) return count; return count -1; @@ -477,7 +477,7 @@ int LocalConference::leave() { return 0; } -int LocalConference::getParticipantCount() const { +int LocalConference::getSize() const { if (m_conf == NULL) { return 0; } @@ -527,7 +527,7 @@ void LocalConference::onCallStreamStopping(LinphoneCall *call) { void LocalConference::onCallTerminating(LinphoneCall *call) { int remote_count=remoteParticipantsCount(); - ms_message("conference_check_uninit(): size=%i", getParticipantCount()); + ms_message("conference_check_uninit(): size=%i", getSize()); if (remote_count==1 && !m_terminated){ convertConferenceToCall(); } @@ -840,8 +840,8 @@ float linphone_conference_get_input_volume(const LinphoneConference *obj) { return ((Conference *)obj)->getInputVolume(); } -int linphone_conference_get_participant_count(const LinphoneConference *obj) { - return ((Conference *)obj)->getParticipantCount(); +int linphone_conference_get_size(const LinphoneConference *obj) { + return ((Conference *)obj)->getSize(); } MSList *linphone_conference_get_participants(const LinphoneConference *obj) { diff --git a/coreapi/conference.h b/coreapi/conference.h index 1f593f009..1086920c2 100644 --- a/coreapi/conference.h +++ b/coreapi/conference.h @@ -57,7 +57,7 @@ int linphone_conference_mute_microphone(LinphoneConference *obj, bool_t val); bool_t linphone_conference_microphone_is_muted(const LinphoneConference *obj); float linphone_conference_get_input_volume(const LinphoneConference *obj); -LINPHONE_PUBLIC int linphone_conference_get_participant_count(const LinphoneConference *obj); +LINPHONE_PUBLIC int linphone_conference_get_size(const LinphoneConference *obj); LINPHONE_PUBLIC MSList *linphone_conference_get_participants(const LinphoneConference *obj); int linphone_conference_start_recording(LinphoneConference *obj, const char *path); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 78ce379fd..086a55350 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7491,7 +7491,7 @@ bool_t linphone_core_is_in_conference(const LinphoneCore *lc) { } int linphone_core_get_conference_size(LinphoneCore *lc) { - if(lc->conf_ctx) return linphone_conference_get_participant_count(lc->conf_ctx); + if(lc->conf_ctx) return linphone_conference_get_size(lc->conf_ctx); return 0; } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index df19a5398..3c334be22 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3898,9 +3898,10 @@ LINPHONE_PUBLIC float linphone_core_get_conference_local_input_volume(LinphoneCo */ LINPHONE_PUBLIC int linphone_core_terminate_conference(LinphoneCore *lc); /** - * Get the number of remote participant in the running conference + * Get the number of participant in the running conference. The local + * participant is included in the count only if it is in the conference. * @param lc #LinphoneCore - * @return The number of remote participant + * @return The number of participant */ LINPHONE_PUBLIC int linphone_core_get_conference_size(LinphoneCore *lc); /** diff --git a/tester/multi_call_tester.c b/tester/multi_call_tester.c index 4e20d721b..bd4fc2d9d 100644 --- a/tester/multi_call_tester.c +++ b/tester/multi_call_tester.c @@ -262,8 +262,8 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag BC_ASSERT_PTR_NOT_NULL(conference = linphone_core_get_conference(marie->lc)); if(conference) { MSList *participants = linphone_conference_get_participants(conference); - BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), linphone_core_get_conference_size(marie->lc), int, "%d"); - BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), ms_list_size(participants)+(linphone_conference_is_in(conference)?1:0), int, "%d"); + BC_ASSERT_EQUAL(linphone_conference_get_size(conference), linphone_core_get_conference_size(marie->lc), int, "%d"); + BC_ASSERT_EQUAL(linphone_conference_get_size(conference), ms_list_size(participants)+(linphone_conference_is_in(conference)?1:0), int, "%d"); BC_ASSERT_TRUE(linphone_conference_is_in(conference)); ms_list_free_with_data(participants, (void(*)(void *))linphone_address_destroy); }