|
18 | 18 | // structure; see that file's header comment for the rationale behind |
19 | 19 | // testing at both the codec level and the real File API level. |
20 | 20 | #include <gtest/gtest.h> |
| 21 | + |
| 22 | +#include "Transmitter.h" |
| 23 | + |
| 24 | +#include <boost/asio.hpp> |
21 | 25 | #include <random> |
22 | 26 | #include <algorithm> |
23 | 27 | #include "fec/RaptorQCodec.h" |
@@ -385,3 +389,51 @@ TEST(RaptorQRepairTransmissionTest, RepairSymbolsRecoverLostSourceSymbols) { |
385 | 389 | EXPECT_TRUE(decoder.complete()) << dropped << " source symbols lost and not recovered"; |
386 | 390 | EXPECT_EQ(memcmp(decoder.buffer(), data.data(), data_len), 0); |
387 | 391 | } |
| 392 | + |
| 393 | + |
| 394 | +/* RaptorQ is offered for general FLUTE only. TS 26.346 V18.2.0 clause L.4.7 names the schemes the |
| 395 | + MBMS Download Profile admits: "Regarding Application Layer FEC support, the two FEC schemes |
| 396 | + referenced in this specification, the Compact No-Code FEC scheme as specified in RFC 3695 [13], |
| 397 | + and the Raptor FEC scheme as specified in RFC 5053 [91] are optional to implement by the BM-SC |
| 398 | + and mandatory to support by the UE." RaptorQ is RFC 6330 and is not referenced by TS 26.346. */ |
| 399 | +namespace { |
| 400 | + |
| 401 | +LibFlute::FecOti raptorq_oti() { |
| 402 | + LibFlute::FecOti oti{}; |
| 403 | + oti.encoding_id = LibFlute::FecScheme::RaptorQ; |
| 404 | + oti.encoding_symbol_length = 1200; |
| 405 | + oti.max_source_block_length = 64; |
| 406 | + return oti; |
| 407 | +} |
| 408 | + |
| 409 | +} // namespace |
| 410 | + |
| 411 | +TEST(ProfileFecSchemeTest, RaptorQRefusedUnderThe3gppProfiles) { |
| 412 | + boost::asio::io_context io; |
| 413 | + EXPECT_THROW( |
| 414 | + LibFlute::Transmitter("239.1.4.10", 5000, /*tsi*/ 1, /*mtu*/ 1400, /*rate_limit*/ 0, io, |
| 415 | + std::nullopt, LibFlute::FileDeliveryTable::FDT_NS_NONE, |
| 416 | + /*active*/ false, std::nullopt, raptorq_oti(), |
| 417 | + LibFlute::Profile::Ts26517), |
| 418 | + std::runtime_error); |
| 419 | +} |
| 420 | + |
| 421 | +TEST(ProfileFecSchemeTest, RaptorQAllowedOutsideThe3gppProfiles) { |
| 422 | + boost::asio::io_context io; |
| 423 | + EXPECT_NO_THROW( |
| 424 | + LibFlute::Transmitter("239.1.4.11", 5000, /*tsi*/ 1, /*mtu*/ 1400, /*rate_limit*/ 0, io, |
| 425 | + std::nullopt, LibFlute::FileDeliveryTable::FDT_NS_NONE, |
| 426 | + /*active*/ false, std::nullopt, raptorq_oti(), |
| 427 | + LibFlute::Profile::Unprofiled)); |
| 428 | +} |
| 429 | + |
| 430 | +TEST(ProfileFecSchemeTest, RaptorRemainsAvailableUnderThe3gppProfiles) { |
| 431 | + auto oti = raptorq_oti(); |
| 432 | + oti.encoding_id = LibFlute::FecScheme::Raptor; |
| 433 | + boost::asio::io_context io; |
| 434 | + EXPECT_NO_THROW( |
| 435 | + LibFlute::Transmitter("239.1.4.12", 5000, /*tsi*/ 1, /*mtu*/ 1400, /*rate_limit*/ 0, io, |
| 436 | + std::nullopt, LibFlute::FileDeliveryTable::FDT_NS_NONE, |
| 437 | + /*active*/ false, std::nullopt, oti, |
| 438 | + LibFlute::Profile::Ts26517)); |
| 439 | +} |
0 commit comments