OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 _decodeTimestamp(0) | 22 _decodeTimestamp(0) |
23 { | 23 { |
24 _acm->InitializeReceiver(); | 24 _acm->InitializeReceiver(); |
25 _acm->RegisterTransportCallback(this); | 25 _acm->RegisterTransportCallback(this); |
26 } | 26 } |
27 | 27 |
28 AudioCoder::~AudioCoder() | 28 AudioCoder::~AudioCoder() |
29 { | 29 { |
30 } | 30 } |
31 | 31 |
32 int32_t AudioCoder::SetEncodeCodec(const CodecInst& codecInst, | 32 int32_t AudioCoder::SetEncodeCodec(const CodecInst& codecInst) |
33 ACMAMRPackingFormat amrFormat) | |
34 { | 33 { |
35 if(_acm->RegisterSendCodec((CodecInst&)codecInst) == -1) | 34 if(_acm->RegisterSendCodec((CodecInst&)codecInst) == -1) |
36 { | 35 { |
37 return -1; | 36 return -1; |
38 } | 37 } |
39 return 0; | 38 return 0; |
40 } | 39 } |
41 | 40 |
42 int32_t AudioCoder::SetDecodeCodec(const CodecInst& codecInst, | 41 int32_t AudioCoder::SetDecodeCodec(const CodecInst& codecInst) |
43 ACMAMRPackingFormat amrFormat) | |
44 { | 42 { |
45 if(_acm->RegisterReceiveCodec((CodecInst&)codecInst) == -1) | 43 if(_acm->RegisterReceiveCodec((CodecInst&)codecInst) == -1) |
46 { | 44 { |
47 return -1; | 45 return -1; |
48 } | 46 } |
49 memcpy(&_receiveCodec,&codecInst,sizeof(CodecInst)); | 47 memcpy(&_receiveCodec,&codecInst,sizeof(CodecInst)); |
50 return 0; | 48 return 0; |
51 } | 49 } |
52 | 50 |
53 int32_t AudioCoder::Decode(AudioFrame& decodedAudio, | 51 int32_t AudioCoder::Decode(AudioFrame& decodedAudio, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 uint32_t /* timeStamp */, | 103 uint32_t /* timeStamp */, |
106 const uint8_t* payloadData, | 104 const uint8_t* payloadData, |
107 size_t payloadSize, | 105 size_t payloadSize, |
108 const RTPFragmentationHeader* /* fragmentation*/) | 106 const RTPFragmentationHeader* /* fragmentation*/) |
109 { | 107 { |
110 memcpy(_encodedData,payloadData,sizeof(uint8_t) * payloadSize); | 108 memcpy(_encodedData,payloadData,sizeof(uint8_t) * payloadSize); |
111 _encodedLengthInBytes = payloadSize; | 109 _encodedLengthInBytes = payloadSize; |
112 return 0; | 110 return 0; |
113 } | 111 } |
114 } // namespace webrtc | 112 } // namespace webrtc |
OLD | NEW |