2015-09-16 21:26:32 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2015-11-18 23:07:57 +01:00
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_AUDIO_DECODER_ILBC_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_AUDIO_DECODER_ILBC_H_
|
2015-09-16 21:26:32 -07:00
|
|
|
|
2017-02-10 08:15:44 -08:00
|
|
|
#include "webrtc/api/audio_codecs/audio_decoder.h"
|
2017-07-06 19:44:34 +02:00
|
|
|
#include "webrtc/rtc_base/constructormagic.h"
|
2015-09-16 21:26:32 -07:00
|
|
|
|
|
|
|
|
typedef struct iLBC_decinst_t_ IlbcDecoderInstance;
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2017-06-28 02:05:04 -07:00
|
|
|
class AudioDecoderIlbcImpl final : public AudioDecoder {
|
2015-09-16 21:26:32 -07:00
|
|
|
public:
|
2017-06-28 02:05:04 -07:00
|
|
|
AudioDecoderIlbcImpl();
|
|
|
|
|
~AudioDecoderIlbcImpl() override;
|
2015-09-16 21:26:32 -07:00
|
|
|
bool HasDecodePlc() const override;
|
|
|
|
|
size_t DecodePlc(size_t num_frames, int16_t* decoded) override;
|
|
|
|
|
void Reset() override;
|
2016-09-21 01:57:31 -07:00
|
|
|
std::vector<ParseResult> ParsePayload(rtc::Buffer&& payload,
|
2016-09-22 02:06:28 -07:00
|
|
|
uint32_t timestamp) override;
|
2016-05-31 02:46:20 -07:00
|
|
|
int SampleRateHz() const override;
|
2015-09-16 21:26:32 -07:00
|
|
|
size_t Channels() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int DecodeInternal(const uint8_t* encoded,
|
|
|
|
|
size_t encoded_len,
|
|
|
|
|
int sample_rate_hz,
|
|
|
|
|
int16_t* decoded,
|
|
|
|
|
SpeechType* speech_type) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
IlbcDecoderInstance* dec_state_;
|
2017-06-28 02:05:04 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderIlbcImpl);
|
2015-09-16 21:26:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
2015-11-18 23:07:57 +01:00
|
|
|
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_AUDIO_DECODER_ILBC_H_
|