-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d88ed27
commit dc6196d
Showing
37 changed files
with
858 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+45.9 KB
packager/app/test/testdata/iamf-base-opus-mp4/bear-iamf-base-opus-audio.mp4
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#EXTM3U | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
|
||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_0.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="0" | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=136796,AVERAGE-BANDWIDTH=134443,CODECS="iamf.001.001.Opus",AUDIO="default-audio-group",CLOSED-CAPTIONS=NONE | ||
stream_0.m3u8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>--> | ||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.739958S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="audio" subsegmentAlignment="true"> | ||
<Representation id="0" bandwidth="136796" codecs="iamf.001.001.Opus" mimeType="audio/mp4" audioSamplingRate="0"> | ||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="0"/> | ||
<BaseURL>bear-iamf-base-opus-audio.mp4</BaseURL> | ||
<SegmentBase indexRange="892-959" timescale="48000"> | ||
<Initialization range="0-891"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</MPD> |
16 changes: 16 additions & 0 deletions
16
packager/app/test/testdata/iamf-base-opus-mp4/stream_0.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:2 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-iamf-base-opus-audio.mp4",BYTERANGE="892@0" | ||
#EXTINF:1.014, | ||
#EXT-X-BYTERANGE:16835@960 | ||
bear-iamf-base-opus-audio.mp4 | ||
#EXTINF:1.000, | ||
#EXT-X-BYTERANGE:16789 | ||
bear-iamf-base-opus-audio.mp4 | ||
#EXTINF:0.726, | ||
#EXT-X-BYTERANGE:12422 | ||
bear-iamf-base-opus-audio.mp4 | ||
#EXT-X-ENDLIST |
Binary file added
BIN
+604 KB
packager/app/test/testdata/iamf-base-pcm-mp4/bear-iamf-base-pcm-audio.mp4
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#EXTM3U | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
|
||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_0.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="0" | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=2177226,AVERAGE-BANDWIDTH=1803234,CODECS="iamf.001.001.ipcm",AUDIO="default-audio-group",CLOSED-CAPTIONS=NONE | ||
stream_0.m3u8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>--> | ||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.739958S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="audio" subsegmentAlignment="true"> | ||
<Representation id="0" bandwidth="2177226" codecs="iamf.001.001.ipcm" mimeType="audio/mp4" audioSamplingRate="0"> | ||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="0"/> | ||
<BaseURL>bear-iamf-base-pcm-audio.mp4</BaseURL> | ||
<SegmentBase indexRange="850-917" timescale="48000"> | ||
<Initialization range="0-849"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</MPD> |
16 changes: 16 additions & 0 deletions
16
packager/app/test/testdata/iamf-base-pcm-mp4/stream_0.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:1 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-iamf-base-pcm-audio.mp4",BYTERANGE="850@0" | ||
#EXTINF:1.000, | ||
#EXT-X-BYTERANGE:208108@918 | ||
bear-iamf-base-pcm-audio.mp4 | ||
#EXTINF:1.000, | ||
#EXT-X-BYTERANGE:208108 | ||
bear-iamf-base-pcm-audio.mp4 | ||
#EXTINF:0.740, | ||
#EXT-X-BYTERANGE:201382 | ||
bear-iamf-base-pcm-audio.mp4 | ||
#EXT-X-ENDLIST |
Binary file added
BIN
+199 KB
packager/app/test/testdata/iamf-simple-aac-lc-mp4/bear-iamf-simple-aac-lc-audio.mp4
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
packager/app/test/testdata/iamf-simple-aac-lc-mp4/output.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#EXTM3U | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
|
||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_0.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="0" | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=604125,AVERAGE-BANDWIDTH=590976,CODECS="iamf.000.000.mp4a.40.2",AUDIO="default-audio-group",CLOSED-CAPTIONS=NONE | ||
stream_0.m3u8 |
15 changes: 15 additions & 0 deletions
15
packager/app/test/testdata/iamf-simple-aac-lc-mp4/output.mpd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>--> | ||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.739958S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="audio" subsegmentAlignment="true"> | ||
<Representation id="0" bandwidth="604125" codecs="iamf.000.000.mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="0"> | ||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="0"/> | ||
<BaseURL>bear-iamf-simple-aac-lc-audio.mp4</BaseURL> | ||
<SegmentBase indexRange="900-967" timescale="48000"> | ||
<Initialization range="0-899"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</MPD> |
16 changes: 16 additions & 0 deletions
16
packager/app/test/testdata/iamf-simple-aac-lc-mp4/stream_0.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:2 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-iamf-simple-aac-lc-audio.mp4",BYTERANGE="900@0" | ||
#EXTINF:1.003, | ||
#EXT-X-BYTERANGE:75717@968 | ||
bear-iamf-simple-aac-lc-audio.mp4 | ||
#EXTINF:1.003, | ||
#EXT-X-BYTERANGE:72441 | ||
bear-iamf-simple-aac-lc-audio.mp4 | ||
#EXTINF:0.735, | ||
#EXT-X-BYTERANGE:54248 | ||
bear-iamf-simple-aac-lc-audio.mp4 | ||
#EXT-X-ENDLIST |
Binary file added
BIN
+311 KB
packager/app/test/testdata/iamf-simple-flac-mp4/bear-iamf-simple-flac-audio.mp4
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#EXTM3U | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
|
||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_0.m3u8",GROUP-ID="default-audio-group",NAME="stream_0",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="0" | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=977240,AVERAGE-BANDWIDTH=926327,CODECS="iamf.000.000.fLaC",AUDIO="default-audio-group",CLOSED-CAPTIONS=NONE | ||
stream_0.m3u8 |
15 changes: 15 additions & 0 deletions
15
packager/app/test/testdata/iamf-simple-flac-mp4/output.mpd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test>--> | ||
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT2.739958S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="audio" subsegmentAlignment="true"> | ||
<Representation id="0" bandwidth="977240" codecs="iamf.000.000.fLaC" mimeType="audio/mp4" audioSamplingRate="0"> | ||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="0"/> | ||
<BaseURL>bear-iamf-simple-flac-audio.mp4</BaseURL> | ||
<SegmentBase indexRange="883-950" timescale="48000"> | ||
<Initialization range="0-882"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</MPD> |
16 changes: 16 additions & 0 deletions
16
packager/app/test/testdata/iamf-simple-flac-mp4/stream_0.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
## Generated with https://github.com/shaka-project/shaka-packager version <tag>-<hash>-<test> | ||
#EXT-X-TARGETDURATION:1 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="bear-iamf-simple-flac-audio.mp4",BYTERANGE="883@0" | ||
#EXTINF:1.000, | ||
#EXT-X-BYTERANGE:116763@951 | ||
bear-iamf-simple-flac-audio.mp4 | ||
#EXTINF:1.000, | ||
#EXT-X-BYTERANGE:122155 | ||
bear-iamf-simple-flac-audio.mp4 | ||
#EXTINF:0.740, | ||
#EXT-X-BYTERANGE:78344 | ||
bear-iamf-simple-flac-audio.mp4 | ||
#EXT-X-ENDLIST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright 2024 Google LLC. All rights reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file or at | ||
// https://developers.google.com/open-source/licenses/bsd | ||
|
||
#include <packager/media/base/audio_stream_info.h> | ||
|
||
#include <gtest/gtest.h> | ||
|
||
namespace shaka { | ||
namespace media { | ||
|
||
const int kSimpleProfile = 0; | ||
const int kBaseProfile = 1; | ||
|
||
TEST(AudioStreamInfo, IamfGetCodecStringForSimpleProfilesAndPcm) { | ||
const uint8_t audio_object_type = | ||
((kSimpleProfile << 6) | // primary_profile | ||
((kSimpleProfile << 4) & 0x3F) | // additional_profile | ||
((kCodecPcm - kCodecAudio) & 0xF)); // IAMF codec | ||
|
||
std::string codec_string = | ||
AudioStreamInfo::GetCodecString(kCodecIAMF, audio_object_type); | ||
EXPECT_EQ("iamf.000.000.ipcm", codec_string); | ||
} | ||
|
||
TEST(AudioStreamInfo, IamfGetCodecStringForSimpleProfilesAndOpus) { | ||
const uint8_t audio_object_type = | ||
((kSimpleProfile << 6) | // primary_profile | ||
((kSimpleProfile << 4) & 0x3F) | // additional_profile | ||
((kCodecOpus - kCodecAudio) & 0xF)); // IAMF codec | ||
|
||
std::string codec_string = | ||
AudioStreamInfo::GetCodecString(kCodecIAMF, audio_object_type); | ||
EXPECT_EQ("iamf.000.000.Opus", codec_string); | ||
} | ||
|
||
TEST(AudioStreamInfo, IamfGetCodecStringForSimpleProfilesAndMp4a) { | ||
const uint8_t audio_object_type = | ||
((kSimpleProfile << 6) | // primary_profile | ||
((kSimpleProfile << 4) & 0x3F) | // additional_profile | ||
((kCodecAAC - kCodecAudio) & 0xF)); // IAMF codec | ||
|
||
std::string codec_string = | ||
AudioStreamInfo::GetCodecString(kCodecIAMF, audio_object_type); | ||
EXPECT_EQ("iamf.000.000.mp4a.40.2", codec_string); | ||
} | ||
|
||
TEST(AudioStreamInfo, IamfGetCodecStringForSimpleProfilesAndFlac) { | ||
const uint8_t audio_object_type = | ||
((kSimpleProfile << 6) | // primary_profile | ||
((kSimpleProfile << 4) & 0x3F) | // additional_profile | ||
((kCodecFlac - kCodecAudio) & 0xF)); // IAMF codec | ||
|
||
std::string codec_string = | ||
AudioStreamInfo::GetCodecString(kCodecIAMF, audio_object_type); | ||
EXPECT_EQ("iamf.000.000.fLaC", codec_string); | ||
} | ||
|
||
TEST(AudioStreamInfo, IamfGetCodecStringForBaseProfilesAndPcm) { | ||
const uint8_t audio_object_type = | ||
((kBaseProfile << 6) | // primary_profile = 1 | ||
((kBaseProfile << 4) & 0x3F) | // additional_profile = 1 | ||
((kCodecPcm - kCodecAudio) & 0xF)); // IAMF codec | ||
|
||
std::string codec_string = | ||
AudioStreamInfo::GetCodecString(kCodecIAMF, audio_object_type); | ||
EXPECT_EQ("iamf.001.001.ipcm", codec_string); | ||
} | ||
|
||
} // namespace media | ||
} // namespace shaka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.