kwiberg@webrtc.org | e04a93b | 2014-12-09 10:12:53 +0000 | [diff] [blame^] | 1 | /* |
| 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 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | int 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 | |
| 26 | bool AudioDecoder::HasDecodePlc() const { return false; } |
| 27 | |
| 28 | int AudioDecoder::DecodePlc(int num_frames, int16_t* decoded) { return -1; } |
| 29 | |
| 30 | int 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 | |
| 38 | int AudioDecoder::ErrorCode() { return 0; } |
| 39 | |
| 40 | int AudioDecoder::PacketDuration(const uint8_t* encoded, size_t encoded_len) { |
| 41 | return kNotImplemented; |
| 42 | } |
| 43 | |
| 44 | int AudioDecoder::PacketDurationRedundant(const uint8_t* encoded, |
| 45 | size_t encoded_len) const { |
| 46 | return kNotImplemented; |
| 47 | } |
| 48 | |
| 49 | bool AudioDecoder::PacketHasFec(const uint8_t* encoded, |
| 50 | size_t encoded_len) const { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | CNG_dec_inst* AudioDecoder::CngDecoderInstance() { |
| 55 | FATAL() << "Not a CNG decoder"; |
| 56 | return NULL; |
| 57 | } |
| 58 | |
| 59 | AudioDecoder::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 |