AudioInputAndroid.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // libtgvoip is free and unencumbered public domain software.
  3. // For more information, see http://unlicense.org or the UNLICENSE file
  4. // you should have received with this source code distribution.
  5. //
  6. #ifndef LIBTGVOIP_AUDIOINPUTANDROID_H
  7. #define LIBTGVOIP_AUDIOINPUTANDROID_H
  8. #include <jni.h>
  9. #include "../../audio/AudioInput.h"
  10. #include "../../threading.h"
  11. namespace tgvoip{ namespace audio{
  12. class AudioInputAndroid : public AudioInput{
  13. public:
  14. AudioInputAndroid();
  15. virtual ~AudioInputAndroid();
  16. virtual void Start();
  17. virtual void Stop();
  18. void HandleCallback(JNIEnv* env, jobject buffer);
  19. unsigned int GetEnabledEffects();
  20. static jmethodID initMethod;
  21. static jmethodID releaseMethod;
  22. static jmethodID startMethod;
  23. static jmethodID stopMethod;
  24. static jmethodID getEnabledEffectsMaskMethod;
  25. static jclass jniClass;
  26. static constexpr unsigned int EFFECT_AEC=1;
  27. static constexpr unsigned int EFFECT_NS=2;
  28. private:
  29. jobject javaObject;
  30. bool running;
  31. Mutex mutex;
  32. unsigned int enabledEffects=0;
  33. };
  34. }}
  35. #endif //LIBTGVOIP_AUDIOINPUTANDROID_H