2 * Copyright (C) 2017 Christian Browet
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "network/Zeroconf.h"
12 #include "threads/CriticalSection.h"
14 #include "platform/android/activity/JNIXBMCNsdManagerRegistrationListener.h"
16 #include <androidjni/NsdManager.h>
17 #include <androidjni/NsdServiceInfo.h>
19 class CZeroconfAndroid
: public CZeroconf
23 ~CZeroconfAndroid() override
;
25 // CZeroconf interface
27 bool doPublishService(const std::string
& fcr_identifier
, const std::string
& fcr_type
, const std::string
& fcr_name
, unsigned int f_port
, const std::vector
<std::pair
<std::string
, std::string
>>& txt
) override
;
28 bool doForceReAnnounceService(const std::string
& fcr_identifier
) override
;
29 bool doRemoveService(const std::string
& fcr_ident
) override
;
30 void doStop() override
;
33 jni::CJNINsdManager m_manager
;
35 //lock + data (accessed from runloop(main thread) + the rest)
36 CCriticalSection m_data_guard
;
39 jni::CJNINsdServiceInfo serviceInfo
;
40 jni::CJNIXBMCNsdManagerRegistrationListener registrationListener
;
43 typedef std::map
<std::string
, struct tServiceRef
> tServiceMap
;
44 tServiceMap m_services
;