@@ -445,8 +445,37 @@ TEST_F(MixPresentationObuTest,
445445 EXPECT_FALSE (obu_->ValidateAndWriteObu (unused_wb).ok ());
446446}
447447
448+ TEST_F (MixPresentationObuTest, LiveLoudnessInfo) {
449+ sub_mixes_[0 ].layouts [0 ].loudness .info_type = LoudnessInfo::kLive ;
450+ sub_mixes_[0 ].layouts [0 ].loudness .layout_extension = {.info_type_bytes {}};
451+
452+ expected_header_ = {kObuIaMixPresentation << 3 , 46 };
453+ expected_payload_ = {
454+ // Start Mix OBU.
455+ 10 , 1 , ' e' , ' n' , ' -' , ' u' , ' s' , ' \0 ' , ' M' , ' i' , ' x' , ' ' , ' 1' , ' \0 ' , 1 ,
456+ // Start Submix 1
457+ 1 , 11 , ' S' , ' u' , ' b' , ' m' , ' i' , ' x' , ' ' , ' 1' , ' \0 ' ,
458+ // Start RenderingConfig.
459+ RenderingConfig::kHeadphonesRenderingModeStereo
460+ << kHeadphonesRenderingModeBitShift ,
461+ /* rendering_config_extension_size=*/ 0 ,
462+ // End RenderingConfig
463+ 12 , 13 , 0x80 , 0 , 14 , 15 , 16 , 0x80 , 0 , 17 , 1 ,
464+ // Start Layout 1 (of Submix 1).
465+ (Layout::kLayoutTypeLoudspeakersSsConvention
466+ << kHeadphonesRenderingModeBitShift ) |
467+ LoudspeakersSsConventionLayout::kSoundSystemA_0_2_0 ,
468+ LoudnessInfo::kLive , 0 , 18 , // integrated_loudness == 18 (16 bits).
469+ 0 , 19 , // digital_peak == 18 (16 bits).
470+ 0 // info_type_size == 0.
471+ // End Mix OBU.
472+ };
473+
474+ InitAndTestWrite ();
475+ }
476+
448477TEST_F (MixPresentationObuTest, ExtensionLayoutZero) {
449- sub_mixes_[0 ].layouts [0 ].loudness .info_type = 0x04 ;
478+ sub_mixes_[0 ].layouts [0 ].loudness .info_type = 0x80 ;
450479 sub_mixes_[0 ].layouts [0 ].loudness .layout_extension = {.info_type_bytes {}};
451480
452481 expected_header_ = {kObuIaMixPresentation << 3 , 46 };
@@ -465,7 +494,7 @@ TEST_F(MixPresentationObuTest, ExtensionLayoutZero) {
465494 (Layout::kLayoutTypeLoudspeakersSsConvention
466495 << kHeadphonesRenderingModeBitShift ) |
467496 LoudspeakersSsConventionLayout::kSoundSystemA_0_2_0 ,
468- 0x04 , 0 , 18 , 0 , 19 , 0
497+ 0x80 , 0 , 18 , 0 , 19 , 0
469498 // End Mix OBU.
470499 };
471500
@@ -474,7 +503,7 @@ TEST_F(MixPresentationObuTest, ExtensionLayoutZero) {
474503
475504TEST_F (MixPresentationObuTest, NonMinimalLebGeneratorAffectsAllLeb128s) {
476505 // Initialize a test has several `DecodedUleb128` explicitly in the bitstream.
477- sub_mixes_[0 ].layouts [0 ].loudness .info_type = 0x04 ;
506+ sub_mixes_[0 ].layouts [0 ].loudness .info_type = 0x80 ;
478507 sub_mixes_[0 ].layouts [0 ].loudness .layout_extension = {.info_type_bytes {}};
479508
480509 sub_mixes_[0 ].audio_elements [0 ].rendering_config = {
@@ -527,7 +556,7 @@ TEST_F(MixPresentationObuTest, NonMinimalLebGeneratorAffectsAllLeb128s) {
527556 (Layout::kLayoutTypeLoudspeakersSsConvention
528557 << kHeadphonesRenderingModeBitShift ) |
529558 LoudspeakersSsConventionLayout::kSoundSystemA_0_2_0 ,
530- 0x04 , 0 , 18 , 0 , 19 ,
559+ 0x80 , 0 , 18 , 0 , 19 ,
531560 // `info_type_size` is affected by the `LebGenerator`.
532561 0x80 | 0 , 0x00
533562 // End Mix OBU.
@@ -537,7 +566,7 @@ TEST_F(MixPresentationObuTest, NonMinimalLebGeneratorAffectsAllLeb128s) {
537566}
538567
539568TEST_F (MixPresentationObuTest, ExtensionLayoutNonZero) {
540- sub_mixes_[0 ].layouts [0 ].loudness .info_type = 0x04 ;
569+ sub_mixes_[0 ].layouts [0 ].loudness .info_type = 0x80 ;
541570 sub_mixes_[0 ].layouts [0 ].loudness .layout_extension = {
542571 .info_type_bytes {' e' , ' x' , ' t' , ' r' , ' a' }};
543572
@@ -557,7 +586,7 @@ TEST_F(MixPresentationObuTest, ExtensionLayoutNonZero) {
557586 (Layout::kLayoutTypeLoudspeakersSsConvention
558587 << kHeadphonesRenderingModeBitShift ) |
559588 LoudspeakersSsConventionLayout::kSoundSystemA_0_2_0 ,
560- 0x04 , 0 , 18 , 0 , 19 , 5 , ' e' , ' x' , ' t' , ' r' , ' a'
589+ 0x80 , 0 , 18 , 0 , 19 , 5 , ' e' , ' x' , ' t' , ' r' , ' a'
561590 // End Mix OBU.
562591 };
563592
0 commit comments