blob: 08178735c735ce0f3ef6fca606ceec7bff9850ca [file] [log] [blame]
kwiberg@webrtc.orge04a93b2014-12-09 10:12:53 +00001/*
2 * Copyright (c) 2012 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#include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
12
13#include <assert.h>
14
15#include "webrtc/base/checks.h"
16
17namespace webrtc {
18
19int AudioDecoder::DecodeRedundant(const uint8_t* encoded,
20 size_t encoded_len,
henrik.lundin@webrtc.orgb9c18d52015-02-24 15:58:17 +000021 int sample_rate_hz,
kwiberg@webrtc.orge04a93b2014-12-09 10:12:53 +000022 int16_t* decoded,
23 SpeechType* speech_type) {
henrik.lundin@webrtc.orgb9c18d52015-02-24 15:58:17 +000024 return Decode(encoded, encoded_len, sample_rate_hz, decoded, speech_type);
kwiberg@webrtc.orge04a93b2014-12-09 10:12:53 +000025}
26
27bool AudioDecoder::HasDecodePlc() const { return false; }
28
29int AudioDecoder::DecodePlc(int num_frames, int16_t* decoded) { return -1; }
30
31int AudioDecoder::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) {
36 return 0;
37}
38
39int AudioDecoder::ErrorCode() { return 0; }
40
minyue@webrtc.orga8cc3442015-02-13 14:01:54 +000041int AudioDecoder::PacketDuration(const uint8_t* encoded,
42 size_t encoded_len) const {
kwiberg@webrtc.orge04a93b2014-12-09 10:12:53 +000043 return kNotImplemented;
44}
45
46int AudioDecoder::PacketDurationRedundant(const uint8_t* encoded,
47 size_t encoded_len) const {
48 return kNotImplemented;
49}
50
51bool AudioDecoder::PacketHasFec(const uint8_t* encoded,
52 size_t encoded_len) const {
53 return false;
54}
55
56CNG_dec_inst* AudioDecoder::CngDecoderInstance() {
57 FATAL() << "Not a CNG decoder";
58 return NULL;
59}
60
61AudioDecoder::SpeechType AudioDecoder::ConvertSpeechType(int16_t type) {
62 switch (type) {
63 case 0: // TODO(hlundin): Both iSAC and Opus return 0 for speech.
64 case 1:
65 return kSpeech;
66 case 2:
67 return kComfortNoise;
68 default:
69 assert(false);
70 return kSpeech;
71 }
72}
73
74} // namespace webrtc