mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Started to remove old LinphoneContent and use a C wrapper above C++ Content
This commit is contained in:
parent
bb2274e56d
commit
933081e72f
11 changed files with 212 additions and 50 deletions
|
|
@ -64,7 +64,6 @@ set(LINPHONE_SOURCE_FILES_C
|
|||
carddav.c
|
||||
chat.c
|
||||
contactprovider.c
|
||||
content.c
|
||||
dial_plan.c
|
||||
dict.c
|
||||
ec-calibrator.c
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ liblinphone_la_SOURCES=\
|
|||
chat_file_transfer.c \
|
||||
conference.cc conference_private.h \
|
||||
contactprovider.c contact_providers_priv.h \
|
||||
content.c \
|
||||
dial_plan.c \
|
||||
dict.c \
|
||||
ec-calibrator.c \
|
||||
|
|
|
|||
|
|
@ -444,17 +444,6 @@ struct _EchoTester {
|
|||
unsigned int rate;
|
||||
};
|
||||
|
||||
struct _LinphoneContent {
|
||||
belle_sip_object_t base;
|
||||
void *user_data;
|
||||
SalBodyHandler *body_handler;
|
||||
char *name; /**< used by RCS File transfer messages to store the original filename of the file to be downloaded from server */
|
||||
char *key; /**< used by RCS File transfer messages to store the key to encrypt file if needed */
|
||||
size_t keyLength; /**< Length of key in bytes */
|
||||
void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */
|
||||
bool_t owned_fields;
|
||||
};
|
||||
|
||||
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneContent);
|
||||
|
||||
struct _LinphoneBuffer {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ set(ROOT_HEADER_FILES
|
|||
chat.h
|
||||
conference.h
|
||||
contactprovider.h
|
||||
content.h
|
||||
core_utils.h
|
||||
core.h
|
||||
defs.h
|
||||
|
|
@ -84,6 +83,7 @@ set(C_API_HEADER_FILES
|
|||
c-chat-message.h
|
||||
c-chat-room-cbs.h
|
||||
c-chat-room.h
|
||||
c-content.h
|
||||
c-dial-plan.h
|
||||
c-event-log.h
|
||||
c-participant.h
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ linphone_include_HEADERS=\
|
|||
chat.h \
|
||||
conference.h \
|
||||
contactprovider.h \
|
||||
content.h \
|
||||
core.h \
|
||||
core_utils.h \
|
||||
defs.h \
|
||||
|
|
|
|||
|
|
@ -1,33 +1,32 @@
|
|||
/*
|
||||
content.h
|
||||
Copyright (C) 2010-2014 Belledonne Communications SARL
|
||||
* c-content.h
|
||||
* Copyright (C) 2010-2018 Belledonne Communications SARL
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
#ifndef _L_C_CONTENT_H_
|
||||
#define _L_C_CONTENT_H_
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef LINPHONE_CONTENT_H_
|
||||
#define LINPHONE_CONTENT_H_
|
||||
|
||||
|
||||
#include "linphone/types.h"
|
||||
#include "linphone/api/c-types.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
/**
|
||||
* @addtogroup misc
|
||||
|
|
@ -218,9 +217,8 @@ LINPHONE_PUBLIC void linphone_content_set_key(LinphoneContent *content, const ch
|
|||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
#endif /* LINPHONE_CONTENT_H_ */
|
||||
#endif // ifndef _L_C_CONTENT_H_
|
||||
|
|
@ -156,6 +156,12 @@ typedef struct _LinphoneDialPlan LinphoneDialPlan;
|
|||
**/
|
||||
typedef struct _LinphoneParticipant LinphoneParticipant;
|
||||
|
||||
/**
|
||||
* The LinphoneContent object holds data that can be embedded in a signaling message.
|
||||
* @ingroup misc
|
||||
**/
|
||||
typedef struct _LinphoneContent LinphoneContent;
|
||||
|
||||
// =============================================================================
|
||||
// C Enums.
|
||||
// =============================================================================
|
||||
|
|
|
|||
|
|
@ -367,12 +367,6 @@ typedef unsigned int LinphoneContactSearchID;
|
|||
*/
|
||||
LINPHONE_DEPRECATED typedef LinphoneContactSearchID ContactSearchID;
|
||||
|
||||
/**
|
||||
* The LinphoneContent object holds data that can be embedded in a signaling message.
|
||||
* @ingroup misc
|
||||
**/
|
||||
typedef struct _LinphoneContent LinphoneContent;
|
||||
|
||||
/**
|
||||
* Linphone core main object created by function linphone_core_new() .
|
||||
* @ingroup initializing
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
|
|||
c-wrapper/api/c-chat-room-cbs.cpp
|
||||
c-wrapper/api/c-chat-room.cpp
|
||||
c-wrapper/api/c-core.cpp
|
||||
c-wrapper/api/c-content.cpp
|
||||
c-wrapper/api/c-dial-plan.cpp
|
||||
c-wrapper/api/c-event-log.cpp
|
||||
c-wrapper/api/c-participant.cpp
|
||||
|
|
|
|||
177
src/c-wrapper/api/c-content.cpp
Normal file
177
src/c-wrapper/api/c-content.cpp
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* c-content.cpp
|
||||
* Copyright (C) 2010-2018 Belledonne Communications SARL
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone/api/c-content.h"
|
||||
#include "linphone/wrapper_utils.h"
|
||||
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
|
||||
#include "content/content.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
using namespace std;
|
||||
|
||||
L_DECLARE_C_CLONABLE_OBJECT_IMPL(Content,
|
||||
SalBodyHandler *body_handler;
|
||||
void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */
|
||||
)
|
||||
|
||||
// =============================================================================
|
||||
// Reference and user data handling functions.
|
||||
// =============================================================================
|
||||
|
||||
LinphoneContent * linphone_content_ref(LinphoneContent *content) {
|
||||
belle_sip_object_ref(content);
|
||||
return content;
|
||||
}
|
||||
|
||||
void linphone_content_unref(LinphoneContent *content) {
|
||||
belle_sip_object_unref(content);
|
||||
}
|
||||
|
||||
void *linphone_content_get_user_data(const LinphoneContent *content) {
|
||||
return L_GET_USER_DATA_FROM_C_OBJECT(content);
|
||||
}
|
||||
|
||||
void linphone_content_set_user_data(LinphoneContent *content, void *ud) {
|
||||
return L_SET_USER_DATA_FROM_C_OBJECT(content, ud);
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
const char * linphone_content_get_type(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_content_set_type(LinphoneContent *content, const char *type) {
|
||||
|
||||
}
|
||||
|
||||
const char * linphone_content_get_subtype(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) {
|
||||
|
||||
}
|
||||
|
||||
uint8_t * linphone_content_get_buffer(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) {
|
||||
|
||||
}
|
||||
|
||||
const char * linphone_content_get_string_buffer(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) {
|
||||
|
||||
}
|
||||
|
||||
size_t linphone_content_get_size(const LinphoneContent *content) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void linphone_content_set_size(LinphoneContent *content, size_t size) {
|
||||
|
||||
}
|
||||
|
||||
const char * linphone_content_get_encoding(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) {
|
||||
|
||||
}
|
||||
|
||||
const char * linphone_content_get_name(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_content_set_name(LinphoneContent *content, const char *name) {
|
||||
|
||||
}
|
||||
|
||||
bool_t linphone_content_is_multipart(const LinphoneContent *content) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *linphone_content_get_key(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t linphone_content_get_key_size(const LinphoneContent *content) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) {
|
||||
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Private functions.
|
||||
// =============================================================================
|
||||
|
||||
LinphoneContent * linphone_content_new(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_copy(const LinphoneContent *ref) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_core_create_content(LinphoneCore *lc) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* crypto context is managed(allocated/freed) by the encryption function, so provide the address of field in the private structure */
|
||||
void ** linphone_content_get_cryptoContext_address(LinphoneContent *content) {
|
||||
return &(content->cryptoContext);;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_handler) {
|
||||
if (body_handler) {
|
||||
return linphone_content_new_with_body_handler(body_handler);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@
|
|||
F(ChatMessage, ChatMessage) \
|
||||
F(AbstractChatRoom, ChatRoom) \
|
||||
F(Core, Core) \
|
||||
F(Content, Content) \
|
||||
F(DialPlan, DialPlan) \
|
||||
F(EventLog, EventLog) \
|
||||
F(MediaSessionParams, CallParams) \
|
||||
|
|
@ -83,7 +84,6 @@ BELLE_SIP_TYPE_ID(LinphoneConferenceParams),
|
|||
BELLE_SIP_TYPE_ID(LinphoneConfig),
|
||||
BELLE_SIP_TYPE_ID(LinphoneContactProvider),
|
||||
BELLE_SIP_TYPE_ID(LinphoneContactSearch),
|
||||
BELLE_SIP_TYPE_ID(LinphoneContent),
|
||||
BELLE_SIP_TYPE_ID(LinphoneCoreCbs),
|
||||
BELLE_SIP_TYPE_ID(LinphoneErrorInfo),
|
||||
BELLE_SIP_TYPE_ID(LinphoneEvent),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue