Overte C++ Documentation
OpusDecoder.h
1 //
2 // OpusCodecManager.h
3 // plugins/opusCodec/src
4 //
5 // Copyright 2020 Dale Glass
6 //
7 // Distributed under the Apache License, Version 2.0.
8 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
9 //
10 
11 #ifndef OPUSDECODER_H
12 #define OPUSDECODER_H
13 
14 
15 #include <plugins/CodecPlugin.h>
16 #include <opus/opus.h>
17 
18 
19 class AthenaOpusDecoder : public Decoder {
20 public:
21  AthenaOpusDecoder(int sampleRate, int numChannels);
22  ~AthenaOpusDecoder() override;
23 
24 
25  virtual void decode(const QByteArray& encodedBuffer, QByteArray& decodedBuffer) override;
26  virtual void lostFrame(QByteArray &decodedBuffer) override;
27 
28 
29 private:
30  int _encodedSize;
31 
32  OpusDecoder* _decoder = nullptr;
33  int _opusSampleRate = 0;
34  int _opusNumChannels = 0;
35  int _decodedSize = 0;
36 };
37 
38 
39 #endif // OPUSDECODER_H