blob: 6114e70a9f7948a724b15eef51aba02699cb3cbe [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) {
23 return Decode(encoded, encoded_len, decoded, speech_type);
24}
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
40int AudioDecoder::PacketDuration(const uint8_t* encoded, size_t encoded_len) {
41 return kNotImplemented;
42}
43
44int AudioDecoder::PacketDurationRedundant(const uint8_t* encoded,
45 size_t encoded_len) const {
46 return kNotImplemented;
47}
48
49bool AudioDecoder::PacketHasFec(const uint8_t* encoded,
50 size_t encoded_len) const {
51 return false;
52}
53
54CNG_dec_inst* AudioDecoder::CngDecoderInstance() {
55 FATAL() << "Not a CNG decoder";
56 return NULL;
57}
58
59AudioDecoder::SpeechType AudioDecoder::ConvertSpeechType(int16_t type) {
60 switch (type) {
61 case 0: // TODO(hlundin): Both iSAC and Opus return 0 for speech.
62 case 1:
63 return kSpeech;
64 case 2:
65 return kComfortNoise;
66 default:
67 assert(false);
68 return kSpeech;
69 }
70}
71
72} // namespace webrtc