| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // matter for the test). | 168 // matter for the test). |
| 169 const int kNumPayloads = 10; | 169 const int kNumPayloads = 10; |
| 170 for (uint8_t payload_type = 0; payload_type < kNumPayloads; ++payload_type) { | 170 for (uint8_t payload_type = 0; payload_type < kNumPayloads; ++payload_type) { |
| 171 EXPECT_EQ(DecoderDatabase::kOK, | 171 EXPECT_EQ(DecoderDatabase::kOK, |
| 172 db.RegisterPayload(payload_type, NetEqDecoder::kDecoderPCMu, "")); | 172 db.RegisterPayload(payload_type, NetEqDecoder::kDecoderPCMu, "")); |
| 173 } | 173 } |
| 174 PacketList packet_list; | 174 PacketList packet_list; |
| 175 for (int i = 0; i < kNumPayloads + 1; ++i) { | 175 for (int i = 0; i < kNumPayloads + 1; ++i) { |
| 176 // Create packet with payload type |i|. The last packet will have a payload | 176 // Create packet with payload type |i|. The last packet will have a payload |
| 177 // type that is not registered in the decoder database. | 177 // type that is not registered in the decoder database. |
| 178 Packet* packet = new Packet; | 178 Packet packet; |
| 179 packet->payload_type = i; | 179 packet.payload_type = i; |
| 180 packet_list.push_back(packet); | 180 packet_list.push_back(std::move(packet)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Expect to return false, since the last packet is of an unknown type. | 183 // Expect to return false, since the last packet is of an unknown type. |
| 184 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, | 184 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, |
| 185 db.CheckPayloadTypes(packet_list)); | 185 db.CheckPayloadTypes(packet_list)); |
| 186 | 186 |
| 187 delete packet_list.back(); | |
| 188 packet_list.pop_back(); // Remove the unknown one. | 187 packet_list.pop_back(); // Remove the unknown one. |
| 189 | 188 |
| 190 EXPECT_EQ(DecoderDatabase::kOK, db.CheckPayloadTypes(packet_list)); | 189 EXPECT_EQ(DecoderDatabase::kOK, db.CheckPayloadTypes(packet_list)); |
| 191 | 190 |
| 192 // Delete all packets. | 191 // Delete all packets. |
| 193 PacketList::iterator it = packet_list.begin(); | 192 PacketList::iterator it = packet_list.begin(); |
| 194 while (it != packet_list.end()) { | 193 while (it != packet_list.end()) { |
| 195 delete packet_list.front(); | |
| 196 it = packet_list.erase(it); | 194 it = packet_list.erase(it); |
| 197 } | 195 } |
| 198 } | 196 } |
| 199 | 197 |
| 200 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX) | 198 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX) |
| 201 #define IF_ISAC(x) x | 199 #define IF_ISAC(x) x |
| 202 #else | 200 #else |
| 203 #define IF_ISAC(x) DISABLED_##x | 201 #define IF_ISAC(x) DISABLED_##x |
| 204 #endif | 202 #endif |
| 205 | 203 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 EXPECT_EQ(DecoderDatabase::kOK, db.Remove(13)); | 247 EXPECT_EQ(DecoderDatabase::kOK, db.Remove(13)); |
| 250 EXPECT_EQ(NULL, db.GetActiveCngDecoder()); | 248 EXPECT_EQ(NULL, db.GetActiveCngDecoder()); |
| 251 | 249 |
| 252 // Try to set non-existing codecs as active. | 250 // Try to set non-existing codecs as active. |
| 253 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, | 251 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, |
| 254 db.SetActiveDecoder(17, &changed)); | 252 db.SetActiveDecoder(17, &changed)); |
| 255 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, | 253 EXPECT_EQ(DecoderDatabase::kDecoderNotFound, |
| 256 db.SetActiveCngDecoder(17)); | 254 db.SetActiveCngDecoder(17)); |
| 257 } | 255 } |
| 258 } // namespace webrtc | 256 } // namespace webrtc |
| OLD | NEW |