From 5350cadf47eeb7e2c601abe902f1f46ecaebbc88 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 11 Oct 2017 09:57:55 +0200 Subject: [PATCH] Added set/get user_data in LinphoneFactory --- coreapi/factory.c | 10 ++++++++++ include/linphone/factory.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/coreapi/factory.c b/coreapi/factory.c index ee7cbc761..fadb6234f 100644 --- a/coreapi/factory.c +++ b/coreapi/factory.c @@ -57,6 +57,8 @@ struct _LinphoneFactory { char *cached_image_resources_dir; char *cached_msplugins_dir; LinphoneErrorInfo* ei; + + void *user_data; }; static void linphone_factory_uninit(LinphoneFactory *obj){ @@ -320,3 +322,11 @@ LinphoneTransports *linphone_factory_create_transports(LinphoneFactory *factory) LinphoneVideoActivationPolicy *linphone_factory_create_video_activation_policy(LinphoneFactory *factory) { return linphone_video_activation_policy_new(); } + +void *linphone_factory_get_user_data(const LinphoneFactory *factory) { + return factory->user_data; +} + +void linphone_factory_set_user_data(LinphoneFactory *factory, void *data) { + factory->user_data = data; +} diff --git a/include/linphone/factory.h b/include/linphone/factory.h index 33a509e7c..a3e49fc7b 100644 --- a/include/linphone/factory.h +++ b/include/linphone/factory.h @@ -261,6 +261,21 @@ LINPHONE_PUBLIC LinphoneTransports *linphone_factory_create_transports(LinphoneF * @return LinphoneVideoActivationPolicy object. */ LINPHONE_PUBLIC LinphoneVideoActivationPolicy *linphone_factory_create_video_activation_policy(LinphoneFactory *factory); + +/** + * Gets the user data in the LinphoneFactory object + * @param[in] factory the LinphoneFactory + * @return the user data +*/ +LINPHONE_PUBLIC void *linphone_factory_get_user_data(const LinphoneFactory *factory); + +/** + * Sets the user data in the LinphoneFactory object + * @param[in] factory the LinphoneFactory object + * @param[in] data the user data +*/ +LINPHONE_PUBLIC void linphone_factory_set_user_data(LinphoneFactory *factory, void *data); + /** * @} */