1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WebMediaKeySystemConfiguration_h
6 #define WebMediaKeySystemConfiguration_h
8 #include "public/platform/WebEncryptedMediaTypes.h"
9 #include "public/platform/WebMediaKeySystemMediaCapability.h"
10 #include "public/platform/WebVector.h"
14 struct WebMediaKeySystemConfiguration
{
15 enum class Requirement
{
21 // As MediaKeySystemConfiguration is a dictionary, some members may be
22 // not-present. Because requestMediaKeySystemAccess() distinguishes empty
23 // from not-present, we require a presence flag for each member.
24 bool hasInitDataTypes
= false;
25 WebVector
<WebEncryptedMediaInitDataType
> initDataTypes
;
27 bool hasAudioCapabilities
= false;
28 WebVector
<WebMediaKeySystemMediaCapability
> audioCapabilities
;
30 bool hasVideoCapabilities
= false;
31 WebVector
<WebMediaKeySystemMediaCapability
> videoCapabilities
;
33 // |distinctiveIdentifier| and |persistentState| are always present because
34 // they have default values.
35 Requirement distinctiveIdentifier
= Requirement::Optional
;
36 Requirement persistentState
= Requirement::Optional
;
38 bool hasSessionTypes
= false;
39 WebVector
<WebEncryptedMediaSessionType
> sessionTypes
;
41 // |label| may be not-present, but we use a null string to represent that.
47 #endif // WebMediaKeySystemConfiguration_h