feat(c-wrapper/api): remove useless define GET_xxx

This commit is contained in:
Ronan Abhamon 2017-09-22 14:47:15 +02:00
parent 4997962624
commit a1db41d274
4 changed files with 192 additions and 204 deletions

View file

@ -22,9 +22,6 @@
// =============================================================================
#define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_MEDIA_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj)
L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallParams)
using namespace std;
@ -34,7 +31,7 @@ using namespace std;
// =============================================================================
SalMediaProto get_proto_from_call_params (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getMediaProto();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getMediaProto();
}
SalStreamDir sal_dir_from_call_params_dir (LinphoneMediaDirection cpdir) {
@ -77,15 +74,15 @@ SalStreamDir get_video_dir_from_call_params (const LinphoneCallParams *params) {
}
void linphone_call_params_set_custom_headers (LinphoneCallParams *params, const SalCustomHeader *ch) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setCustomHeaders(ch);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setCustomHeaders(ch);
}
void linphone_call_params_set_custom_sdp_attributes (LinphoneCallParams *params, const SalCustomSdpAttribute *csa) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setCustomSdpAttributes(csa);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setCustomSdpAttributes(csa);
}
void linphone_call_params_set_custom_sdp_media_attributes (LinphoneCallParams *params, LinphoneStreamType type, const SalCustomSdpAttribute *csa) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setCustomSdpMediaAttributes(type, csa);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setCustomSdpMediaAttributes(type, csa);
}
// =============================================================================
@ -93,23 +90,23 @@ void linphone_call_params_set_custom_sdp_media_attributes (LinphoneCallParams *p
// =============================================================================
void linphone_call_params_add_custom_header (LinphoneCallParams *params, const char *header_name, const char *header_value) {
GET_MEDIA_CPP_PTR(params)->addCustomHeader(header_name, header_value);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->addCustomHeader(header_name, header_value);
}
void linphone_call_params_add_custom_sdp_attribute (LinphoneCallParams *params, const char *attribute_name, const char *attribute_value) {
GET_MEDIA_CPP_PTR(params)->addCustomSdpAttribute(attribute_name, attribute_value);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->addCustomSdpAttribute(attribute_name, attribute_value);
}
void linphone_call_params_add_custom_sdp_media_attribute (LinphoneCallParams *params, LinphoneStreamType type, const char *attribute_name, const char *attribute_value) {
GET_MEDIA_CPP_PTR(params)->addCustomSdpMediaAttribute(type, attribute_name, attribute_value);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->addCustomSdpMediaAttribute(type, attribute_name, attribute_value);
}
void linphone_call_params_clear_custom_sdp_attributes (LinphoneCallParams *params) {
GET_MEDIA_CPP_PTR(params)->clearCustomSdpAttributes();
L_GET_CPP_PTR_FROM_C_OBJECT(params)->clearCustomSdpAttributes();
}
void linphone_call_params_clear_custom_sdp_media_attributes (LinphoneCallParams *params, LinphoneStreamType type) {
GET_MEDIA_CPP_PTR(params)->clearCustomSdpMediaAttributes(type);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->clearCustomSdpMediaAttributes(type);
}
LinphoneCallParams *linphone_call_params_copy (const LinphoneCallParams *params) {
@ -117,42 +114,42 @@ LinphoneCallParams *linphone_call_params_copy (const LinphoneCallParams *params)
}
bool_t linphone_call_params_early_media_sending_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->earlyMediaSendingEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->earlyMediaSendingEnabled();
}
void linphone_call_params_enable_early_media_sending (LinphoneCallParams *params, bool_t enabled) {
GET_MEDIA_CPP_PTR(params)->enableEarlyMediaSending(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableEarlyMediaSending(enabled);
}
void linphone_call_params_enable_low_bandwidth (LinphoneCallParams *params, bool_t enabled) {
GET_MEDIA_CPP_PTR(params)->enableLowBandwidth(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableLowBandwidth(enabled);
}
void linphone_call_params_enable_audio (LinphoneCallParams *params, bool_t enabled) {
GET_MEDIA_CPP_PTR(params)->enableAudio(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAudio(enabled);
}
LinphoneStatus linphone_call_params_enable_realtime_text (LinphoneCallParams *params, bool_t yesno) {
GET_MEDIA_CPP_PTR(params)->enableRealtimeText(yesno);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableRealtimeText(yesno);
return 0;
}
void linphone_call_params_enable_video (LinphoneCallParams *params, bool_t enabled) {
GET_MEDIA_CPP_PTR(params)->enableVideo(enabled);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableVideo(enabled);
}
const char *linphone_call_params_get_custom_header (const LinphoneCallParams *params, const char *header_name) {
string value = GET_MEDIA_CPP_PTR(params)->getCustomHeader(header_name);
string value = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getCustomHeader(header_name);
return value.empty() ? nullptr : value.c_str();
}
const char *linphone_call_params_get_custom_sdp_attribute (const LinphoneCallParams *params, const char *attribute_name) {
string value = GET_MEDIA_CPP_PTR(params)->getCustomSdpAttribute(attribute_name);
string value = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getCustomSdpAttribute(attribute_name);
return value.empty() ? nullptr : value.c_str();
}
const char *linphone_call_params_get_custom_sdp_media_attribute (const LinphoneCallParams *params, LinphoneStreamType type, const char *attribute_name) {
string value = GET_MEDIA_CPP_PTR(params)->getCustomSdpMediaAttribute(type, attribute_name);
string value = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getCustomSdpMediaAttribute(type, attribute_name);
return value.empty() ? nullptr : value.c_str();
}
@ -161,20 +158,20 @@ bool_t linphone_call_params_get_local_conference_mode (const LinphoneCallParams
}
LinphoneMediaEncryption linphone_call_params_get_media_encryption (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getMediaEncryption();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getMediaEncryption();
}
LinphonePrivacyMask linphone_call_params_get_privacy (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getPrivacy();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getPrivacy();
}
float linphone_call_params_get_received_framerate (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getReceivedFps();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getReceivedFps();
}
MSVideoSize linphone_call_params_get_received_video_size (const LinphoneCallParams *params) {
MSVideoSize vsize;
LinphoneVideoDefinition *vdef = GET_MEDIA_CPP_PTR(params)->getReceivedVideoDefinition();
LinphoneVideoDefinition *vdef = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getReceivedVideoDefinition();
if (vdef) {
vsize.width = static_cast<int>(linphone_video_definition_get_width(vdef));
vsize.height = static_cast<int>(linphone_video_definition_get_height(vdef));
@ -186,25 +183,25 @@ MSVideoSize linphone_call_params_get_received_video_size (const LinphoneCallPara
}
const LinphoneVideoDefinition *linphone_call_params_get_received_video_definition (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getReceivedVideoDefinition();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getReceivedVideoDefinition();
}
const char *linphone_call_params_get_record_file (const LinphoneCallParams *params) {
const string &value = GET_MEDIA_CPP_PTR(params)->getRecordFilePath();
const string &value = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getRecordFilePath();
return value.empty() ? nullptr : value.c_str();
}
const char *linphone_call_params_get_rtp_profile (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getRtpProfile();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getRtpProfile();
}
float linphone_call_params_get_sent_framerate (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getSentFps();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getSentFps();
}
MSVideoSize linphone_call_params_get_sent_video_size (const LinphoneCallParams *params) {
MSVideoSize vsize;
LinphoneVideoDefinition *vdef = GET_MEDIA_CPP_PTR(params)->getSentVideoDefinition();
LinphoneVideoDefinition *vdef = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getSentVideoDefinition();
if (vdef) {
vsize.width = static_cast<int>(linphone_video_definition_get_width(vdef));
vsize.height = static_cast<int>(linphone_video_definition_get_height(vdef));
@ -216,156 +213,156 @@ MSVideoSize linphone_call_params_get_sent_video_size (const LinphoneCallParams *
}
const LinphoneVideoDefinition *linphone_call_params_get_sent_video_definition (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getSentVideoDefinition();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getSentVideoDefinition();
}
const char *linphone_call_params_get_session_name (const LinphoneCallParams *params) {
const string &value = GET_MEDIA_CPP_PTR(params)->getSessionName();
const string &value = L_GET_CPP_PTR_FROM_C_OBJECT(params)->getSessionName();
return value.empty() ? nullptr : value.c_str();
}
LinphonePayloadType *linphone_call_params_get_used_audio_payload_type (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getUsedAudioPayloadType();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getUsedAudioPayloadType();
}
LinphonePayloadType *linphone_call_params_get_used_video_payload_type (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getUsedVideoPayloadType();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getUsedVideoPayloadType();
}
LinphonePayloadType *linphone_call_params_get_used_text_payload_type (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getUsedRealtimeTextPayloadType();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getUsedRealtimeTextPayloadType();
}
const OrtpPayloadType *linphone_call_params_get_used_audio_codec (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getUsedAudioCodec();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getUsedAudioCodec();
}
void linphone_call_params_set_used_audio_codec (LinphoneCallParams *params, OrtpPayloadType *codec) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setUsedAudioCodec(codec);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUsedAudioCodec(codec);
}
const OrtpPayloadType *linphone_call_params_get_used_video_codec (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getUsedVideoCodec();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getUsedVideoCodec();
}
void linphone_call_params_set_used_video_codec (LinphoneCallParams *params, OrtpPayloadType *codec) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setUsedVideoCodec(codec);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUsedVideoCodec(codec);
}
const OrtpPayloadType *linphone_call_params_get_used_text_codec (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getUsedRealtimeTextCodec();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getUsedRealtimeTextCodec();
}
void linphone_call_params_set_used_text_codec (LinphoneCallParams *params, OrtpPayloadType *codec) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setUsedRealtimeTextCodec(codec);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUsedRealtimeTextCodec(codec);
}
bool_t linphone_call_params_low_bandwidth_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->lowBandwidthEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->lowBandwidthEnabled();
}
int linphone_call_params_get_audio_bandwidth_limit (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getAudioBandwidthLimit();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getAudioBandwidthLimit();
}
void linphone_call_params_set_audio_bandwidth_limit (LinphoneCallParams *params, int bandwidth) {
GET_MEDIA_CPP_PTR(params)->setAudioBandwidthLimit(bandwidth);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setAudioBandwidthLimit(bandwidth);
}
void linphone_call_params_set_media_encryption (LinphoneCallParams *params, LinphoneMediaEncryption encryption) {
GET_MEDIA_CPP_PTR(params)->setMediaEncryption(encryption);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setMediaEncryption(encryption);
}
void linphone_call_params_set_privacy (LinphoneCallParams *params, LinphonePrivacyMask privacy) {
GET_MEDIA_CPP_PTR(params)->setPrivacy(privacy);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setPrivacy(privacy);
}
void linphone_call_params_set_record_file (LinphoneCallParams *params, const char *path) {
GET_MEDIA_CPP_PTR(params)->setRecordFilePath(path ? path : "");
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setRecordFilePath(path ? path : "");
}
void linphone_call_params_set_session_name (LinphoneCallParams *params, const char *name) {
GET_MEDIA_CPP_PTR(params)->setSessionName(name ? name : "");
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setSessionName(name ? name : "");
}
bool_t linphone_call_params_audio_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->audioEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->audioEnabled();
}
bool_t linphone_call_params_realtime_text_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->realtimeTextEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->realtimeTextEnabled();
}
bool_t linphone_call_params_video_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->videoEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->videoEnabled();
}
LinphoneMediaDirection linphone_call_params_get_audio_direction (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getAudioDirection();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getAudioDirection();
}
LinphoneMediaDirection linphone_call_params_get_video_direction (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getVideoDirection();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getVideoDirection();
}
void linphone_call_params_set_audio_direction (LinphoneCallParams *params, LinphoneMediaDirection dir) {
GET_MEDIA_CPP_PTR(params)->setAudioDirection(dir);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setAudioDirection(dir);
}
void linphone_call_params_set_video_direction (LinphoneCallParams *params, LinphoneMediaDirection dir) {
GET_MEDIA_CPP_PTR(params)->setVideoDirection(dir);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setVideoDirection(dir);
}
void linphone_call_params_enable_audio_multicast (LinphoneCallParams *params, bool_t yesno) {
GET_MEDIA_CPP_PTR(params)->enableAudioMulticast(yesno);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAudioMulticast(yesno);
}
bool_t linphone_call_params_audio_multicast_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->audioMulticastEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->audioMulticastEnabled();
}
void linphone_call_params_enable_video_multicast (LinphoneCallParams *params, bool_t yesno) {
GET_MEDIA_CPP_PTR(params)->enableVideoMulticast(yesno);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableVideoMulticast(yesno);
}
bool_t linphone_call_params_video_multicast_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->videoMulticastEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->videoMulticastEnabled();
}
bool_t linphone_call_params_real_early_media_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->earlyMediaSendingEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->earlyMediaSendingEnabled();
}
bool_t linphone_call_params_avpf_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->avpfEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->avpfEnabled();
}
void linphone_call_params_enable_avpf (LinphoneCallParams *params, bool_t enable) {
GET_MEDIA_CPP_PTR(params)->enableAvpf(enable);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableAvpf(enable);
}
bool_t linphone_call_params_mandatory_media_encryption_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->mandatoryMediaEncryptionEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->mandatoryMediaEncryptionEnabled();
}
void linphone_call_params_enable_mandatory_media_encryption (LinphoneCallParams *params, bool_t value) {
GET_MEDIA_CPP_PTR(params)->enableMandatoryMediaEncryption(value);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->enableMandatoryMediaEncryption(value);
}
uint16_t linphone_call_params_get_avpf_rr_interval (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PTR(params)->getAvpfRrInterval();
return L_GET_CPP_PTR_FROM_C_OBJECT(params)->getAvpfRrInterval();
}
void linphone_call_params_set_avpf_rr_interval (LinphoneCallParams *params, uint16_t value) {
GET_MEDIA_CPP_PTR(params)->setAvpfRrInterval(value);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->setAvpfRrInterval(value);
}
void linphone_call_params_set_sent_fps (LinphoneCallParams *params, float value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setSentFps(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setSentFps(value);
}
void linphone_call_params_set_received_fps (LinphoneCallParams *params, float value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReceivedFps(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setReceivedFps(value);
}
// =============================================================================
@ -373,111 +370,111 @@ void linphone_call_params_set_received_fps (LinphoneCallParams *params, float va
// =============================================================================
bool_t linphone_call_params_get_in_conference (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getInConference();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getInConference();
}
void linphone_call_params_set_in_conference (LinphoneCallParams *params, bool_t value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setInConference(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setInConference(value);
}
bool_t linphone_call_params_get_internal_call_update (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getInternalCallUpdate();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getInternalCallUpdate();
}
void linphone_call_params_set_internal_call_update (LinphoneCallParams *params, bool_t value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setInternalCallUpdate(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setInternalCallUpdate(value);
}
bool_t linphone_call_params_implicit_rtcp_fb_enabled (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->implicitRtcpFbEnabled();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->implicitRtcpFbEnabled();
}
void linphone_call_params_enable_implicit_rtcp_fb (LinphoneCallParams *params, bool_t value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->enableImplicitRtcpFb(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->enableImplicitRtcpFb(value);
}
int linphone_call_params_get_down_bandwidth (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getDownBandwidth();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getDownBandwidth();
}
void linphone_call_params_set_down_bandwidth (LinphoneCallParams *params, int value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setDownBandwidth(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setDownBandwidth(value);
}
int linphone_call_params_get_up_bandwidth (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getUpBandwidth();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getUpBandwidth();
}
void linphone_call_params_set_up_bandwidth (LinphoneCallParams *params, int value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setUpBandwidth(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUpBandwidth(value);
}
int linphone_call_params_get_down_ptime (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getDownPtime();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getDownPtime();
}
void linphone_call_params_set_down_ptime (LinphoneCallParams *params, int value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setDownPtime(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setDownPtime(value);
}
int linphone_call_params_get_up_ptime (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getUpPtime();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getUpPtime();
}
void linphone_call_params_set_up_ptime (LinphoneCallParams *params, int value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setUpPtime(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUpPtime(value);
}
SalCustomHeader *linphone_call_params_get_custom_headers (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getCustomHeaders();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getCustomHeaders();
}
SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_attributes (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getCustomSdpAttributes();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getCustomSdpAttributes();
}
SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_media_attributes (const LinphoneCallParams *params, LinphoneStreamType type) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getCustomSdpMediaAttributes(type);
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getCustomSdpMediaAttributes(type);
}
LinphoneCall *linphone_call_params_get_referer (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getReferer();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getReferer();
}
void linphone_call_params_set_referer (LinphoneCallParams *params, LinphoneCall *referer) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReferer(referer);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setReferer(referer);
}
bool_t linphone_call_params_get_update_call_when_ice_completed (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getUpdateCallWhenIceCompleted();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getUpdateCallWhenIceCompleted();
}
void linphone_call_params_set_update_call_when_ice_completed (LinphoneCallParams *params, bool_t value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setUpdateCallWhenIceCompleted(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setUpdateCallWhenIceCompleted(value);
}
void linphone_call_params_set_sent_vsize (LinphoneCallParams *params, MSVideoSize vsize) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setSentVideoDefinition(linphone_video_definition_new(static_cast<unsigned int>(vsize.width), static_cast<unsigned int>(vsize.height), nullptr));
L_GET_PRIVATE_FROM_C_OBJECT(params)->setSentVideoDefinition(linphone_video_definition_new(static_cast<unsigned int>(vsize.width), static_cast<unsigned int>(vsize.height), nullptr));
}
void linphone_call_params_set_recv_vsize (LinphoneCallParams *params, MSVideoSize vsize) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReceivedVideoDefinition(linphone_video_definition_new(static_cast<unsigned int>(vsize.width), static_cast<unsigned int>(vsize.height), nullptr));
L_GET_PRIVATE_FROM_C_OBJECT(params)->setReceivedVideoDefinition(linphone_video_definition_new(static_cast<unsigned int>(vsize.width), static_cast<unsigned int>(vsize.height), nullptr));
}
void linphone_call_params_set_sent_video_definition (LinphoneCallParams *params, LinphoneVideoDefinition *vdef) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setSentVideoDefinition(vdef);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setSentVideoDefinition(vdef);
}
void linphone_call_params_set_received_video_definition (LinphoneCallParams *params, LinphoneVideoDefinition *vdef) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setReceivedVideoDefinition(vdef);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setReceivedVideoDefinition(vdef);
}
bool_t linphone_call_params_get_no_user_consent (const LinphoneCallParams *params) {
return GET_MEDIA_CPP_PRIVATE_PTR(params)->getNoUserConsent();
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getNoUserConsent();
}
void linphone_call_params_set_no_user_consent (LinphoneCallParams *params, bool_t value) {
GET_MEDIA_CPP_PRIVATE_PTR(params)->setNoUserConsent(value);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setNoUserConsent(value);
}
// =============================================================================
@ -508,7 +505,7 @@ void linphone_call_params_unref (LinphoneCallParams *cp) {
LinphoneCallParams *linphone_call_params_new (LinphoneCore *core) {
LinphoneCallParams *params = _linphone_CallParams_init();
L_SET_CPP_PTR_FROM_C_OBJECT(params, new LinphonePrivate::MediaSessionParams());
GET_MEDIA_CPP_PTR(params)->initDefault(core);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->initDefault(core);
return params;
}

View file

@ -28,9 +28,6 @@
// =============================================================================
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj)
using namespace std;
static void _linphone_call_constructor (LinphoneCall *call);
@ -389,7 +386,7 @@ static void linphone_call_repair_by_invite_with_replaces (LinphoneCall *call) {
#endif
MediaStream *linphone_call_get_stream (LinphoneCall *call, LinphoneStreamType type) {
return GET_CPP_PRIVATE_PTR(call)->getMediaStream(type);
return L_GET_PRIVATE_FROM_C_OBJECT(call)->getMediaStream(type);
}
void linphone_call_set_broken (LinphoneCall *call) {
@ -511,11 +508,11 @@ void linphone_call_refresh_sockets (LinphoneCall *call) {
}
SalOp * linphone_call_get_op (const LinphoneCall *call) {
return GET_CPP_PRIVATE_PTR(call)->getOp();
return L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp();
}
LinphoneProxyConfig * linphone_call_get_dest_proxy (const LinphoneCall *call) {
return GET_CPP_PRIVATE_PTR(call)->getDestProxy();
return L_GET_PRIVATE_FROM_C_OBJECT(call)->getDestProxy();
}
LinphoneCallLog * linphone_call_get_log (const LinphoneCall *call) {
@ -523,19 +520,19 @@ LinphoneCallLog * linphone_call_get_log (const LinphoneCall *call) {
}
IceSession * linphone_call_get_ice_session (const LinphoneCall *call) {
return GET_CPP_PRIVATE_PTR(call)->getIceSession();
return L_GET_PRIVATE_FROM_C_OBJECT(call)->getIceSession();
}
bool_t linphone_call_get_audio_muted (const LinphoneCall *call) {
return GET_CPP_PRIVATE_PTR(call)->getAudioMuted();
return L_GET_PRIVATE_FROM_C_OBJECT(call)->getAudioMuted();
}
void linphone_call_set_audio_muted (LinphoneCall *call, bool_t value) {
GET_CPP_PRIVATE_PTR(call)->setAudioMuted(value);
L_GET_PRIVATE_FROM_C_OBJECT(call)->setAudioMuted(value);
}
bool_t linphone_call_get_all_muted (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getAllMuted();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAllMuted();
}
#define NOTIFY_IF_EXIST(cbName, functionName, ...) \
@ -586,11 +583,11 @@ void linphone_call_notify_ack_processing (LinphoneCall *call, LinphoneHeaders *m
// =============================================================================
LinphoneCore *linphone_call_get_core (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getCore();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getCore();
}
LinphoneCallState linphone_call_get_state (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getState();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getState();
}
bool_t linphone_call_asked_to_autoanswer (LinphoneCall *call) {
@ -601,7 +598,7 @@ bool_t linphone_call_asked_to_autoanswer (LinphoneCall *call) {
}
const LinphoneAddress *linphone_call_get_remote_address (const LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_OBJECT(call->remoteAddressCache, &GET_CPP_PTR(call)->getRemoteAddress());
L_SET_CPP_PTR_FROM_C_OBJECT(call->remoteAddressCache, &L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteAddress());
return call->remoteAddressCache;
}
@ -622,7 +619,7 @@ const char *linphone_call_get_to_header (const LinphoneCall *call, const char *n
}
char *linphone_call_get_remote_address_as_string (const LinphoneCall *call) {
return ms_strdup(GET_CPP_PTR(call)->getRemoteAddressAsString().c_str());
return ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteAddressAsString().c_str());
}
const LinphoneAddress *linphone_call_get_diversion_address (const LinphoneCall *call) {
@ -638,7 +635,7 @@ LinphoneCallDir linphone_call_get_dir (const LinphoneCall *call) {
}
LinphoneCallLog *linphone_call_get_call_log (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getLog();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getLog();
}
const char *linphone_call_get_refer_to (const LinphoneCall *call) {
@ -686,16 +683,16 @@ LinphoneCall *linphone_call_get_replaced_call (LinphoneCall *call) {
}
int linphone_call_get_duration (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getDuration();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getDuration();
}
const LinphoneCallParams *linphone_call_get_current_params(LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_OBJECT(call->currentParamsCache, GET_CPP_PTR(call)->getCurrentParams());
L_SET_CPP_PTR_FROM_C_OBJECT(call->currentParamsCache, L_GET_CPP_PTR_FROM_C_OBJECT(call)->getCurrentParams());
return call->currentParamsCache;
}
const LinphoneCallParams *linphone_call_get_remote_params(LinphoneCall *call) {
const LinphonePrivate::MediaSessionParams *remoteParams = GET_CPP_PTR(call)->getRemoteParams();
const LinphonePrivate::MediaSessionParams *remoteParams = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteParams();
if (!remoteParams)
return nullptr;
L_SET_CPP_PTR_FROM_C_OBJECT(call->remoteParamsCache, remoteParams);
@ -703,27 +700,27 @@ const LinphoneCallParams *linphone_call_get_remote_params(LinphoneCall *call) {
}
void linphone_call_enable_camera (LinphoneCall *call, bool_t enable) {
GET_CPP_PTR(call)->enableCamera(enable);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableCamera(enable);
}
bool_t linphone_call_camera_enabled (const LinphoneCall *call) {
return GET_CPP_PTR(call)->cameraEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->cameraEnabled();
}
LinphoneStatus linphone_call_take_video_snapshot (LinphoneCall *call, const char *file) {
return GET_CPP_PTR(call)->takeVideoSnapshot(file ? file : "");
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->takeVideoSnapshot(file ? file : "");
}
LinphoneStatus linphone_call_take_preview_snapshot (LinphoneCall *call, const char *file) {
return GET_CPP_PTR(call)->takePreviewSnapshot(file ? file : "");
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->takePreviewSnapshot(file ? file : "");
}
LinphoneReason linphone_call_get_reason (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getReason();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getReason();
}
const LinphoneErrorInfo *linphone_call_get_error_info (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getErrorInfo();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getErrorInfo();
}
const char *linphone_call_get_remote_user_agent (LinphoneCall *call) {
@ -738,7 +735,7 @@ const char *linphone_call_get_remote_user_agent (LinphoneCall *call) {
}
const char * linphone_call_get_remote_contact (LinphoneCall *call) {
std::string contact = GET_CPP_PTR(call)->getRemoteContact();
std::string contact = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteContact();
if (contact.empty())
return nullptr;
if (call->remoteContactCache)
@ -748,24 +745,24 @@ const char * linphone_call_get_remote_contact (LinphoneCall *call) {
}
const char *linphone_call_get_authentication_token (LinphoneCall *call) {
std::string token = GET_CPP_PTR(call)->getAuthenticationToken();
std::string token = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAuthenticationToken();
return token.empty() ? nullptr : token.c_str();
}
bool_t linphone_call_get_authentication_token_verified (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getAuthenticationTokenVerified();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAuthenticationTokenVerified();
}
void linphone_call_set_authentication_token_verified (LinphoneCall *call, bool_t verified) {
GET_CPP_PTR(call)->setAuthenticationTokenVerified(verified);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setAuthenticationTokenVerified(verified);
}
void linphone_call_send_vfu_request (LinphoneCall *call) {
GET_CPP_PTR(call)->sendVfuRequest();
L_GET_CPP_PTR_FROM_C_OBJECT(call)->sendVfuRequest();
}
void linphone_call_set_next_video_frame_decoded_callback (LinphoneCall *call, LinphoneCallCbFunc cb, void *ud) {
GET_CPP_PTR(call)->setNextVideoFrameDecodedCallback(cb, ud);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setNextVideoFrameDecodedCallback(cb, ud);
}
LinphoneCallState linphone_call_get_transfer_state (LinphoneCall *call) {
@ -777,7 +774,7 @@ LinphoneCallState linphone_call_get_transfer_state (LinphoneCall *call) {
}
void linphone_call_zoom_video (LinphoneCall* call, float zoom_factor, float* cx, float* cy) {
GET_CPP_PTR(call)->zoomVideo(zoom_factor, cx, cy);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->zoomVideo(zoom_factor, cx, cy);
}
LinphoneStatus linphone_call_send_dtmf (LinphoneCall *call, char dtmf) {
@ -856,35 +853,35 @@ void linphone_call_set_audio_route (LinphoneCall *call, LinphoneAudioRoute route
}
int linphone_call_get_stream_count (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getStreamCount();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getStreamCount();
}
MSFormatType linphone_call_get_stream_type (const LinphoneCall *call, int stream_index) {
return GET_CPP_PTR(call)->getStreamType(stream_index);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getStreamType(stream_index);
}
RtpTransport *linphone_call_get_meta_rtp_transport (const LinphoneCall *call, int stream_index) {
return GET_CPP_PTR(call)->getMetaRtpTransport(stream_index);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getMetaRtpTransport(stream_index);
}
RtpTransport *linphone_call_get_meta_rtcp_transport (const LinphoneCall *call, int stream_index) {
return GET_CPP_PTR(call)->getMetaRtcpTransport(stream_index);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getMetaRtcpTransport(stream_index);
}
LinphoneStatus linphone_call_pause (LinphoneCall *call) {
return GET_CPP_PTR(call)->pause();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->pause();
}
LinphoneStatus linphone_call_resume (LinphoneCall *call) {
return GET_CPP_PTR(call)->resume();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->resume();
}
LinphoneStatus linphone_call_terminate (LinphoneCall *call) {
return GET_CPP_PTR(call)->terminate();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->terminate();
}
LinphoneStatus linphone_call_terminate_with_error_info (LinphoneCall *call , const LinphoneErrorInfo *ei) {
return GET_CPP_PTR(call)->terminate(ei);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->terminate(ei);
}
LinphoneStatus linphone_call_redirect (LinphoneCall *call, const char *redirect_uri) {
@ -924,31 +921,31 @@ LinphoneStatus linphone_call_redirect (LinphoneCall *call, const char *redirect_
}
LinphoneStatus linphone_call_decline (LinphoneCall *call, LinphoneReason reason) {
return GET_CPP_PTR(call)->decline(reason);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->decline(reason);
}
LinphoneStatus linphone_call_decline_with_error_info (LinphoneCall *call, const LinphoneErrorInfo *ei) {
return GET_CPP_PTR(call)->decline(ei);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->decline(ei);
}
LinphoneStatus linphone_call_accept (LinphoneCall *call) {
return GET_CPP_PTR(call)->accept(nullptr);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->accept(nullptr);
}
LinphoneStatus linphone_call_accept_with_params (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->accept(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->accept(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
}
LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) {
return GET_CPP_PTR(call)->acceptEarlyMedia();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->acceptEarlyMedia();
}
LinphoneStatus linphone_call_accept_early_media_with_params (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->acceptEarlyMedia(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->acceptEarlyMedia(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
}
LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->update(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->update(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
}
LinphoneStatus linphone_call_defer_update (LinphoneCall *call) {
@ -971,7 +968,7 @@ LinphoneStatus linphone_call_defer_update (LinphoneCall *call) {
}
LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
}
LinphoneStatus linphone_call_transfer (LinphoneCall *call, const char *refer_to) {
@ -1007,27 +1004,27 @@ LinphoneStatus linphone_call_transfer_to_another (LinphoneCall *call, LinphoneCa
}
void *linphone_call_get_native_video_window_id (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getNativeVideoWindowId();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getNativeVideoWindowId();
}
void linphone_call_set_native_video_window_id (LinphoneCall *call, void *id) {
GET_CPP_PTR(call)->setNativeVideoWindowId(id);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setNativeVideoWindowId(id);
}
void linphone_call_enable_echo_cancellation (LinphoneCall *call, bool_t enable) {
GET_CPP_PTR(call)->enableEchoCancellation(enable);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableEchoCancellation(enable);
}
bool_t linphone_call_echo_cancellation_enabled (const LinphoneCall *call) {
return GET_CPP_PTR(call)->echoCancellationEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->echoCancellationEnabled();
}
void linphone_call_enable_echo_limiter (LinphoneCall *call, bool_t val) {
GET_CPP_PTR(call)->enableEchoLimiter(val);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->enableEchoLimiter(val);
}
bool_t linphone_call_echo_limiter_enabled (const LinphoneCall *call) {
return GET_CPP_PTR(call)->echoLimiterEnabled();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->echoLimiterEnabled();
}
LinphoneChatRoom *linphone_call_get_chat_room (LinphoneCall *call) {
@ -1044,43 +1041,43 @@ LinphoneChatRoom *linphone_call_get_chat_room (LinphoneCall *call) {
}
float linphone_call_get_play_volume (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getPlayVolume();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getPlayVolume();
}
float linphone_call_get_record_volume (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getRecordVolume();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRecordVolume();
}
float linphone_call_get_speaker_volume_gain (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getSpeakerVolumeGain();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getSpeakerVolumeGain();
}
void linphone_call_set_speaker_volume_gain( LinphoneCall *call, float volume) {
GET_CPP_PTR(call)->setSpeakerVolumeGain(volume);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setSpeakerVolumeGain(volume);
}
float linphone_call_get_microphone_volume_gain (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getMicrophoneVolumeGain();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getMicrophoneVolumeGain();
}
void linphone_call_set_microphone_volume_gain (LinphoneCall *call, float volume) {
GET_CPP_PTR(call)->setMicrophoneVolumeGain(volume);
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setMicrophoneVolumeGain(volume);
}
float linphone_call_get_current_quality (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getCurrentQuality();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getCurrentQuality();
}
float linphone_call_get_average_quality (const LinphoneCall *call) {
return GET_CPP_PTR(call)->getAverageQuality();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAverageQuality();
}
void linphone_call_start_recording (LinphoneCall *call) {
GET_CPP_PTR(call)->startRecording();
L_GET_CPP_PTR_FROM_C_OBJECT(call)->startRecording();
}
void linphone_call_stop_recording (LinphoneCall *call) {
GET_CPP_PTR(call)->stopRecording();
L_GET_CPP_PTR_FROM_C_OBJECT(call)->stopRecording();
}
LinphonePlayer *linphone_call_get_player (LinphoneCall *call) {
@ -1094,7 +1091,7 @@ LinphonePlayer *linphone_call_get_player (LinphoneCall *call) {
}
bool_t linphone_call_media_in_progress (const LinphoneCall *call) {
return GET_CPP_PTR(call)->mediaInProgress();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->mediaInProgress();
}
void linphone_call_ogl_render (const LinphoneCall *call) {
@ -1116,19 +1113,19 @@ LinphoneStatus linphone_call_send_info_message (LinphoneCall *call, const Linpho
}
LinphoneCallStats *linphone_call_get_stats (LinphoneCall *call, LinphoneStreamType type) {
return GET_CPP_PTR(call)->getStats(type);
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getStats(type);
}
LinphoneCallStats *linphone_call_get_audio_stats (LinphoneCall *call) {
return GET_CPP_PTR(call)->getAudioStats();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAudioStats();
}
LinphoneCallStats *linphone_call_get_video_stats (LinphoneCall *call) {
return GET_CPP_PTR(call)->getVideoStats();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getVideoStats();
}
LinphoneCallStats *linphone_call_get_text_stats (LinphoneCall *call) {
return GET_CPP_PTR(call)->getTextStats();
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getTextStats();
}
void linphone_call_add_callbacks (LinphoneCall *call, LinphoneCallCbs *cbs) {
@ -1156,7 +1153,7 @@ void linphone_call_set_params (LinphoneCall *call, const LinphoneCallParams *par
}
const LinphoneCallParams *linphone_call_get_params (LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_OBJECT(call->paramsCache, GET_CPP_PTR(call)->getParams());
L_SET_CPP_PTR_FROM_C_OBJECT(call->paramsCache, L_GET_CPP_PTR_FROM_C_OBJECT(call)->getParams());
return call->paramsCache;
}
@ -1206,6 +1203,6 @@ LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddres
call->paramsCache = linphone_call_params_new_for_wrapper();
call->remoteParamsCache = linphone_call_params_new_for_wrapper();
call->remoteAddressCache = linphone_address_new(nullptr);
GET_CPP_PRIVATE_PTR(call)->initiateIncoming();
L_GET_PRIVATE_FROM_C_OBJECT(call)->initiateIncoming();
return call;
}

View file

@ -30,9 +30,6 @@
// =============================================================================
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj)
using namespace std;
static void _linphone_chat_message_constructor (LinphoneChatMessage *msg);

View file

@ -29,9 +29,6 @@
// =============================================================================
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj)
using namespace std;
static void _linphone_chat_room_constructor (LinphoneChatRoom *cr);
@ -62,19 +59,19 @@ static void _linphone_chat_room_destructor (LinphoneChatRoom *cr) {
// =============================================================================
void linphone_chat_room_release (LinphoneChatRoom *cr) {
GET_CPP_PRIVATE_PTR(cr)->release();
L_GET_PRIVATE_FROM_C_OBJECT(cr)->release();
}
void linphone_chat_room_remove_transient_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
GET_CPP_PRIVATE_PTR(cr)->removeTransientMessage(msg);
L_GET_PRIVATE_FROM_C_OBJECT(cr)->removeTransientMessage(msg);
}
void linphone_chat_room_send_message (LinphoneChatRoom *cr, const char *msg) {
GET_CPP_PTR(cr)->sendMessage(GET_CPP_PTR(cr)->createMessage(msg));
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->sendMessage(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createMessage(msg));
}
bool_t linphone_chat_room_is_remote_composing (const LinphoneChatRoom *cr) {
return GET_CPP_PTR(cr)->isRemoteComposing();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->isRemoteComposing();
}
LinphoneCore *linphone_chat_room_get_lc (const LinphoneChatRoom *cr) {
@ -82,19 +79,19 @@ LinphoneCore *linphone_chat_room_get_lc (const LinphoneChatRoom *cr) {
}
LinphoneCore *linphone_chat_room_get_core (const LinphoneChatRoom *cr) {
return GET_CPP_PTR(cr)->getCore();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getCore();
}
const LinphoneAddress *linphone_chat_room_get_peer_address (LinphoneChatRoom *cr) {
if (cr->peerAddressCache) {
linphone_address_unref(cr->peerAddressCache);
}
cr->peerAddressCache = linphone_address_new(GET_CPP_PTR(cr)->getPeerAddress().asString().c_str());
cr->peerAddressCache = linphone_address_new(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getPeerAddress().asString().c_str());
return cr->peerAddressCache;
}
LinphoneChatMessage *linphone_chat_room_create_message (LinphoneChatRoom *cr, const char *message) {
return GET_CPP_PTR(cr)->createMessage(message ? message : "");
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createMessage(message ? message : "");
}
LinphoneChatMessage *linphone_chat_room_create_message_2 (
@ -132,73 +129,73 @@ void linphone_chat_room_send_message2 (
) {
linphone_chat_message_set_message_state_changed_cb(msg, status_cb);
linphone_chat_message_set_message_state_changed_cb_user_data(msg, ud);
GET_CPP_PTR(cr)->sendMessage(msg);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->sendMessage(msg);
}
void linphone_chat_room_send_chat_message_2 (LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
linphone_chat_message_ref(msg);
GET_CPP_PTR(cr)->sendMessage(msg);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->sendMessage(msg);
}
void linphone_chat_room_send_chat_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
GET_CPP_PTR(cr)->sendMessage(msg);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->sendMessage(msg);
}
uint32_t linphone_chat_room_get_char (const LinphoneChatRoom *cr) {
if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr)))
return static_cast<const LinphonePrivate::RealTimeTextChatRoom *>(GET_CPP_PTR(cr).get())->getChar();
return static_cast<const LinphonePrivate::RealTimeTextChatRoom *>(L_GET_CPP_PTR_FROM_C_OBJECT(cr).get())->getChar();
return 0;
}
void linphone_chat_room_compose (LinphoneChatRoom *cr) {
GET_CPP_PTR(cr)->compose();
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->compose();
}
LinphoneCall *linphone_chat_room_get_call (const LinphoneChatRoom *cr) {
if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr)))
return static_cast<const LinphonePrivate::RealTimeTextChatRoom *>(GET_CPP_PTR(cr).get())->getCall();
return static_cast<const LinphonePrivate::RealTimeTextChatRoom *>(L_GET_CPP_PTR_FROM_C_OBJECT(cr).get())->getCall();
return nullptr;
}
void linphone_chat_room_set_call (LinphoneChatRoom *cr, LinphoneCall *call) {
if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr)))
static_cast<LinphonePrivate::RealTimeTextChatRoomPrivate *>(GET_CPP_PRIVATE_PTR(cr))->setCall(call);
static_cast<LinphonePrivate::RealTimeTextChatRoomPrivate *>(L_GET_PRIVATE_FROM_C_OBJECT(cr))->setCall(call);
}
bctbx_list_t *linphone_chat_room_get_transient_messages (const LinphoneChatRoom *cr) {
return L_GET_C_LIST_FROM_CPP_LIST(GET_CPP_PRIVATE_PTR(cr)->getTransientMessages());
return L_GET_C_LIST_FROM_CPP_LIST(L_GET_PRIVATE_FROM_C_OBJECT(cr)->getTransientMessages());
}
void linphone_chat_room_mark_as_read (LinphoneChatRoom *cr) {
GET_CPP_PTR(cr)->markAsRead();
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->markAsRead();
}
int linphone_chat_room_get_unread_messages_count (LinphoneChatRoom *cr) {
return GET_CPP_PTR(cr)->getUnreadMessagesCount();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getUnreadMessagesCount();
}
int linphone_chat_room_get_history_size (LinphoneChatRoom *cr) {
return GET_CPP_PTR(cr)->getHistorySize();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getHistorySize();
}
void linphone_chat_room_delete_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
GET_CPP_PTR(cr)->deleteMessage(msg);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->deleteMessage(msg);
}
void linphone_chat_room_delete_history (LinphoneChatRoom *cr) {
GET_CPP_PTR(cr)->deleteHistory();
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->deleteHistory();
}
bctbx_list_t *linphone_chat_room_get_history_range (LinphoneChatRoom *cr, int startm, int endm) {
return L_GET_C_LIST_FROM_CPP_LIST(GET_CPP_PTR(cr)->getHistoryRange(startm, endm));
return L_GET_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getHistoryRange(startm, endm));
}
bctbx_list_t *linphone_chat_room_get_history (LinphoneChatRoom *cr, int nb_message) {
return L_GET_C_LIST_FROM_CPP_LIST(GET_CPP_PTR(cr)->getHistory(nb_message));
return L_GET_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getHistory(nb_message));
}
LinphoneChatMessage *linphone_chat_room_find_message (LinphoneChatRoom *cr, const char *message_id) {
return GET_CPP_PTR(cr)->findMessage(message_id);
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->findMessage(message_id);
}
LinphoneChatRoomCbs *linphone_chat_room_get_callbacks (const LinphoneChatRoom *cr) {
@ -206,42 +203,42 @@ LinphoneChatRoomCbs *linphone_chat_room_get_callbacks (const LinphoneChatRoom *c
}
LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr) {
return (LinphoneChatRoomState)GET_CPP_PTR(cr)->getState();
return (LinphoneChatRoomState)L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getState();
}
LinphoneParticipant *linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) {
return L_GET_C_BACK_PTR(GET_CPP_PTR(cr)->addParticipant(
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->addParticipant(
*L_GET_CPP_PTR_FROM_C_OBJECT(addr), nullptr, false)
);
}
void linphone_chat_room_add_participants (LinphoneChatRoom *cr, const bctbx_list_t *addresses) {
GET_CPP_PTR(cr)->addParticipants(L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(addresses, Address, Address), nullptr, false);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->addParticipants(L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(addresses, Address, Address), nullptr, false);
}
bool_t linphone_chat_room_can_handle_participants (const LinphoneChatRoom *cr) {
return GET_CPP_PTR(cr)->canHandleParticipants();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->canHandleParticipants();
}
const char *linphone_chat_room_get_id (const LinphoneChatRoom *cr) {
string id = GET_CPP_PTR(cr)->getId();
string id = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getId();
return id.empty() ? nullptr : id.c_str();
}
int linphone_chat_room_get_nb_participants (const LinphoneChatRoom *cr) {
return GET_CPP_PTR(cr)->getNbParticipants();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getNbParticipants();
}
bctbx_list_t *linphone_chat_room_get_participants (const LinphoneChatRoom *cr) {
return L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(GET_CPP_PTR(cr)->getParticipants(), Participant, Participant);
return L_GET_C_LIST_OF_STRUCT_PTR_FROM_CPP_LIST_OF_CPP_OBJ(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getParticipants(), Participant, Participant);
}
void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant) {
GET_CPP_PTR(cr)->removeParticipant(L_GET_CPP_PTR_FROM_C_OBJECT(participant));
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->removeParticipant(L_GET_CPP_PTR_FROM_C_OBJECT(participant));
}
void linphone_chat_room_remove_participants (LinphoneChatRoom *cr, const bctbx_list_t *participants) {
GET_CPP_PTR(cr)->removeParticipants(L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(participants, Participant, Participant));
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->removeParticipants(L_GET_CPP_LIST_OF_CPP_OBJ_FROM_C_LIST_OF_STRUCT_PTR(participants, Participant, Participant));
}
// =============================================================================