blob: bc6b9c59c8f4be4c90f75da8734463b791ba6ca5 [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,
21 int16_t* decoded,
22 SpeechType* speech_type) {
henrik.lundin@webrtc.org903182b2015-02-24 21:17:50 +000023 return Decode(encoded, encoded_len, decoded, speech_type);
kwiberg@webrtc.orge04a93b2014-12-09 10:12:53 +000024}
25
26bool AudioDecoder::HasDecodePlc() const { return false; }
27
28int AudioDecoder::DecodePlc(int num_frames, int16_t* decoded) { return -1; }
29
30int AudioDecoder::IncomingPacket(const uint8_t* payload,
31 size_t payload_len,
32 uint16_t rtp_sequence_number,
33 uint32_t rtp_timestamp,
34 uint32_t arrival_timestamp) {
35 return 0;
36}
37
38int AudioDecoder::ErrorCode() { return 0; }
39
minyue@webrtc.orga8cc3442015-02-13 14:01:54 +000040int AudioDecoder::PacketDuration(const uint8_t* encoded,
41 size_t encoded_len) const {
kwiberg@webrtc.orge04a93b2014-12-09 10:12:53 +000042 return kNotImplemented;
43}
44
45int AudioDecoder::PacketDurationRedundant(const uint8_t* encoded,
46 size_t encoded_len) const {
47 return kNotImplemented;
48}
49
50bool AudioDecoder::PacketHasFec(const uint8_t* encoded,
51 size_t encoded_len) const {
52 return false;
53}
54
55CNG_dec_inst* AudioDecoder::CngDecoderInstance() {
56 FATAL() << "Not a CNG decoder";
57 return NULL;
58}
59
60AudioDecoder::SpeechType AudioDecoder::ConvertSpeechType(int16_t type) {
61 switch (type) {
62 case 0: // TODO(hlundin): Both iSAC and Opus return 0 for speech.
63 case 1:
64 return kSpeech;
65 case 2:
66 return kComfortNoise;
67 default:
68 assert(false);
69 return kSpeech;
70 }
71}
72
73} // namespace webrtc