audio_decoder_opus.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_CODEC_AUDIO_DECODER_OPUS_H_
  5. #define REMOTING_CODEC_AUDIO_DECODER_OPUS_H_
  6. #include <memory>
  7. #include "base/memory/raw_ptr.h"
  8. #include "remoting/codec/audio_decoder.h"
  9. struct OpusDecoder;
  10. namespace remoting {
  11. class AudioPacket;
  12. class AudioDecoderOpus : public AudioDecoder {
  13. public:
  14. AudioDecoderOpus();
  15. AudioDecoderOpus(const AudioDecoderOpus&) = delete;
  16. AudioDecoderOpus& operator=(const AudioDecoderOpus&) = delete;
  17. ~AudioDecoderOpus() override;
  18. // AudioDecoder interface.
  19. std::unique_ptr<AudioPacket> Decode(
  20. std::unique_ptr<AudioPacket> packet) override;
  21. private:
  22. void InitDecoder();
  23. void DestroyDecoder();
  24. bool ResetForPacket(AudioPacket* packet);
  25. int sampling_rate_;
  26. int channels_;
  27. raw_ptr<OpusDecoder> decoder_;
  28. };
  29. } // namespace remoting
  30. #endif // REMOTING_CODEC_AUDIO_DECODER_OPUS_H_