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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const uint8_t kPayloadTypeDtmf = 100; | 105 const uint8_t kPayloadTypeDtmf = 100; |
106 const uint8_t kPayloadTypeRed = 101; | 106 const uint8_t kPayloadTypeRed = 101; |
107 const uint8_t kPayloadNotUsed = 102; | 107 const uint8_t kPayloadNotUsed = 102; |
108 // Load into database. | 108 // Load into database. |
109 EXPECT_EQ( | 109 EXPECT_EQ( |
110 DecoderDatabase::kOK, | 110 DecoderDatabase::kOK, |
111 db.RegisterPayload(kPayloadTypePcmU, NetEqDecoder::kDecoderPCMu, "pcmu")); | 111 db.RegisterPayload(kPayloadTypePcmU, NetEqDecoder::kDecoderPCMu, "pcmu")); |
112 EXPECT_EQ(DecoderDatabase::kOK, | 112 EXPECT_EQ(DecoderDatabase::kOK, |
113 db.RegisterPayload(kPayloadTypeCng, NetEqDecoder::kDecoderCNGnb, | 113 db.RegisterPayload(kPayloadTypeCng, NetEqDecoder::kDecoderCNGnb, |
114 "cng-nb")); | 114 "cng-nb")); |
115 EXPECT_EQ( | 115 EXPECT_EQ(DecoderDatabase::kOK, |
116 DecoderDatabase::kOK, | 116 db.RegisterPayload(kPayloadTypeDtmf, NetEqDecoder::kDecoderAVT8kHz, |
117 db.RegisterPayload(kPayloadTypeDtmf, NetEqDecoder::kDecoderAVT, "avt")); | 117 "avt")); |
118 EXPECT_EQ( | 118 EXPECT_EQ( |
119 DecoderDatabase::kOK, | 119 DecoderDatabase::kOK, |
120 db.RegisterPayload(kPayloadTypeRed, NetEqDecoder::kDecoderRED, "red")); | 120 db.RegisterPayload(kPayloadTypeRed, NetEqDecoder::kDecoderRED, "red")); |
121 EXPECT_EQ(4, db.Size()); | 121 EXPECT_EQ(4, db.Size()); |
122 // Test. | 122 // Test. |
123 EXPECT_FALSE(db.IsComfortNoise(kPayloadNotUsed)); | 123 EXPECT_FALSE(db.IsComfortNoise(kPayloadNotUsed)); |
124 EXPECT_FALSE(db.IsDtmf(kPayloadNotUsed)); | 124 EXPECT_FALSE(db.IsDtmf(kPayloadNotUsed)); |
125 EXPECT_FALSE(db.IsRed(kPayloadNotUsed)); | 125 EXPECT_FALSE(db.IsRed(kPayloadNotUsed)); |
126 EXPECT_FALSE(db.IsComfortNoise(kPayloadTypePcmU)); | 126 EXPECT_FALSE(db.IsComfortNoise(kPayloadTypePcmU)); |
127 EXPECT_FALSE(db.IsDtmf(kPayloadTypePcmU)); | 127 EXPECT_FALSE(db.IsDtmf(kPayloadTypePcmU)); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 EXPECT_EQ(DecoderDatabase::kOK, db.Remove(13)); | 249 EXPECT_EQ(DecoderDatabase::kOK, db.Remove(13)); |
250 EXPECT_EQ(NULL, db.GetActiveCngDecoder()); | 250 EXPECT_EQ(NULL, db.GetActiveCngDecoder()); |
251 | 251 |
252 // Try to set non-existing codecs as active. | 252 // Try to set non-existing codecs as active. |
253 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, | 253 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, |
254 db.SetActiveDecoder(17, &changed)); | 254 db.SetActiveDecoder(17, &changed)); |
255 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, | 255 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, |
256 db.SetActiveCngDecoder(17)); | 256 db.SetActiveCngDecoder(17)); |
257 } | 257 } |
258 } // namespace webrtc | 258 } // namespace webrtc |
OLD | NEW |