2 * Copyright (C) 2012-2022 Team Kodi
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 "ISpeechRecognitionCallback.h"
12 #include "speech/ISpeechRecognition.h"
13 #include "threads/CriticalSection.h"
22 class CJNIXBMCSpeechRecognitionListener
;
25 class CSpeechRecognitionAndroid
: public ISpeechRecognitionCallback
,
26 public speech::ISpeechRecognition
29 explicit CSpeechRecognitionAndroid(const CJNIContext
& context
);
30 ~CSpeechRecognitionAndroid() override
;
32 // ISpeechRecognition implementation
33 void StartSpeechRecognition(
34 const std::shared_ptr
<speech::ISpeechRecognitionListener
>& listener
) override
;
36 // ISpeechRecognitionCallback implementation
37 void SpeechRecognitionDone(jni::CJNIXBMCSpeechRecognitionListener
* listener
) override
;
40 CSpeechRecognitionAndroid() = delete;
42 static void RegisterSpeechRecognitionListener(void* thiz
);
44 const CJNIContext
& m_context
;
45 CCriticalSection m_speechRecognitionListenersMutex
;
46 std::vector
<std::unique_ptr
<jni::CJNIXBMCSpeechRecognitionListener
>> m_speechRecognitionListeners
;