custom_neteq_factory.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef API_NETEQ_CUSTOM_NETEQ_FACTORY_H_
  11. #define API_NETEQ_CUSTOM_NETEQ_FACTORY_H_
  12. #include <memory>
  13. #include "api/audio_codecs/audio_decoder_factory.h"
  14. #include "api/neteq/neteq_controller_factory.h"
  15. #include "api/neteq/neteq_factory.h"
  16. #include "api/scoped_refptr.h"
  17. #include "system_wrappers/include/clock.h"
  18. namespace webrtc {
  19. // This factory can be used to generate NetEq instances that make use of a
  20. // custom NetEqControllerFactory.
  21. class CustomNetEqFactory : public NetEqFactory {
  22. public:
  23. explicit CustomNetEqFactory(
  24. std::unique_ptr<NetEqControllerFactory> controller_factory);
  25. ~CustomNetEqFactory() override;
  26. CustomNetEqFactory(const CustomNetEqFactory&) = delete;
  27. CustomNetEqFactory& operator=(const CustomNetEqFactory&) = delete;
  28. std::unique_ptr<NetEq> CreateNetEq(
  29. const NetEq::Config& config,
  30. const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory,
  31. Clock* clock) const override;
  32. private:
  33. std::unique_ptr<NetEqControllerFactory> controller_factory_;
  34. };
  35. } // namespace webrtc
  36. #endif // API_NETEQ_CUSTOM_NETEQ_FACTORY_H_