feat(Core): deal with more warning options!

This commit is contained in:
Ronan Abhamon 2017-09-19 14:20:14 +02:00
parent e5444986c9
commit 8ae87e2f3f
23 changed files with 249 additions and 203 deletions

View file

@ -90,6 +90,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckSymbolExists)
include(CMakePushCheckState)
include(GNUInstallDirs)
include(CheckCXXCompilerFlag)
if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
@ -205,7 +206,7 @@ endif()
set(LINPHONE_LDFLAGS "${BELLESIP_LDFLAGS} ${MEDIASTREAMER2_LDFLAGS}")
if(BELCARD_FOUND AND APPLE)
set(LINPHONE_LDFLAGS "${LINPHONE_LDFLAGS} -stdlib=libc++")
set(LINPHONE_LDFLAGS "${LINPHONE_LDFLAGS} -stdlib=libc++")
endif()
# include_directories must be called only UNDER THIS LINE in order to use our
@ -281,7 +282,22 @@ if(MSVC)
list(APPEND STRICT_OPTIONS_CPP "/WX")
endif()
else()
list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized" "-Wno-error=deprecated-declarations")
list(APPEND STRICT_OPTIONS_CPP "\
-Wall \
-Wcast-align \
-Wconversion \
-Werror=return-type \
-Wfloat-equal \
-Winit-self \
-Wno-error=deprecated-declarations \
-Woverloaded-virtual \
-Wpointer-arith \
-Wuninitialized \
-Wunused")
CHECK_CXX_COMPILER_FLAG("-Wsuggest-override" SUGGEST_OVERRIDE)
if (SUGGEST_OVERRIDE)
list(APPEND STRICT_OPTIONS_CPP "-Wsuggest-override -Werror=suggest-override")
endif ()
list(APPEND STRICT_OPTIONS_C "-Wstrict-prototypes" "-Werror=strict-prototypes")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND STRICT_OPTIONS_C "-fno-inline-small-functions")
@ -307,7 +323,6 @@ if(STRICT_OPTIONS_C)
list(REMOVE_DUPLICATES STRICT_OPTIONS_C)
endif()
set(GETTEXT_PACKAGE "linphone")
if(ENABLE_RELATIVE_PREFIX)
set(LINPHONE_DATA_DIR ".")

View file

@ -407,7 +407,7 @@ static MS2_INLINE void set_string(char **dest, const char *src, bool_t lowercase
*dest=ms_strdup(src);
if (lowercase) {
char *cur = *dest;
for (; *cur; cur++) *cur = tolower(*cur);
for (; *cur; cur++) *cur = (char)tolower(*cur);
}
}
}

View file

@ -178,13 +178,19 @@ set(LINPHONE_PRIVATE_HEADER_FILES ${LINPHONE_PRIVATE_HEADER_FILES} PARENT_SCOPE)
bc_apply_compile_flags(LINPHONE_CXX_OBJECTS_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
if(ENABLE_STATIC)
add_library(linphone-cxx-objects-static OBJECT ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES})
add_library(
linphone-cxx-objects-static OBJECT
${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES}
)
target_compile_definitions(linphone-cxx-objects-static PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
endif()
if(ENABLE_SHARED)
add_library(linphone-cxx-objects OBJECT ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES})
add_library(
linphone-cxx-objects OBJECT
${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES}
)
target_compile_definitions(linphone-cxx-objects PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
target_include_directories(linphone-cxx-objects SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
target_compile_options(linphone-cxx-objects PRIVATE "-fPIC")

View file

@ -42,7 +42,7 @@ LinphoneAddress *linphone_address_new (const char *address) {
}
LinphoneAddress *linphone_address_clone (const LinphoneAddress *address) {
return (LinphoneAddress *)belle_sip_object_clone(BELLE_SIP_OBJECT(address));
return reinterpret_cast<LinphoneAddress *>(belle_sip_object_clone(BELLE_SIP_OBJECT(address)));
}
LinphoneAddress *linphone_address_ref (LinphoneAddress *address) {

View file

@ -59,19 +59,19 @@ public:
private:
/* CallListener */
void onAckBeingSent (LinphoneHeaders *headers);
void onAckReceived (LinphoneHeaders *headers);
void onCallSetReleased ();
void onCallSetTerminated ();
void onCallStateChanged (LinphoneCallState state, const std::string &message);
void onIncomingCallStarted ();
void onIncomingCallToBeAdded ();
void onEncryptionChanged (bool activated, const std::string &authToken);
void onStatsUpdated (const LinphoneCallStats *stats);
void onResetCurrentCall ();
void onSetCurrentCall ();
void onFirstVideoFrameDecoded ();
void onResetFirstVideoFrameDecoded ();
void onAckBeingSent (LinphoneHeaders *headers) override;
void onAckReceived (LinphoneHeaders *headers) override;
void onCallSetReleased () override;
void onCallSetTerminated () override;
void onCallStateChanged (LinphoneCallState state, const std::string &message) override;
void onIncomingCallStarted () override;
void onIncomingCallToBeAdded () override;
void onEncryptionChanged (bool activated, const std::string &authToken) override;
void onStatsUpdated (const LinphoneCallStats *stats) override;
void onResetCurrentCall () override;
void onSetCurrentCall () override;
void onFirstVideoFrameDecoded () override;
void onResetFirstVideoFrameDecoded () override;
private:
LinphoneCall *lcall = nullptr;

View file

@ -39,14 +39,14 @@ public:
virtual ~BasicChatRoom () = default;
/* ConferenceInterface */
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia);
void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia);
bool canHandleParticipants () const;
const std::string& getId () const;
int getNbParticipants () const;
std::list<std::shared_ptr<Participant>> getParticipants () const;
void removeParticipant (const std::shared_ptr<const Participant> &participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia) override;
bool canHandleParticipants () const override;
const std::string& getId () const override;
int getNbParticipants () const override;
std::list<std::shared_ptr<Participant>> getParticipants () const override;
void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) override;
private:
L_DECLARE_PRIVATE(BasicChatRoom);

View file

@ -19,15 +19,15 @@
#ifndef _CHAT_ROOM_P_H_
#define _CHAT_ROOM_P_H_
// From coreapi.
#include "private.h"
#include "linphone/enums/chat-room-enums.h"
#include "linphone/utils/enum-generator.h"
// From coreapi.
#include "private.h"
#include "chat-room.h"
#include "is-composing.h"
#include "is-composing-listener.h"
#include "is-composing.h"
#include "object/object-p.h"
// =============================================================================
@ -86,9 +86,9 @@ private:
private:
/* IsComposingListener */
void onIsComposingStateChanged (bool isComposing);
void onIsRemoteComposingStateChanged (bool isComposing);
void onIsComposingRefreshNeeded ();
void onIsComposingStateChanged (bool isComposing) override;
void onIsRemoteComposingStateChanged (bool isComposing) override;
void onIsComposingRefreshNeeded () override;
public:
LinphoneCore *core = nullptr;

View file

@ -120,7 +120,7 @@ void ChatRoomPrivate::sendImdn (const string &content, LinphoneReason reason) {
/* Sending out of call */
SalOp *op = sal_op_new(core->sal);
linphone_configure_op(core, op, peer, nullptr, lp_config_get_int(core->config, "sip", "chat_msg_with_contact", 0));
linphone_configure_op(core, op, peer, nullptr, !!lp_config_get_int(core->config, "sip", "chat_msg_with_contact", 0));
LinphoneChatMessage *msg = q->createMessage(content);
LinphoneAddress *fromAddr = linphone_address_new(identity);
linphone_chat_message_set_from_address(msg, fromAddr);
@ -206,7 +206,7 @@ void ChatRoomPrivate::sendIsComposingNotification () {
/* Sending out of call */
SalOp *op = sal_op_new(core->sal);
linphone_configure_op(core, op, peer, nullptr, lp_config_get_int(core->config, "sip", "chat_msg_with_contact", 0));
linphone_configure_op(core, op, peer, nullptr, !!lp_config_get_int(core->config, "sip", "chat_msg_with_contact", 0));
string content = isComposingHandler.marshal(isComposing);
if (!content.empty()) {
int retval = -1;
@ -284,7 +284,7 @@ int ChatRoomPrivate::createChatMessageFromDb (int argc, char **argv, char **colN
linphone_address_unref(peer);
newMessage->time = (time_t)atol(argv[9]);
newMessage->is_read = atoi(argv[6]);
newMessage->is_read = !!atoi(argv[6]);
newMessage->state = static_cast<LinphoneChatMessageState>(atoi(argv[7]));
newMessage->storage_id = storageId;
newMessage->external_body_url = ms_strdup(argv[8]);
@ -859,8 +859,10 @@ void ChatRoom::sendMessage (LinphoneChatMessage *msg) {
if (!op) {
/* Sending out of call */
msg->op = op = sal_op_new(d->core->sal);
linphone_configure_op(d->core, op, peer, msg->custom_headers,
lp_config_get_int(d->core->config, "sip", "chat_msg_with_contact", 0));
linphone_configure_op(
d->core, op, peer, msg->custom_headers,
!!lp_config_get_int(d->core->config, "sip", "chat_msg_with_contact", 0)
);
sal_op_set_user_pointer(op, msg); /* If out of call, directly store msg */
}

View file

@ -40,14 +40,14 @@ public:
public:
/* ConferenceInterface */
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia);
void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia);
bool canHandleParticipants () const;
const std::string& getId () const;
int getNbParticipants () const;
std::list<std::shared_ptr<Participant>> getParticipants () const;
void removeParticipant (const std::shared_ptr<const Participant> &participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia) override;
bool canHandleParticipants () const override;
const std::string& getId () const override;
int getNbParticipants () const override;
std::list<std::shared_ptr<Participant>> getParticipants () const override;
void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) override;
private:
/* ConferenceListener */

View file

@ -16,23 +16,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CHAT_MESSAGE_MODIFIER_H_
#define _CHAT_MESSAGE_MODIFIER_H_
#include "chat/chat-message.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class ChatMessageModifier {
public:
virtual void encode(LinphonePrivate::ChatMessagePrivate* msg) = 0;
virtual void decode(LinphonePrivate::ChatMessagePrivate* msg) = 0;
virtual ~ChatMessageModifier () = default;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CHAT_MESSAGE_MODIFIER_H_
#ifndef _CHAT_MESSAGE_MODIFIER_H_
#define _CHAT_MESSAGE_MODIFIER_H_
#include "linphone/utils/general.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class ChatMessagePrivate;
class ChatMessageModifier {
public:
virtual ~ChatMessageModifier () = default;
virtual void encode (ChatMessagePrivate *messagePrivate) = 0;
virtual void decode (ChatMessagePrivate *messagePrivate) = 0;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_

View file

@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <vector>
#include "chat/chat-message-p.h"
#include "chat/cpim/cpim.h"
#include "content/content-type.h"
@ -31,7 +29,7 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
void CpimChatMessageModifier::encode(LinphonePrivate::ChatMessagePrivate* msg) {
void CpimChatMessageModifier::encode (ChatMessagePrivate *messagePrivate) {
Cpim::Message message;
Cpim::GenericHeader cpimContentTypeHeader;
cpimContentTypeHeader.setName("Content-Type");
@ -39,14 +37,14 @@ void CpimChatMessageModifier::encode(LinphonePrivate::ChatMessagePrivate* msg) {
message.addCpimHeader(cpimContentTypeHeader);
shared_ptr<Content> content;
if (msg->internalContent) {
if (messagePrivate->internalContent) {
// Another ChatMessageModifier was called before this one, we apply our changes on the private content
content = msg->internalContent;
content = messagePrivate->internalContent;
} else {
// We're the first ChatMessageModifier to be called, we'll create the private content from the public one
// We take the first one because if there is more of them, the multipart modifier should have been called first
// So we should not be in this block
content = msg->contents.front();
content = messagePrivate->contents.front();
}
string contentType = content->getContentType().asString();
@ -67,16 +65,16 @@ void CpimChatMessageModifier::encode(LinphonePrivate::ChatMessagePrivate* msg) {
ContentType newContentType("Message/CPIM");
newContent->setContentType(newContentType);
newContent->setBody(message.asString());
msg->internalContent = newContent;
messagePrivate->internalContent = newContent;
}
}
void CpimChatMessageModifier::decode(LinphonePrivate::ChatMessagePrivate* msg) {
void CpimChatMessageModifier::decode (ChatMessagePrivate *messagePrivate) {
shared_ptr<Content> content;
if (msg->internalContent) {
content = msg->internalContent;
if (messagePrivate->internalContent) {
content = messagePrivate->internalContent;
} else {
content = msg->contents.front();
content = messagePrivate->contents.front();
}
ContentType contentType = content->getContentType();

View file

@ -16,24 +16,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_
#define _CPIM_CHAT_MESSAGE_MODIFIER_H_
#include "chat-message-modifier.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class CpimChatMessageModifier : ChatMessageModifier {
public:
CpimChatMessageModifier() {};
virtual void encode(LinphonePrivate::ChatMessagePrivate* msg);
virtual void decode(LinphonePrivate::ChatMessagePrivate* msg);
virtual ~CpimChatMessageModifier () = default;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_
#ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_
#define _CPIM_CHAT_MESSAGE_MODIFIER_H_
#include "chat-message-modifier.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class CpimChatMessageModifier : public ChatMessageModifier {
public:
CpimChatMessageModifier () = default;
void encode (ChatMessagePrivate *messagePrivate) override;
void decode (ChatMessagePrivate *messagePrivate) override;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_

View file

@ -16,21 +16,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "chat/chat-message-p.h"
#include "multipart-chat-message-modifier.h"
#include "chat/chat-message-p.h"
#include "multipart-chat-message-modifier.h"
LINPHONE_BEGIN_NAMESPACE
using namespace std;
// =============================================================================
void MultipartChatMessageModifier::encode(LinphonePrivate::ChatMessagePrivate* msg) {
if (msg->contents.size() > 1) {
//TODO
}
}
using namespace std;
void MultipartChatMessageModifier::decode(LinphonePrivate::ChatMessagePrivate* msg) {
//TODO
}
LINPHONE_END_NAMESPACE
LINPHONE_BEGIN_NAMESPACE
void MultipartChatMessageModifier::encode (ChatMessagePrivate *messagePrivate) {
if (messagePrivate->contents.size() > 1) {
//TODO
}
}
void MultipartChatMessageModifier::decode (ChatMessagePrivate *messagePrivate) {
//TODO
}
LINPHONE_END_NAMESPACE

View file

@ -16,24 +16,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_
#define _MULTIPART_CHAT_MESSAGE_MODIFIER_H_
#include "chat-message-modifier.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class MultipartChatMessageModifier : ChatMessageModifier {
public:
MultipartChatMessageModifier() {};
virtual void encode(LinphonePrivate::ChatMessagePrivate* msg);
virtual void decode(LinphonePrivate::ChatMessagePrivate* msg);
virtual ~MultipartChatMessageModifier () = default;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_
#ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_
#define _MULTIPART_CHAT_MESSAGE_MODIFIER_H_
#include "chat-message-modifier.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class MultipartChatMessageModifier : public ChatMessageModifier {
public:
MultipartChatMessageModifier () = default;
void encode (ChatMessagePrivate *message) override;
void decode (ChatMessagePrivate *message) override;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_

View file

@ -37,20 +37,20 @@ public:
RealTimeTextChatRoom (LinphoneCore *core, const Address &peerAddress);
virtual ~RealTimeTextChatRoom () = default;
void sendMessage (LinphoneChatMessage *msg);
void sendMessage (LinphoneChatMessage *msg) override;
uint32_t getChar () const;
LinphoneCall *getCall () const;
/* ConferenceInterface */
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia);
void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia);
bool canHandleParticipants () const;
const std::string& getId () const;
int getNbParticipants () const;
std::list<std::shared_ptr<Participant>> getParticipants () const;
void removeParticipant (const std::shared_ptr<const Participant> &participant);
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia) override;
bool canHandleParticipants () const override;
const std::string& getId () const override;
int getNbParticipants () const override;
std::list<std::shared_ptr<Participant>> getParticipants () const override;
void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) override;
private:
L_DECLARE_PRIVATE(RealTimeTextChatRoom);

View file

@ -19,9 +19,8 @@
#ifndef _CONFERENCE_H_
#define _CONFERENCE_H_
#include <memory>
#include "linphone/types.h"
#include "object/object.h"
#include "address/address.h"
#include "call/call-listener.h"
#include "conference/conference-interface.h"
@ -29,8 +28,6 @@
#include "conference/participant.h"
#include "conference/session/call-session-listener.h"
#include "linphone/types.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
@ -50,30 +47,30 @@ public:
public:
/* ConferenceInterface */
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia);
virtual void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia);
virtual bool canHandleParticipants () const;
virtual const std::string& getId () const;
virtual int getNbParticipants () const;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const;
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant);
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants);
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
virtual void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia) override;
virtual bool canHandleParticipants () const override;
virtual const std::string& getId () const override;
virtual int getNbParticipants () const override;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const override;
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) override;
private:
/* CallSessionListener */
virtual void onAckBeingSent (const CallSession &session, LinphoneHeaders *headers);
virtual void onAckReceived (const CallSession &session, LinphoneHeaders *headers);
virtual void onCallSessionAccepted (const CallSession &session);
virtual void onCallSessionSetReleased (const CallSession &session);
virtual void onCallSessionSetTerminated (const CallSession &session);
virtual void onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message);
virtual void onIncomingCallSessionStarted (const CallSession &session);
virtual void onEncryptionChanged (const CallSession &session, bool activated, const std::string &authToken);
virtual void onStatsUpdated (const LinphoneCallStats *stats);
virtual void onResetCurrentSession (const CallSession &session);
virtual void onSetCurrentSession (const CallSession &session);
virtual void onFirstVideoFrameDecoded (const CallSession &session);
virtual void onResetFirstVideoFrameDecoded (const CallSession &session);
virtual void onAckBeingSent (const CallSession &session, LinphoneHeaders *headers) override;
virtual void onAckReceived (const CallSession &session, LinphoneHeaders *headers) override;
virtual void onCallSessionAccepted (const CallSession &session) override;
virtual void onCallSessionSetReleased (const CallSession &session) override;
virtual void onCallSessionSetTerminated (const CallSession &session) override;
virtual void onCallSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message) override;
virtual void onIncomingCallSessionStarted (const CallSession &session) override;
virtual void onEncryptionChanged (const CallSession &session, bool activated, const std::string &authToken) override;
virtual void onStatsUpdated (const LinphoneCallStats *stats) override;
virtual void onResetCurrentSession (const CallSession &session) override;
virtual void onSetCurrentSession (const CallSession &session) override;
virtual void onFirstVideoFrameDecoded (const CallSession &session) override;
virtual void onResetFirstVideoFrameDecoded (const CallSession &session) override;
protected:
explicit Conference (LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);

View file

@ -20,10 +20,20 @@
#include "conference/participant.h"
#include "local-conference-event-handler.h"
#include "object/object-p.h"
#include "xml/conference-info.h"
#include "private.h"
#if __clang__ || __GNUC__ >= 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#include "xml/conference-info.h"
#if __clang__ || __GNUC__ >= 4
#pragma GCC diagnostic pop
#endif
// =============================================================================
using namespace std;

View file

@ -35,8 +35,14 @@ public:
public:
/* ConferenceInterface */
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia);
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant);
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
virtual void addParticipants (const std::list<Address> &addresses, const CallSessionParams *params, bool hasMedia) override;
virtual bool canHandleParticipants () const override;
virtual const std::string& getId () const override;
virtual int getNbParticipants () const override;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const override;
virtual void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
virtual void removeParticipants (const std::list<std::shared_ptr<Participant>> &participants) override;
private:
L_DISABLE_COPY(LocalConference);

View file

@ -218,7 +218,7 @@ void MediaSessionParams::initDefault (LinphoneCore *core) {
d->encryption = linphone_core_get_media_encryption(core);
d->avpfEnabled = (linphone_core_get_avpf_mode(core) == LinphoneAVPFEnabled);
d->_implicitRtcpFbEnabled = lp_config_get_int(linphone_core_get_config(core), "rtp", "rtcp_fb_implicit_rtcp_fb", true);
d->avpfRrInterval = linphone_core_get_avpf_rr_interval(core);
d->avpfRrInterval = static_cast<uint16_t>(linphone_core_get_avpf_rr_interval(core));
d->audioDirection = LinphoneMediaDirectionSendRecv;
d->videoDirection = LinphoneMediaDirectionSendRecv;
d->earlyMediaSendingEnabled = lp_config_get_int(linphone_core_get_config(core), "misc", "real_early_media", false);

View file

@ -19,10 +19,10 @@
#ifndef _MEDIA_SESSION_PARAMS_H_
#define _MEDIA_SESSION_PARAMS_H_
#include "call-session-params.h"
#include <ortp/payloadtype.h>
#include "call-session-params.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
@ -40,7 +40,7 @@ public:
MediaSessionParams (const MediaSessionParams &src);
virtual ~MediaSessionParams () = default;
void initDefault (LinphoneCore *core);
void initDefault (LinphoneCore *core) override;
bool audioEnabled () const;
bool audioMulticastEnabled () const;

View file

@ -17,10 +17,20 @@
*/
#include "remote-conference-event-handler.h"
#include "xml/conference-info.h"
#include "private.h"
#include "object/object-p.h"
#if __clang__ || __GNUC__ >= 4
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#include "xml/conference-info.h"
#if __clang__ || __GNUC__ >= 4
#pragma GCC diagnostic pop
#endif
// =============================================================================
using namespace std;
@ -37,7 +47,7 @@ public:
LinphoneEvent *lev = nullptr;
};
// =============================================================================
// -----------------------------------------------------------------------------
RemoteConferenceEventHandler::RemoteConferenceEventHandler(LinphoneCore *core, ConferenceListener *listener)
: Object(*new RemoteConferenceEventHandlerPrivate) {

View file

@ -45,15 +45,15 @@ public:
public:
static void stunAuthRequestedCb (void *userData, const char *realm, const char *nonce, const char **username, const char **password, const char **ha1);
void accepted ();
void ackReceived (LinphoneHeaders *headers);
bool failure ();
void accepted () override;
void ackReceived (LinphoneHeaders *headers) override;
bool failure () override;
void pausedByRemote ();
void remoteRinging ();
void remoteRinging () override;
void resumed ();
void terminated ();
void terminated () override;
void updated (bool isUpdate);
void updating (bool isUpdate);
void updating (bool isUpdate) override;
void enableSymmetricRtp (bool value);
void sendVfu ();
@ -91,11 +91,11 @@ private:
static float aggregateQualityRatings (float audioRating, float videoRating);
void setState (LinphoneCallState newState, const std::string &message);
void setState (LinphoneCallState newState, const std::string &message) override;
void computeStreamsIndexes (const SalMediaDescription *md);
void fixCallParams (SalMediaDescription *rmd);
void initializeParamsAccordingToIncomingCallParams ();
void initializeParamsAccordingToIncomingCallParams () override;
void setCompatibleIncomingCallParams (SalMediaDescription *md);
void updateBiggestDesc (SalMediaDescription *md);
void updateRemoteSessionIdAndVer ();
@ -211,18 +211,18 @@ private:
void reportBandwidth ();
void reportBandwidthForStream (MediaStream *ms, LinphoneStreamType type);
void abort (const std::string &errorMsg);
void handleIncomingReceivedStateInIncomingNotification ();
bool isReadyForInvite () const;
void abort (const std::string &errorMsg) override;
void handleIncomingReceivedStateInIncomingNotification () override;
bool isReadyForInvite () const override;
LinphoneStatus pause ();
void setTerminated ();
LinphoneStatus startAcceptUpdate (LinphoneCallState nextState, const std::string &stateInfo);
LinphoneStatus startUpdate ();
void terminate ();
void updateCurrentParams ();
void setTerminated () override;
LinphoneStatus startAcceptUpdate (LinphoneCallState nextState, const std::string &stateInfo) override;
LinphoneStatus startUpdate () override;
void terminate () override;
void updateCurrentParams () override;
void accept (const MediaSessionParams *params);
LinphoneStatus acceptUpdate (const CallSessionParams *csp, LinphoneCallState nextState, const std::string &stateInfo);
LinphoneStatus acceptUpdate (const CallSessionParams *csp, LinphoneCallState nextState, const std::string &stateInfo) override;
#ifdef VIDEO_ENABLED
void videoStreamEventCb (const MSFilter *f, const unsigned int eventId, const void *args);

View file

@ -40,15 +40,15 @@ public:
LinphoneStatus accept (const MediaSessionParams *msp = nullptr);
LinphoneStatus acceptEarlyMedia (const MediaSessionParams *msp = nullptr);
LinphoneStatus acceptUpdate (const MediaSessionParams *msp);
void configure (LinphoneCallDir direction, LinphoneProxyConfig *cfg, SalOp *op, const Address &from, const Address &to);
void initiateIncoming ();
bool initiateOutgoing ();
void iterate (time_t currentRealTime, bool oneSecondElapsed);
void configure (LinphoneCallDir direction, LinphoneProxyConfig *cfg, SalOp *op, const Address &from, const Address &to) override;
void initiateIncoming () override;
bool initiateOutgoing () override;
void iterate (time_t currentRealTime, bool oneSecondElapsed) override;
LinphoneStatus pause ();
LinphoneStatus resume ();
void sendVfuRequest ();
void startIncomingNotification ();
int startInvite (const Address *destination);
void startIncomingNotification () override;
int startInvite (const Address *destination) override;
void startRecording ();
void stopRecording ();
LinphoneStatus update (const MediaSessionParams *msp);
@ -76,7 +76,7 @@ public:
RtpTransport * getMetaRtpTransport (int streamIndex);
float getMicrophoneVolumeGain () const;
void * getNativeVideoWindowId () const;
const CallSessionParams *getParams () const;
const CallSessionParams *getParams () const override;
float getPlayVolume () const;
float getRecordVolume () const;
const MediaSessionParams *getRemoteParams ();