Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NPLB tests for cast codecs. #2104

Merged
merged 12 commits into from
Mar 26, 2024
36 changes: 26 additions & 10 deletions starboard/nplb/player_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,36 @@ using std::placeholders::_3;
using std::placeholders::_4;
using testing::FakeGraphicsContextProvider;

const char* kAudioTestFiles[] = {"beneath_the_canopy_aac_stereo.dmp",
"beneath_the_canopy_opus_stereo.dmp",
"sintel_329_ec3.dmp", "sintel_381_ac3.dmp"};
const char* kAudioTestFiles[] = {
"beneath_the_canopy_aac_stereo.dmp",
"beneath_the_canopy_opus_stereo.dmp",
"sintel_329_ec3.dmp",
"sintel_381_ac3.dmp",
};

// For uncommon audio formats, we add audio only tests, without tests combined
// with a video stream, to shorten the overall test time.
const char* kAudioOnlyTestFiles[] = {
"beneath_the_canopy_aac_5_1.dmp", "beneath_the_canopy_aac_mono.dmp",
"beneath_the_canopy_opus_5_1.dmp", "beneath_the_canopy_opus_mono.dmp",
"heaac.dmp"};

const char* kVideoTestFiles[] = {"beneath_the_canopy_137_avc.dmp",
"beneath_the_canopy_248_vp9.dmp",
"sintel_399_av1.dmp"};
"beneath_the_canopy_aac_5_1.dmp",
"beneath_the_canopy_aac_mono.dmp",
"beneath_the_canopy_opus_5_1.dmp",
"beneath_the_canopy_opus_mono.dmp",
"heaac.dmp",
#if SB_API_VERSION >= 14
"sintel_5s_flac.dmp",
"sintel_5s_mp3.dmp",
"sintel_5s_pcm_s16le.dmp",
#endif // SB_API_VERSION >= 14
"sintel_5s_vorbis.dmp",
};

const char* kVideoTestFiles[] = {
"beneath_the_canopy_137_avc.dmp",
"beneath_the_canopy_248_vp9.dmp",
"sintel_399_av1.dmp",
"sintel_5s_vp8.dmp",
"sintel_5s_hevc.dmp",
};

const SbPlayerOutputMode kOutputModes[] = {kSbPlayerOutputModeDecodeToTexture,
kSbPlayerOutputModePunchOut};
Expand Down
12 changes: 7 additions & 5 deletions starboard/shared/starboard/player/testdata/licences/README
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Test Data License

"sintel_329_ec3.dmp", "sintel_381_ac3.dmp" and "sintel_399_av1.dmp" are included
as test files, under the Creative Commons 3.0 Attribution license. "Sintel" is
an independently produced short film, initiated by the Blender Foundation as a
means to further improve and validate the free/open source 3D creation suite
Blender.
"sintel_329_ec3.dmp", "sintel_381_ac3.dmp", "sintel_399_av1.dmp",
"sintel_5s_flac.dmp", "sintel_5s_hevc.dmp", "sintel_5s_mp3.dmp",
"sintel_5s_pcm_s16le.dmp", "sintel_5s_vorbis.dmp", and "sintel_5s_vp8.dmp" are
included as test files, under the Creative Commons 3.0 Attribution license.
"Sintel" is an independently produced short film, initiated by the Blender
Foundation as a means to further improve and validate the free/open source 3D
creation suite Blender.

Sintel © copyright Blender Foundation | durian.blender.org
6 changes: 6 additions & 0 deletions starboard/shared/starboard/player/testdata/sha1_files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ sha1_files = [
"sintel_329_ec3.dmp.sha1",
"sintel_381_ac3.dmp.sha1",
"sintel_399_av1.dmp.sha1",
"sintel_5s_flac.dmp.sha1",
"sintel_5s_hevc.dmp.sha1",
"sintel_5s_mp3.dmp.sha1",
"sintel_5s_pcm_s16le.dmp.sha1",
"sintel_5s_vorbis.dmp.sha1",
"sintel_5s_vp8.dmp.sha1",
"vertical_4k_30_fps_313_vp9.dmp.sha1",
"vertical_8k_30_fps_571_av1.dmp.sha1",
"vertical_1080p_30_fps_137_avc.dmp.sha1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
51bb41dc8a9ff8fc1c98e2e142b454e5b372b19a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ed556cdaf9ebbc551a2df329118f8d284b549786
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b695568bfbda4883d1349b4f16da003d8f235ad0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
efec3b1eea57a3001c77517ce20bd8bbdd82973c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
62f5c2d1a6c56ea8fbeb7665ea2aaff23d327d8b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
58b500e3a6d2ccda0bdfd2e2af5a3193b38d9847
24 changes: 22 additions & 2 deletions starboard/shared/starboard/player/video_dmp_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,22 @@
case kSbMediaAudioCodecEac3:
ss << "audio/mp4; codecs=\"ec-3\";";
break;
case kSbMediaAudioCodecVorbis:
ss << "audio/webm; codecs=\"vorbis\";";
break;
#if SB_API_VERSION >= 14

Check warning on line 156 in starboard/shared/starboard/player/video_dmp_reader.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/video_dmp_reader.cc#L156

Added line #L156 was not covered by tests
case kSbMediaAudioCodecMp3:
ss << "audio/mpeg; codecs=\"mp3\";";
break;
case kSbMediaAudioCodecFlac:
ss << "audio/ogg; codecs=\"flac\";";
break;
case kSbMediaAudioCodecPcm:
ss << "audio/wav; codecs=\"1\";";
break;
#endif // SB_API_VERSION >= 14

Check warning on line 166 in starboard/shared/starboard/player/video_dmp_reader.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/video_dmp_reader.cc#L166

Added line #L166 was not covered by tests
default:
SB_NOTREACHED();
SB_NOTREACHED() << "Unsupported audio codec: " << dmp_info_.audio_codec;

Check warning on line 168 in starboard/shared/starboard/player/video_dmp_reader.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/video_dmp_reader.cc#L168

Added line #L168 was not covered by tests
}

ss << " channels="
Expand All @@ -175,8 +189,14 @@
case kSbMediaVideoCodecAv1:
ss << "video/mp4; codecs=\"av01.0.08M.08\";";
break;
case kSbMediaVideoCodecVp8:
ss << "video/webm; codecs=\"vp8\";";
break;
case kSbMediaVideoCodecH265:
ss << "video/mp4; codecs=\"hev1.1.6.L123.B0\";";
break;
default:
SB_NOTREACHED();
SB_NOTREACHED() << "Unsupported video codec: " << dmp_info_.video_codec;

Check warning on line 199 in starboard/shared/starboard/player/video_dmp_reader.cc

View check run for this annotation

Codecov / codecov/patch

starboard/shared/starboard/player/video_dmp_reader.cc#L199

Added line #L199 was not covered by tests
}
if (number_of_video_buffers() > 0) {
const auto& video_stream_info = this->video_stream_info();
Expand Down
Loading