-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add Dolby Vision integration tests (#6906)
Add test coverage for: - DASH: scte214:supplementalCodecs - HLS: SUPPLEMENTAL-CODECS - HLS detection of DV in media playlists Note: We use AV1 and HEVC to cover all browsers.
- Loading branch information
Showing
10 changed files
with
209 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
/*! @license | ||
* Shaka Player | ||
* Copyright 2016 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
describe('Player Dolby Vision', () => { | ||
const Util = shaka.test.Util; | ||
|
||
/** @type {!jasmine.Spy} */ | ||
let onErrorSpy; | ||
|
||
/** @type {!HTMLVideoElement} */ | ||
let video; | ||
/** @type {shaka.Player} */ | ||
let player; | ||
/** @type {!shaka.util.EventManager} */ | ||
let eventManager; | ||
|
||
let compiledShaka; | ||
|
||
/** @type {!shaka.test.Waiter} */ | ||
let waiter; | ||
|
||
beforeAll(async () => { | ||
video = shaka.test.UiUtils.createVideoElement(); | ||
document.body.appendChild(video); | ||
compiledShaka = | ||
await shaka.test.Loader.loadShaka(getClientArg('uncompiled')); | ||
}); | ||
|
||
beforeEach(async () => { | ||
await shaka.test.TestScheme.createManifests(compiledShaka, '_compiled'); | ||
player = new compiledShaka.Player(); | ||
await player.attach(video); | ||
|
||
player.configure('streaming.useNativeHlsOnSafari', false); | ||
|
||
// Disable stall detection, which can interfere with playback tests. | ||
player.configure('streaming.stallEnabled', false); | ||
|
||
// Grab event manager from the uncompiled library: | ||
eventManager = new shaka.util.EventManager(); | ||
waiter = new shaka.test.Waiter(eventManager); | ||
waiter.setPlayer(player); | ||
|
||
onErrorSpy = jasmine.createSpy('onError'); | ||
onErrorSpy.and.callFake((event) => fail(event.detail)); | ||
eventManager.listen(player, 'error', Util.spyFunc(onErrorSpy)); | ||
}); | ||
|
||
afterEach(async () => { | ||
eventManager.release(); | ||
await player.destroy(); | ||
}); | ||
|
||
afterAll(() => { | ||
document.body.removeChild(video); | ||
}); | ||
|
||
/** | ||
* @param {string} uri | ||
* @return {!Promise} | ||
*/ | ||
async function testPlayback(uri) { | ||
await player.load(uri); | ||
await video.play(); | ||
expect(player.isLive()).toBe(false); | ||
|
||
// Wait for the video to start playback. If it takes longer than 10 | ||
// seconds, fail the test. | ||
await waiter.waitForMovementOrFailOnTimeout(video, 10); | ||
|
||
// Play for 2 seconds, but stop early if the video ends. If it takes | ||
// longer than 10 seconds, fail the test. | ||
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 2, 10); | ||
|
||
await player.unload(); | ||
} | ||
|
||
describe('P8 with fallback to HEVC', () => { | ||
it('with DASH', async () => { | ||
if (!await Util.isTypeSupported('video/mp4; codecs="hvc1.2.4.L90.90"', | ||
/* width= */ 640, /* height= */ 360)) { | ||
pending('Codec HEVC is not supported by the platform.'); | ||
} | ||
await testPlayback('/base/test/test/assets/dv-p8-hevc/manifest.mpd'); | ||
}); | ||
|
||
it('with master playlist (HLS)', async () => { | ||
if (!await Util.isTypeSupported('video/mp4; codecs="hvc1.2.4.L90.90"', | ||
/* width= */ 640, /* height= */ 360)) { | ||
pending('Codec HEVC is not supported by the platform.'); | ||
} | ||
await testPlayback('/base/test/test/assets/dv-p8-hevc/master.m3u8'); | ||
}); | ||
|
||
it('with media playlist (HLS)', async () => { | ||
if (!await Util.isTypeSupported('video/mp4; codecs="hvc1.2.4.L90.90"', | ||
/* width= */ 640, /* height= */ 360)) { | ||
pending('Codec HEVC is not supported by the platform.'); | ||
} | ||
await testPlayback('/base/test/test/assets/dv-p8-hevc/media.m3u8'); | ||
}); | ||
}); | ||
|
||
describe('P10 with fallback to AV1', () => { | ||
it('with DASH', async () => { | ||
if (!await Util.isTypeSupported( | ||
'video/mp4; codecs="av01.0.04M.10.0.111.09.16.09.0"', | ||
/* width= */ 640, /* height= */ 360)) { | ||
pending('Codec AV1 is not supported by the platform.'); | ||
} | ||
await testPlayback('/base/test/test/assets/dv-p10-av1/manifest.mpd'); | ||
}); | ||
|
||
it('with master playlist (HLS)', async () => { | ||
if (!await Util.isTypeSupported( | ||
'video/mp4; codecs="av01.0.04M.10.0.111.09.16.09.0"', | ||
/* width= */ 640, /* height= */ 360)) { | ||
pending('Codec AV1 is not supported by the platform.'); | ||
} | ||
await testPlayback('/base/test/test/assets/dv-p10-av1/master.m3u8'); | ||
}); | ||
|
||
it('with media playlist (HLS)', async () => { | ||
if (!await Util.isTypeSupported( | ||
'video/mp4; codecs="av01.0.04M.10.0.111.09.16.09.0"', | ||
/* width= */ 640, /* height= */ 360)) { | ||
pending('Codec AV1 is not supported by the platform.'); | ||
} | ||
await testPlayback('/base/test/test/assets/dv-p10-av1/media.m3u8'); | ||
}); | ||
}); | ||
}); |
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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" xmlns:scte214="urn:scte:dash:scte214-extensions" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT6.022683S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="60000/1001" subsegmentAlignment="true" par="16:9"> | ||
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:MatrixCoefficients" value="9"/> | ||
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:ColourPrimaries" value="9"/> | ||
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:TransferCharacteristics" value="16"/> | ||
<Representation id="0" bandwidth="550702" codecs="av01.0.04M.10.0.111.09.16.09.0" mimeType="video/mp4" scte214:supplementalCodecs="dav1.10.01" scte214:supplementalProfiles="db1p" sar="1:1"> | ||
<BaseURL>dovi_10-video.mp4</BaseURL> | ||
<SegmentBase indexRange="871-926" timescale="60000"> | ||
<Initialization range="0-870"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</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,5 @@ | ||
#EXTM3U | ||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=550702,AVERAGE-BANDWIDTH=577484,CODECS="av01.0.04M.10.0.111.09.16.09.0",SUPPLEMENTAL-CODECS="dav1.10.01/db1p",RESOLUTION=640x360,FRAME-RATE=59.940,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE | ||
media.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,12 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
#EXT-X-TARGETDURATION:6 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="dovi_10-video.mp4",BYTERANGE="871@0" | ||
#EXTINF:5.355, | ||
#EXT-X-BYTERANGE:368650@927 | ||
dovi_10-video.mp4 | ||
#EXTINF:0.667, | ||
#EXT-X-BYTERANGE:66100 | ||
dovi_10-video.mp4 | ||
#EXT-X-ENDLIST |
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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" xmlns:scte214="urn:scte:dash:scte214-extensions" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT6.022683S"> | ||
<Period id="0"> | ||
<AdaptationSet id="0" contentType="video" width="640" height="360" frameRate="60000/1001" subsegmentAlignment="true" par="16:9"> | ||
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:MatrixCoefficients" value="9"/> | ||
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:ColourPrimaries" value="9"/> | ||
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:TransferCharacteristics" value="16"/> | ||
<Representation id="0" bandwidth="807837" codecs="hvc1.2.4.L90.90" mimeType="video/mp4" scte214:supplementalCodecs="dvh1.08.01" scte214:supplementalProfiles="db2g" sar="1:1"> | ||
<BaseURL>dovi_8-video.mp4</BaseURL> | ||
<SegmentBase indexRange="992-1071" timescale="60000"> | ||
<Initialization range="0-991"/> | ||
</SegmentBase> | ||
</Representation> | ||
</AdaptationSet> | ||
</Period> | ||
</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,5 @@ | ||
#EXTM3U | ||
#EXT-X-INDEPENDENT-SEGMENTS | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=807837,AVERAGE-BANDWIDTH=748074,CODECS="hvc1.2.4.L90.90",SUPPLEMENTAL-CODECS="dvh1.08.01/db2g",RESOLUTION=640x360,FRAME-RATE=59.940,VIDEO-RANGE=PQ,CLOSED-CAPTIONS=NONE | ||
media.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,18 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:6 | ||
#EXT-X-TARGETDURATION:3 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXT-X-MAP:URI="dovi_8-video.mp4",BYTERANGE="992@0" | ||
#EXTINF:2.002, | ||
#EXT-X-BYTERANGE:172013@1072 | ||
dovi_8-video.mp4 | ||
#EXTINF:2.002, | ||
#EXT-X-BYTERANGE:186781 | ||
dovi_8-video.mp4 | ||
#EXTINF:2.002, | ||
#EXT-X-BYTERANGE:202161 | ||
dovi_8-video.mp4 | ||
#EXTINF:0.017, | ||
#EXT-X-BYTERANGE:2221 | ||
dovi_8-video.mp4 | ||
#EXT-X-ENDLIST |