Fix creation of player in call.

This commit is contained in:
Ghislain MARY 2017-11-28 14:46:57 +01:00
parent 25e51fc63a
commit 7d16001da2
4 changed files with 19 additions and 7 deletions

View file

@ -1048,13 +1048,7 @@ void linphone_call_stop_recording (LinphoneCall *call) {
}
LinphonePlayer *linphone_call_get_player (LinphoneCall *call) {
#if 0
if (!call->player)
call->player=linphone_call_build_player(call);
return call->player;
#else
return nullptr;
#endif
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getPlayer();
}
bool_t linphone_call_media_in_progress (const LinphoneCall *call) {

View file

@ -67,6 +67,8 @@ public:
SalCallOp *getOp () const;
void setAudioMuted (bool value);
void createPlayer () const;
private:
/* CallListener */
void onAckBeingSent (LinphoneHeaders *headers) override;
@ -89,6 +91,7 @@ private:
LinphoneCore *core = nullptr;
Conference *conference = nullptr;
mutable LinphonePlayer *player = nullptr;
CallCallbackObj nextVideoFrameDecoded;

View file

@ -103,6 +103,13 @@ int CallPrivate::startInvite (const Address *destination) {
// -----------------------------------------------------------------------------
void CallPrivate::createPlayer () const {
L_Q();
player = linphone_call_build_player(L_GET_C_BACK_PTR(q));
}
// -----------------------------------------------------------------------------
void CallPrivate::onAckBeingSent (LinphoneHeaders *headers) {
if (lcall)
linphone_call_notify_ack_processing(lcall, headers, false);
@ -445,6 +452,13 @@ const MediaSessionParams *Call::getParams () const {
return static_cast<const MediaSession *>(d->getActiveSession().get())->getMediaParams();
}
LinphonePlayer *Call::getPlayer () const {
L_D();
if (!d->player)
d->createPlayer();
return d->player;
}
float Call::getPlayVolume () const {
L_D();
return static_cast<const MediaSession *>(d->getActiveSession().get())->getPlayVolume();

View file

@ -89,6 +89,7 @@ public:
float getMicrophoneVolumeGain () const;
void *getNativeVideoWindowId () const;
const MediaSessionParams *getParams () const;
LinphonePlayer *getPlayer () const;
float getPlayVolume () const;
LinphoneReason getReason () const;
float getRecordVolume () const;