From b89252090324e1dba46dc1a8b4d5f6a4294e757c Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 5 Jan 2018 12:16:22 +0100 Subject: [PATCH] Added get_core methods on NatPolicy and Player --- coreapi/nat_policy.c | 4 ++++ coreapi/player.c | 3 +++ include/linphone/nat_policy.h | 6 ++++++ include/linphone/player.h | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/coreapi/nat_policy.c b/coreapi/nat_policy.c index a305fa6a7..8edfe3bd2 100644 --- a/coreapi/nat_policy.c +++ b/coreapi/nat_policy.c @@ -316,3 +316,7 @@ LinphoneNatPolicy * linphone_core_create_nat_policy_from_config(LinphoneCore *lc } return policy; } + +LinphoneCore *linphone_nat_policy_get_core(const LinphoneNatPolicy *policy) { + return policy->lc; +} diff --git a/coreapi/player.c b/coreapi/player.c index 39ee83e7b..a8a73453c 100644 --- a/coreapi/player.c +++ b/coreapi/player.c @@ -204,6 +204,9 @@ LinphonePlayer *linphone_call_build_player(LinphoneCall *call){ return obj; } +LinphoneCore *linphone_player_get_core(const LinphonePlayer *player){ + return linphone_call_get_core((LinphoneCall *)player->impl); +} BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphonePlayerCbs); diff --git a/include/linphone/nat_policy.h b/include/linphone/nat_policy.h index 56f63a09f..c6dcd97d9 100644 --- a/include/linphone/nat_policy.h +++ b/include/linphone/nat_policy.h @@ -176,6 +176,12 @@ LINPHONE_PUBLIC void linphone_nat_policy_resolve_stun_server(LinphoneNatPolicy * */ LINPHONE_PUBLIC const struct addrinfo * linphone_nat_policy_get_stun_server_addrinfo(LinphoneNatPolicy *policy); +/** + * Returns the LinphoneCore object managing this nat policy, if any. + * @param[in] fr LinphoneNatPolicy object + */ +LINPHONE_PUBLIC LinphoneCore *linphone_nat_policy_get_core(const LinphoneNatPolicy *policy); + /** * @} */ diff --git a/include/linphone/player.h b/include/linphone/player.h index dac160d96..499959e9e 100644 --- a/include/linphone/player.h +++ b/include/linphone/player.h @@ -125,6 +125,11 @@ LINPHONE_PUBLIC int linphone_player_get_current_position(LinphonePlayer *obj); */ LINPHONE_PUBLIC void linphone_player_close(LinphonePlayer *obj); +/** + * Returns the LinphoneCore object managing this player's call, if any. + * @param[in] fr LinphonePlayer object + */ +LINPHONE_PUBLIC LinphoneCore *linphone_player_get_core(const LinphonePlayer *player); /** * Acquire a reference to the LinphonePlayerCbs object.