| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 int16_t WebRtcG722_CreateDecoder(G722DecInst **G722dec_inst) | 59 int16_t WebRtcG722_CreateDecoder(G722DecInst **G722dec_inst) |
| 60 { | 60 { |
| 61 *G722dec_inst=(G722DecInst*)malloc(sizeof(G722DecoderState)); | 61 *G722dec_inst=(G722DecInst*)malloc(sizeof(G722DecoderState)); |
| 62 if (*G722dec_inst!=NULL) { | 62 if (*G722dec_inst!=NULL) { |
| 63 return(0); | 63 return(0); |
| 64 } else { | 64 } else { |
| 65 return(-1); | 65 return(-1); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 int16_t WebRtcG722_DecoderInit(G722DecInst *G722dec_inst) | 69 void WebRtcG722_DecoderInit(G722DecInst* inst) { |
| 70 { | 70 // Create and/or reset the G.722 decoder |
| 71 // Create and/or reset the G.722 decoder | 71 // Bitrate 64 kbps and wideband mode (2) |
| 72 // Bitrate 64 kbps and wideband mode (2) | 72 WebRtc_g722_decode_init((G722DecoderState*)inst, 64000, 2); |
| 73 G722dec_inst = (G722DecInst *) WebRtc_g722_decode_init( | |
| 74 (G722DecoderState*) G722dec_inst, 64000, 2); | |
| 75 if (G722dec_inst == NULL) { | |
| 76 return -1; | |
| 77 } else { | |
| 78 return 0; | |
| 79 } | |
| 80 } | 73 } |
| 81 | 74 |
| 82 int WebRtcG722_FreeDecoder(G722DecInst *G722dec_inst) | 75 int WebRtcG722_FreeDecoder(G722DecInst *G722dec_inst) |
| 83 { | 76 { |
| 84 // Free encoder memory | 77 // Free encoder memory |
| 85 return WebRtc_g722_decode_release((G722DecoderState*) G722dec_inst); | 78 return WebRtc_g722_decode_release((G722DecoderState*) G722dec_inst); |
| 86 } | 79 } |
| 87 | 80 |
| 88 size_t WebRtcG722_Decode(G722DecInst *G722dec_inst, | 81 size_t WebRtcG722_Decode(G722DecInst *G722dec_inst, |
| 89 const uint8_t *encoded, | 82 const uint8_t *encoded, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 105 { | 98 { |
| 106 strcpy(versionStr, version); | 99 strcpy(versionStr, version); |
| 107 return 0; | 100 return 0; |
| 108 } | 101 } |
| 109 else | 102 else |
| 110 { | 103 { |
| 111 return -1; | 104 return -1; |
| 112 } | 105 } |
| 113 } | 106 } |
| 114 | 107 |
| OLD | NEW |