2018-09-13 20:04:55 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2018-05-31 12:32:51 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2022-01-27 20:09:56 +00:00
|
|
|
* https://w3c.github.io/media-capabilities/
|
2018-05-31 12:32:51 +00:00
|
|
|
*
|
|
|
|
* Copyright © 2018 the Contributors to the Media Capabilities Specification
|
|
|
|
*/
|
|
|
|
|
|
|
|
dictionary MediaConfiguration {
|
2018-09-26 19:19:47 +00:00
|
|
|
VideoConfiguration video;
|
|
|
|
AudioConfiguration audio;
|
2018-05-31 12:32:51 +00:00
|
|
|
};
|
|
|
|
|
2024-06-10 23:20:42 +00:00
|
|
|
// https://w3c.github.io/media-capabilities/#dictdef-mediaconfiguration
|
2018-05-31 12:32:51 +00:00
|
|
|
dictionary MediaDecodingConfiguration : MediaConfiguration {
|
|
|
|
required MediaDecodingType type;
|
2024-06-10 23:20:42 +00:00
|
|
|
MediaCapabilitiesKeySystemConfiguration keySystemConfiguration;
|
2018-05-31 12:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary MediaEncodingConfiguration : MediaConfiguration {
|
|
|
|
required MediaEncodingType type;
|
|
|
|
};
|
|
|
|
|
2024-06-10 23:20:42 +00:00
|
|
|
// https://w3c.github.io/media-capabilities/#mediacapabilitieskeysystemconfiguration
|
|
|
|
dictionary MediaCapabilitiesKeySystemConfiguration {
|
|
|
|
required DOMString keySystem;
|
|
|
|
DOMString initDataType = "";
|
|
|
|
MediaKeysRequirement distinctiveIdentifier = "optional";
|
|
|
|
MediaKeysRequirement persistentState = "optional";
|
|
|
|
sequence<DOMString> sessionTypes;
|
|
|
|
KeySystemTrackConfiguration audio;
|
|
|
|
KeySystemTrackConfiguration video;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary KeySystemTrackConfiguration {
|
|
|
|
DOMString robustness = "";
|
|
|
|
DOMString? encryptionScheme = null;
|
|
|
|
};
|
|
|
|
|
2018-05-31 12:32:51 +00:00
|
|
|
enum MediaDecodingType {
|
|
|
|
"file",
|
|
|
|
"media-source",
|
|
|
|
};
|
|
|
|
|
|
|
|
enum MediaEncodingType {
|
|
|
|
"record",
|
|
|
|
"transmission"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary VideoConfiguration {
|
2018-09-26 19:19:47 +00:00
|
|
|
required DOMString contentType;
|
|
|
|
required unsigned long width;
|
|
|
|
required unsigned long height;
|
|
|
|
required unsigned long long bitrate;
|
2022-02-16 13:36:54 +00:00
|
|
|
required double framerate;
|
2022-01-27 20:09:56 +00:00
|
|
|
boolean hasAlphaChannel;
|
|
|
|
HdrMetadataType hdrMetadataType;
|
|
|
|
ColorGamut colorGamut;
|
|
|
|
TransferFunction transferFunction;
|
|
|
|
DOMString scalabilityMode;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum HdrMetadataType {
|
|
|
|
"smpteSt2086",
|
|
|
|
"smpteSt2094-10",
|
|
|
|
"smpteSt2094-40"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ColorGamut {
|
|
|
|
"srgb",
|
|
|
|
"p3",
|
|
|
|
"rec2020"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum TransferFunction {
|
|
|
|
"srgb",
|
|
|
|
"pq",
|
|
|
|
"hlg"
|
2018-05-31 12:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary AudioConfiguration {
|
2018-09-26 19:19:47 +00:00
|
|
|
required DOMString contentType;
|
2018-05-31 12:32:51 +00:00
|
|
|
DOMString channels;
|
|
|
|
unsigned long long bitrate;
|
|
|
|
unsigned long samplerate;
|
|
|
|
};
|
|
|
|
|
2024-06-10 23:20:43 +00:00
|
|
|
dictionary MediaCapabilitiesInfo {
|
|
|
|
required boolean supported;
|
|
|
|
required boolean smooth;
|
|
|
|
required boolean powerEfficient;
|
2024-06-10 17:37:28 +00:00
|
|
|
};
|
|
|
|
|
2024-06-10 23:20:44 +00:00
|
|
|
// https://w3c.github.io/media-capabilities/#dictdef-mediacapabilitiesinfo
|
|
|
|
dictionary MediaCapabilitiesDecodingInfo : MediaCapabilitiesInfo {
|
|
|
|
// This doesn't match the spec, see https://github.com/w3c/media-capabilities/issues/219
|
|
|
|
required MediaKeySystemAccess? keySystemAccess;
|
|
|
|
// TODO : implement configuration
|
|
|
|
};
|
|
|
|
|
2024-06-10 23:20:43 +00:00
|
|
|
[Exposed=(Window, Worker)]
|
2018-05-31 12:32:51 +00:00
|
|
|
interface MediaCapabilities {
|
|
|
|
[NewObject]
|
2024-06-10 23:20:44 +00:00
|
|
|
Promise<MediaCapabilitiesDecodingInfo> decodingInfo(MediaDecodingConfiguration configuration);
|
2018-05-31 12:32:51 +00:00
|
|
|
[NewObject]
|
|
|
|
Promise<MediaCapabilitiesInfo> encodingInfo(MediaEncodingConfiguration configuration);
|
|
|
|
};
|