Use a callback from SDK to know when Opengl is failing

This commit is contained in:
Julien Wadel 2023-04-18 10:41:24 +02:00
parent a8184ccdca
commit 95ad641064
15 changed files with 47 additions and 5 deletions

View file

@ -38,3 +38,8 @@ void CallListener::onRemoteRecording(const std::shared_ptr<linphone::Call> & cal
qDebug() << "onRemoteRecording: " << recording;
emit remoteRecording(call, recording);
}
void CallListener::onVideoDisplayErrorReceived(const std::shared_ptr<linphone::Call> & call, const int errorCode) {
qDebug() << "onVideoDisplayErrorReceived: " << errorCode << "[" << call.get() << "]";
emit videoDisplayErrorReceived(call, errorCode);
}

View file

@ -37,9 +37,11 @@ public:
virtual ~CallListener(){}
virtual void onRemoteRecording(const std::shared_ptr<linphone::Call> & call, bool recording) override;
virtual void onVideoDisplayErrorReceived(const std::shared_ptr<linphone::Call> & call, const int errorCode) override;
signals:
void remoteRecording(const std::shared_ptr<linphone::Call> & call, bool recording);
void videoDisplayErrorReceived(const std::shared_ptr<linphone::Call> & call, const int errorCode);
};
Q_DECLARE_METATYPE(CallListener*)

View file

@ -1012,6 +1012,10 @@ void CallModel::onParticipantAdminStatusChanged(const std::shared_ptr<const linp
}
}
void CallModel::onVideoDisplayErrorReceived(const std::shared_ptr<linphone::Call> & call, const int errorCode){
emit videoDisplayErrorReceived(errorCode);
}
void CallModel::setRemoteDisplayName(const std::string& name){
mRemoteAddress->setDisplayName(name);
if(mCall) {

View file

@ -208,6 +208,7 @@ public slots:
void onRemoteRecording(const std::shared_ptr<linphone::Call> & call, bool recording);
void onChatRoomInitialized(int state);
void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant> & participant);
void onVideoDisplayErrorReceived(const std::shared_ptr<linphone::Call> & call, const int errorCode);
signals:
void meAdminChanged();
@ -226,6 +227,7 @@ signals:
void statsUpdated ();
void statusChanged (CallStatus status);
void videoRequested ();
void videoDisplayErrorReceived(int errorCode);
void securityUpdated ();
void encryptionChanged();
void isPQZrtpChanged();

View file

@ -345,11 +345,13 @@ QVariantMap CallsListModel::createChatRoom(const QString& subject, const int& se
ChatRoomInitializer::start(initializer);
}
timeline = timelineList->getTimeline(chatRoom, true);
qWarning() << (int)chatRoom->getState();
}else{
if(admins.size() > 0){
ChatRoomInitializer::create(chatRoom)->setAdmins(admins);
}
timeline = timelineList->getTimeline(chatRoom, true);
qWarning() << (int)chatRoom->getState();
}
if(timeline){
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = false;

View file

@ -63,12 +63,12 @@ void CoreHandlers::connectTo(CoreListener * listener){
connect(listener, &CoreListener::messagesReceived, this, &CoreHandlers::onMessagesReceived);
connect(listener, &CoreListener::notifyPresenceReceivedForUriOrTel, this, &CoreHandlers::onNotifyPresenceReceivedForUriOrTel);
connect(listener, &CoreListener::notifyPresenceReceived, this, &CoreHandlers::onNotifyPresenceReceived);
connect(listener, &CoreListener::previewDisplayErrorReceived, this, &CoreHandlers::onPreviewDisplayErrorReceived);
connect(listener, &CoreListener::qrcodeFound, this, &CoreHandlers::onQrcodeFound);
connect(listener, &CoreListener::transferStateChanged, this, &CoreHandlers::onTransferStateChanged);
connect(listener, &CoreListener::versionUpdateCheckResultReceived, this, &CoreHandlers::onVersionUpdateCheckResultReceived);
connect(listener, &CoreListener::ecCalibrationResult, this, &CoreHandlers::onEcCalibrationResult);
connect(listener, &CoreListener::conferenceInfoReceived, this, &CoreHandlers::onConferenceInfoReceived);
}
@ -342,6 +342,11 @@ void CoreHandlers::onNotifyPresenceReceived (
emit presenceStatusReceived(linphoneFriend);
}
void CoreHandlers::onPreviewDisplayErrorReceived(const std::shared_ptr<linphone::Core> & core, const int errorCode){
qDebug() << "[CoreHandlers] onPreviewDisplayErrorReceived: " << errorCode;
emit previewDisplayErrorReceived(core, errorCode);
}
void CoreHandlers::onQrcodeFound(const std::shared_ptr<linphone::Core> & core, const std::string & result){
emit foundQRCode(result);
}

View file

@ -53,6 +53,7 @@ signals:
void isComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom);
void logsUploadStateChanged (linphone::Core::LogCollectionUploadState state, const std::string &info);
void messagesReceived (const std::list<std::shared_ptr<linphone::ChatMessage>> &messages);
void previewDisplayErrorReceived(const std::shared_ptr<linphone::Core> & core, const int errorCode);
void presenceReceived (const QString &sipAddress, const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
void presenceStatusReceived(std::shared_ptr<linphone::Friend> contact);
void registrationStateChanged (const std::shared_ptr<linphone::Account> &account, linphone::RegistrationState state);
@ -84,6 +85,7 @@ public slots:
void onMessagesReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::list<std::shared_ptr<linphone::ChatMessage>> &messages);
void onNotifyPresenceReceivedForUriOrTel (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend,const std::string &uriOrTel,const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
void onNotifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend);
void onPreviewDisplayErrorReceived(const std::shared_ptr<linphone::Core> & core, const int errorCode);
void onQrcodeFound(const std::shared_ptr<linphone::Core> & core, const std::string & result);
void onTransferStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state);
void onVersionUpdateCheckResultReceived (const std::shared_ptr<linphone::Core> & core,linphone::VersionUpdateCheckResult result,const std::string &version,const std::string &url);

View file

@ -87,6 +87,9 @@ void CoreListener::onNotifyPresenceReceivedForUriOrTel (const std::shared_ptr<li
void CoreListener::onNotifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend){
emit notifyPresenceReceived (core,linphoneFriend);
}
void CoreListener::onPreviewDisplayErrorReceived(const std::shared_ptr<linphone::Core> & core, const int errorCode){
emit previewDisplayErrorReceived(core,errorCode);
}
void CoreListener::onQrcodeFound(const std::shared_ptr<linphone::Core> & core, const std::string & result){
emit qrcodeFound(core, result);
}

View file

@ -54,12 +54,14 @@ public:
virtual void onMessagesReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::list<std::shared_ptr<linphone::ChatMessage>> &messages) override;
virtual void onNotifyPresenceReceivedForUriOrTel (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend,const std::string &uriOrTel,const std::shared_ptr<const linphone::PresenceModel> &presenceModel) override;
virtual void onNotifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend) override;
virtual void onPreviewDisplayErrorReceived(const std::shared_ptr<linphone::Core> & core, const int errorCode) override;
virtual void onQrcodeFound(const std::shared_ptr<linphone::Core> & core, const std::string & result) override;
virtual void onTransferStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state) override;
virtual void onVersionUpdateCheckResultReceived (const std::shared_ptr<linphone::Core> & core,linphone::VersionUpdateCheckResult result,const std::string &version,const std::string &url) override;
virtual void onEcCalibrationResult(const std::shared_ptr<linphone::Core> & core,linphone::EcCalibratorStatus status,int delayMs) override;
virtual void onConferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo) override;
signals:
void accountRegistrationStateChanged(const std::shared_ptr<linphone::Core> & core,const std::shared_ptr<linphone::Account> & account,linphone::RegistrationState state,const std::string & message);
void authenticationRequested (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::AuthInfo> &authInfo,linphone::AuthMethod method);
@ -80,6 +82,7 @@ signals:
void messagesReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::ChatRoom> &room,const std::list<std::shared_ptr<linphone::ChatMessage>> &messages);
void notifyPresenceReceivedForUriOrTel (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend,const std::string &uriOrTel,const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
void notifyPresenceReceived (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Friend> &linphoneFriend);
void previewDisplayErrorReceived(const std::shared_ptr<linphone::Core> & core, const int errorCode);
void qrcodeFound(const std::shared_ptr<linphone::Core> & core, const std::string & result);
void transferStateChanged (const std::shared_ptr<linphone::Core> &core,const std::shared_ptr<linphone::Call> &call,linphone::Call::State state);
void versionUpdateCheckResultReceived (const std::shared_ptr<linphone::Core> & core,linphone::VersionUpdateCheckResult result,const std::string &version,const std::string &url);

View file

@ -38,6 +38,11 @@ void ParticipantDeviceListener::onIsMuted(const std::shared_ptr<linphone::Partic
emit isMuted(participantDevice, isMutedVar);
}
void ParticipantDeviceListener::onVideoDisplayErrorReceived(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, int errorCode){
qDebug() << "onVideoDisplayErrorReceived: " << participantDevice.get() << " => " << errorCode << " (" << participantDevice->getName().c_str() << ")";
emit videoDisplayErrorReceived(participantDevice, errorCode);
}
void ParticipantDeviceListener::onStateChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::ParticipantDevice::State state){
qDebug() << "onStateChanged: " << participantDevice->getAddress()->asString().c_str() << " " << (int)state;
emit stateChanged(participantDevice, state);

View file

@ -41,12 +41,15 @@ public:
virtual void onStateChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::ParticipantDevice::State state) override;
virtual void onStreamCapabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::MediaDirection direction, linphone::StreamType streamType) override;
virtual void onStreamAvailabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool available, linphone::StreamType streamType) override;
virtual void onVideoDisplayErrorReceived(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, int errorCode) override;
signals:
void isSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isSpeaking);
void isMuted(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isMuted);
void stateChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::ParticipantDevice::State state);
void streamCapabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::MediaDirection direction, linphone::StreamType streamType);
void streamAvailabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool available, linphone::StreamType streamType);
void videoDisplayErrorReceived(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, int errorCode);
};
#endif // PARTICIPANT_MODEL_H_

View file

@ -32,6 +32,7 @@ void ParticipantDeviceModel::connectTo(ParticipantDeviceListener * listener){
connect(listener, &ParticipantDeviceListener::stateChanged, this, &ParticipantDeviceModel::onStateChanged);
connect(listener, &ParticipantDeviceListener::streamCapabilityChanged, this, &ParticipantDeviceModel::onStreamCapabilityChanged);
connect(listener, &ParticipantDeviceListener::streamAvailabilityChanged, this, &ParticipantDeviceModel::onStreamAvailabilityChanged);
connect(listener, &ParticipantDeviceListener::videoDisplayErrorReceived, this, &ParticipantDeviceModel::onVideoDisplayErrorReceived);
}
// =============================================================================
@ -197,3 +198,6 @@ void ParticipantDeviceModel::onStreamCapabilityChanged(const std::shared_ptr<lin
void ParticipantDeviceModel::onStreamAvailabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool available, linphone::StreamType streamType) {
updateVideoEnabled();
}
void ParticipantDeviceModel::onVideoDisplayErrorReceived(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, int errorCode){
emit videoDisplayErrorReceived(errorCode);
}

View file

@ -79,6 +79,7 @@ public:
virtual void onStateChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::ParticipantDevice::State state);
virtual void onStreamCapabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::MediaDirection direction, linphone::StreamType streamType);
virtual void onStreamAvailabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool available, linphone::StreamType streamType);
virtual void onVideoDisplayErrorReceived(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, int errorCode);
void connectTo(ParticipantDeviceListener * listener);
void updateVideoEnabled();
@ -93,6 +94,7 @@ signals:
void isSpeakingChanged();
void isMutedChanged();
void stateChanged();
void videoDisplayErrorReceived(int errorCode);
private:

View file

@ -45,7 +45,7 @@ Item{
}
Rectangle {
id: backgroundArea
color: mainItem.colorModel.color
color: mainItem.color
anchors.fill: parent
radius: CameraViewStyle.radius
Component {
@ -120,7 +120,7 @@ Item{
height: CameraViewStyle.pauseView.button.iconSize
width: height
radius: width/2
color: CameraViewStyle.pauseView.button.backgroundNormalColor.colorModel.color
color: CameraViewStyle.pauseView.button.backgroundNormalColor.color
Icon{
anchors.centerIn: parent
icon: CameraViewStyle.pauseView.button.icon
@ -170,7 +170,7 @@ Item{
height: CameraViewStyle.isMuted.button.iconSize
width: height
radius: width/2
color: CameraViewStyle.isMuted.button.backgroundNormalColor.colorModel.color
color: CameraViewStyle.isMuted.button.backgroundNormalColor.color
Icon{
anchors.centerIn: parent
icon: CameraViewStyle.isMuted.button.icon

View file

@ -203,7 +203,7 @@ Loader{// Use of Loader because of Repeater (items cannot be loaded dynamically)
Component.onCompleted: messagesTextsList.updateBestWidth()
delegate:
ChatTextMessage {
width: parent && parent.width
width: parent && parent.width || 0
contentModel: $modelData
onLastTextSelectedChanged: mainItem.lastTextSelectedChanged(lastTextSelected)
color: mainItem.useTextColor