• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2015 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 
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_DECODER_ISAC_T_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_DECODER_ISAC_T_H_
13 
14 #include <vector>
15 
16 #include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
17 #include "webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h"
18 
19 namespace webrtc {
20 
21 template <typename T>
22 class AudioDecoderIsacT final : public AudioDecoder {
23  public:
24   AudioDecoderIsacT();
25   explicit AudioDecoderIsacT(LockedIsacBandwidthInfo* bwinfo);
26   ~AudioDecoderIsacT() override;
27 
28   bool HasDecodePlc() const override;
29   size_t DecodePlc(size_t num_frames, int16_t* decoded) override;
30   void Reset() override;
31   int IncomingPacket(const uint8_t* payload,
32                      size_t payload_len,
33                      uint16_t rtp_sequence_number,
34                      uint32_t rtp_timestamp,
35                      uint32_t arrival_timestamp) override;
36   int ErrorCode() override;
37   size_t Channels() const override;
38   int DecodeInternal(const uint8_t* encoded,
39                      size_t encoded_len,
40                      int sample_rate_hz,
41                      int16_t* decoded,
42                      SpeechType* speech_type) override;
43 
44  private:
45   typename T::instance_type* isac_state_;
46   LockedIsacBandwidthInfo* bwinfo_;
47   int decoder_sample_rate_hz_;
48 
49   RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderIsacT);
50 };
51 
52 }  // namespace webrtc
53 
54 #endif  // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_DECODER_ISAC_T_H_
55