зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1207019 - Make EME mochitests specify mime types for video in MediaKeys request videoTypes, ditto for audio. r=gerald
This commit is contained in:
Родитель
d4ed7efef9
Коммит
a7e012482a
|
@ -332,6 +332,11 @@ function SetupEME(test, token, params)
|
|||
});
|
||||
}
|
||||
|
||||
function streamType(type) {
|
||||
var x = test.tracks.find(o => o.name == type);
|
||||
return x ? x.type : undefined;
|
||||
}
|
||||
|
||||
// All 'initDataType's should be the same.
|
||||
// null indicates no 'encrypted' event received yet.
|
||||
var initDataType = null;
|
||||
|
@ -353,8 +358,8 @@ function SetupEME(test, token, params)
|
|||
var options = [
|
||||
{
|
||||
initDataType: ev.initDataType,
|
||||
videoType: test.type,
|
||||
audioType: test.type,
|
||||
videoType: streamType("video"),
|
||||
audioType: streamType("audio"),
|
||||
}
|
||||
];
|
||||
var p = navigator.requestMediaKeySystemAccess(KEYSYSTEM_TYPE, options);
|
||||
|
|
|
@ -792,7 +792,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"400x300 audio&video tracks, each with its key",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -824,7 +823,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480@624kbps audio&video tracks, each with its key",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -856,7 +854,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480@959kbps audio&video tracks, each with its key",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -888,7 +885,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480 then 400x300, same key (1st) per track",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -921,7 +917,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480 then 400x300, same key (2nd) per track",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -954,7 +949,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480 with 1st keys then 400x300 with 2nd keys",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -988,7 +982,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"400x300 with 1st keys then 640x480 with 2nd keys",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1022,7 +1015,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480@959kbps with 1st keys then 640x480@624kbps with 2nd keys",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1056,7 +1048,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x480@624kbps with 1st keys then 640x480@959kbps with 2nd keys",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1090,7 +1081,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"400x300 with presentation size 533x300",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1122,7 +1112,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"400x300 as-is then 400x300 presented as 533x300",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1156,7 +1145,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"400x225",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1187,7 +1175,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x360",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1218,7 +1205,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"400x225 then 640x360",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1252,7 +1238,6 @@ var gEMETests = [
|
|||
},
|
||||
{
|
||||
name:"640x360 then 640x480",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
tracks: [
|
||||
{
|
||||
name:"audio",
|
||||
|
@ -1289,7 +1274,8 @@ var gEMETests = [
|
|||
var gEMENonMSEFailTests = [
|
||||
{
|
||||
name:"short-cenc.mp4",
|
||||
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
|
||||
audioType:"audio/mp4; codecs=\"mp4a.40.2\"",
|
||||
videoType:"video/mp4; codecs=\"avc1.64000d\"",
|
||||
duration:0.47,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -69,6 +69,8 @@ function check_mp4(v, enabled) {
|
|||
check("audio/x-m4a; codecs=\"mp4a.40.2\"", "probably");
|
||||
check("audio/x-m4a; codecs=mp4a.40.2", "probably");
|
||||
|
||||
check("audio/mp4; codecs=\"mp4a.40.2,\"", ""); // Invalid codecs string
|
||||
|
||||
// HE-AAC v1
|
||||
check("audio/mp4; codecs=\"mp4a.40.5\"", "probably");
|
||||
check("audio/mp4; codecs=mp4a.40.5", "probably");
|
||||
|
|
|
@ -12,11 +12,12 @@
|
|||
<script class="testbody" type="text/javascript">
|
||||
var manager = new MediaTestManager;
|
||||
|
||||
function DoSetMediaKeys(v)
|
||||
function DoSetMediaKeys(v, test)
|
||||
{
|
||||
var options = [{
|
||||
initDataType: "cenc",
|
||||
videoType: test.type,
|
||||
audioType: test.audioType,
|
||||
videoType: test.videoType,
|
||||
}];
|
||||
|
||||
return navigator.requestMediaKeySystemAccess("org.w3.clearkey", options)
|
||||
|
@ -68,7 +69,7 @@ function TestSetSrc(test, token)
|
|||
manager.finished(token);
|
||||
});
|
||||
|
||||
DoSetMediaKeys(v)
|
||||
DoSetMediaKeys(v, test)
|
||||
|
||||
.then(function() {
|
||||
v.src = test.name;
|
||||
|
|
|
@ -202,12 +202,23 @@ var tests = [
|
|||
shouldPass: false,
|
||||
},
|
||||
{
|
||||
name: 'MP4 video container with mp3 and h264 is unsupported',
|
||||
name: 'MP4 video container type with an audio codec is unsupported',
|
||||
keySystem: CLEARKEY_ID,
|
||||
options: [
|
||||
{
|
||||
initDataType: 'cenc',
|
||||
videoType: 'video/mp4; codecs="avc1.42E01E,mp3"',
|
||||
videoType: 'video/mp4; codecs="mp3"',
|
||||
}
|
||||
],
|
||||
shouldPass: false,
|
||||
},
|
||||
{
|
||||
name: 'MP4 audio container type with a video codec is unsupported',
|
||||
keySystem: CLEARKEY_ID,
|
||||
options: [
|
||||
{
|
||||
initDataType: 'cenc',
|
||||
audioType: 'audio/mp4; codecs="avc1.42E01E"',
|
||||
}
|
||||
],
|
||||
shouldPass: false,
|
||||
|
@ -218,7 +229,7 @@ var tests = [
|
|||
options: [
|
||||
{
|
||||
initDataType: 'cenc',
|
||||
audioType: 'video/mp4; codecs="avc1.42E01E"',
|
||||
videoType: 'video/mp4; codecs="avc1.42E01E"',
|
||||
}
|
||||
],
|
||||
shouldPass: true,
|
||||
|
@ -235,7 +246,7 @@ var tests = [
|
|||
shouldPass: false,
|
||||
},
|
||||
{
|
||||
name: 'MP4 video container with constrained baseline h.264 and AAC-LC',
|
||||
name: 'MP4 video container with both audio and video codec type in videoType',
|
||||
keySystem: CLEARKEY_ID,
|
||||
options: [
|
||||
{
|
||||
|
@ -243,7 +254,7 @@ var tests = [
|
|||
videoType: 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"',
|
||||
}
|
||||
],
|
||||
shouldPass: true,
|
||||
shouldPass: false,
|
||||
},
|
||||
{
|
||||
name: 'MP4 audio and video type both specified',
|
||||
|
|
Загрузка…
Ссылка в новой задаче