mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Fix media start count check in testers.
This commit is contained in:
parent
a76f869d66
commit
7c6d7bc2d7
7 changed files with 22 additions and 8 deletions
|
|
@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "tester_utils.h"
|
||||
#include "private.h"
|
||||
|
||||
#include "call/call-p.h"
|
||||
#include "chat/chat-room/chat-room.h"
|
||||
#include "core/core.h"
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
|
|
@ -103,3 +104,7 @@ const bctbx_list_t *linphone_friend_list_get_dirty_friends_to_update(const Linph
|
|||
int linphone_friend_list_get_revision(const LinphoneFriendList *lfl) {
|
||||
return lfl->revision;
|
||||
}
|
||||
|
||||
unsigned int _linphone_call_get_nb_media_starts (const LinphoneCall *call) {
|
||||
return L_GET_PRIVATE_FROM_C_OBJECT(call)->getMediaStartCount();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ LINPHONE_PUBLIC LinphoneCallLog *linphone_call_get_log(const LinphoneCall *call)
|
|||
LINPHONE_PUBLIC MediaStream * linphone_call_get_stream(LinphoneCall *call, LinphoneStreamType type);
|
||||
LINPHONE_PUBLIC bool_t linphone_call_get_all_muted(const LinphoneCall *call);
|
||||
LINPHONE_PUBLIC LinphoneProxyConfig * linphone_call_get_dest_proxy(const LinphoneCall *call);
|
||||
LINPHONE_PUBLIC unsigned int _linphone_call_get_nb_media_starts (const LinphoneCall *call);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_call_params_set_no_user_consent(LinphoneCallParams *params, bool_t value);
|
||||
LINPHONE_PUBLIC bool_t linphone_call_params_get_update_call_when_ice_completed(const LinphoneCallParams *params);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public:
|
|||
|
||||
LinphoneProxyConfig *getDestProxy () const;
|
||||
IceSession *getIceSession () const;
|
||||
unsigned int getMediaStartCount () const;
|
||||
MediaStream *getMediaStream (LinphoneStreamType type) const;
|
||||
SalCallOp *getOp () const;
|
||||
void setAudioMuted (bool value);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ IceSession *CallPrivate::getIceSession () const {
|
|||
return static_pointer_cast<MediaSession>(getActiveSession())->getPrivate()->getIceSession();
|
||||
}
|
||||
|
||||
unsigned int CallPrivate::getMediaStartCount () const {
|
||||
return static_pointer_cast<MediaSession>(getActiveSession())->getPrivate()->getMediaStartCount();
|
||||
}
|
||||
|
||||
MediaStream *CallPrivate::getMediaStream (LinphoneStreamType type) const {
|
||||
return static_pointer_cast<MediaSession>(getActiveSession())->getPrivate()->getMediaStream(type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ public:
|
|||
|
||||
SalMediaDescription *getLocalDesc () const { return localDesc; }
|
||||
|
||||
unsigned int getMediaStartCount () const;
|
||||
MediaStream *getMediaStream (LinphoneStreamType type) const;
|
||||
LinphoneNatPolicy *getNatPolicy () const { return natPolicy; }
|
||||
|
||||
|
|
@ -308,7 +309,7 @@ private:
|
|||
bool authTokenVerified = false;
|
||||
std::string dtlsCertificateFingerprint;
|
||||
|
||||
unsigned int nbMediaStarts = 0;
|
||||
unsigned int mediaStartCount = 0;
|
||||
|
||||
// Upload bandwidth setting at the time the call is started. Used to detect if it changes during a call.
|
||||
int upBandwidth = 0;
|
||||
|
|
|
|||
|
|
@ -896,6 +896,10 @@ OrtpEvQueue * MediaSessionPrivate::getEventQueue (int streamIndex) const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned int MediaSessionPrivate::getMediaStartCount () const {
|
||||
return mediaStartCount;
|
||||
}
|
||||
|
||||
MediaStream * MediaSessionPrivate::getMediaStream (int streamIndex) const {
|
||||
if (streamIndex == mainAudioStreamIndex)
|
||||
return &audioStream->ms;
|
||||
|
|
@ -2775,7 +2779,7 @@ void MediaSessionPrivate::startStreams (LinphoneCallState targetState) {
|
|||
setSymmetricRtp(false);
|
||||
}
|
||||
|
||||
nbMediaStarts++;
|
||||
mediaStartCount++;
|
||||
bool videoWillBeUsed = false;
|
||||
#if defined(VIDEO_ENABLED)
|
||||
const SalStreamDescription *vstream = sal_media_description_find_best_stream(resultDesc, SalVideo);
|
||||
|
|
|
|||
|
|
@ -1530,16 +1530,14 @@ int check_nb_media_starts(LinphoneCoreManager *caller, LinphoneCoreManager *call
|
|||
BC_ASSERT_PTR_NOT_NULL(c2);
|
||||
if (!c1 || !c2) return FALSE;
|
||||
|
||||
#if 0
|
||||
if (c1) {
|
||||
c1_ret = c1->nb_media_starts == caller_nb_media_starts;
|
||||
BC_ASSERT_EQUAL(c1->nb_media_starts, caller_nb_media_starts, unsigned int, "%u");
|
||||
c1_ret = (_linphone_call_get_nb_media_starts(c1) == caller_nb_media_starts) ? TRUE : FALSE;
|
||||
BC_ASSERT_EQUAL(_linphone_call_get_nb_media_starts(c1), caller_nb_media_starts, unsigned int, "%u");
|
||||
}
|
||||
if (c2) {
|
||||
c2_ret = c2->nb_media_starts == callee_nb_media_starts;
|
||||
BC_ASSERT_EQUAL(c2->nb_media_starts, callee_nb_media_starts, unsigned int, "%u");
|
||||
c2_ret = (_linphone_call_get_nb_media_starts(c2) == callee_nb_media_starts) ? TRUE : FALSE;
|
||||
BC_ASSERT_EQUAL(_linphone_call_get_nb_media_starts(c2), callee_nb_media_starts, unsigned int, "%u");
|
||||
}
|
||||
#endif
|
||||
return c1_ret && c2_ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue