AudioTransform.h 606 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <memory>
  3. #include <mutex>
  4. #include <thread>
  5. #include "StreamInfo.h"
  6. #include "TransformConfig.h"
  7. namespace bell {
  8. class AudioTransform {
  9. protected:
  10. std::mutex accessMutex;
  11. public:
  12. virtual std::unique_ptr<StreamInfo> process(
  13. std::unique_ptr<StreamInfo> data) = 0;
  14. virtual void sampleRateChanged(uint32_t sampleRate){};
  15. virtual float calculateHeadroom() { return 0; };
  16. virtual void reconfigure(){};
  17. std::string filterType;
  18. std::unique_ptr<TransformConfig> config;
  19. AudioTransform() = default;
  20. virtual ~AudioTransform() = default;
  21. };
  22. }; // namespace bell