Home | History | Annotate | Download | only in 1.1
      1 /**
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.hardware.drm@1.1;
     18 
     19 import @1.0::KeyRequestType;
     20 
     21 /**
     22  * This message contains plugin-specific metrics made available to the client.
     23  * The message is used for making vendor-specific metrics available to an
     24  * application. The framework is not consuming any of the information.
     25  *
     26  * Metrics are grouped in instances of DrmMetricGroup. Each group contains
     27  * multiple instances of Metric.
     28  *
     29  * Example:
     30  *
     31  * Capture the timing information of a buffer copy event, "buf_copy", broken
     32  * out by the "size" of the buffer.
     33  *
     34  * DrmMetricGroup {
     35  *   metrics[0] {
     36  *     name: "buf_copy"
     37  *     attributes[0] {
     38  *       name: "size"
     39  *       type: INT64_TYPE
     40  *       int64Value: 1024
     41  *     }
     42  *     values[0] {
     43  *       componentName: "operation_count"
     44  *       type: INT64_TYPE
     45  *       int64Value: 75
     46  *     }
     47  *     values[1] {
     48  *       component_name: "average_time_seconds"
     49  *       type: DOUBLE_TYPE
     50  *       doubleValue: 0.00000042
     51  *     }
     52  *   }
     53  * }
     54  */
     55 struct DrmMetricGroup {
     56     /**
     57      * Used to discriminate the type of value being stored in the structs
     58      * below.
     59      */
     60     enum ValueType : uint8_t {
     61         INT64_TYPE,
     62         DOUBLE_TYPE,
     63         STRING_TYPE,
     64     };
     65 
     66     /**
     67      * A detail about the metric being captured. The fields of an Attribute
     68      * are opaque to the framework.
     69      */
     70     struct Attribute {
     71         string name;
     72         /**
     73          * The type field indicates which of the following values is used.
     74          */
     75         ValueType type;
     76         int64_t int64Value;
     77         double doubleValue;
     78         string stringValue;
     79     };
     80 
     81     /**
     82      * A value of the metric. A metric may have multiple values. The
     83      * component name may be left empty if there is only supposed to be
     84      * one value for the given metric. The fields of the Value are
     85      * opaque to the framework.
     86      */
     87     struct Value {
     88         string componentName;
     89         /**
     90          * The type field indicates which of the following values is used.
     91          */
     92         ValueType type;
     93         int64_t int64Value;
     94         double doubleValue;
     95         string stringValue;
     96     };
     97 
     98     /**
     99      * The metric being captured. A metric must have a name and at least one
    100      * value. A metric may have 0 or more attributes. The fields of a Metric
    101      * are opaque to the framework.
    102      */
    103     struct Metric {
    104         string name;
    105         vec<Attribute> attributes;
    106         // A Metric may have one or more values. Multiple values are useful
    107         // for capturing different aspects of the same metric. E.g. capture
    108         // the min, max, average, count, and stdev of a particular metric.
    109         vec<Value> values;
    110     };
    111 
    112     /**
    113      * The list of metrics to be captured.
    114      */
    115     vec<Metric> metrics;
    116 };
    117 
    118 /**
    119  * HDCP specifications are defined by Digital Content Protection LLC (DCP).
    120  *   "HDCP Specification Rev. 2.2 Interface Independent Adaptation"
    121  *   "HDCP 2.2 on HDMI Specification"
    122  */
    123 enum HdcpLevel : uint32_t {
    124     /**
    125      * Unable to determine the HDCP level
    126      */
    127     HDCP_UNKNOWN,
    128 
    129     /**
    130      * No HDCP, output is unprotected
    131      */
    132     HDCP_NONE,
    133 
    134     /**
    135      * HDCP version 1.0
    136      */
    137     HDCP_V1,
    138 
    139     /**
    140      * HDCP version 2.0 Type 1.
    141      */
    142     HDCP_V2,
    143 
    144     /**
    145      * HDCP version 2.1 Type 1.
    146      */
    147     HDCP_V2_1,
    148 
    149     /**
    150      *  HDCP version 2.2 Type 1.
    151      */
    152     HDCP_V2_2,
    153 
    154     /**
    155      * No digital output, implicitly secure
    156      */
    157     HDCP_NO_OUTPUT
    158 };
    159 
    160 /**
    161  * KeyRequestTypes (in addition to those from 1.0) which allow an app
    162  * to determine the type of a key request returned from getKeyRequest.
    163  */
    164 enum KeyRequestType : @1.0::KeyRequestType {
    165     /**
    166      * Keys are already loaded. No key request is needed.
    167      */
    168     NONE,
    169 
    170     /**
    171      * Keys have previously been loaded. An additional (non-renewal) license
    172      * request is needed.
    173      */
    174     UPDATE,
    175 };
    176 
    177 enum SecurityLevel : uint32_t {
    178     /**
    179      * Unable to determine the security level
    180      */
    181     UNKNOWN,
    182 
    183     /**
    184      * Software-based whitebox crypto
    185      */
    186     SW_SECURE_CRYPTO,
    187 
    188     /**
    189      * Software-based whitebox crypto and an obfuscated decoder
    190      */
    191     SW_SECURE_DECODE,
    192 
    193     /**
    194      * DRM key management and crypto operations are performed within a
    195      * hardware backed trusted execution environment
    196      */
    197     HW_SECURE_CRYPTO,
    198 
    199     /**
    200      * DRM key management, crypto operations and decoding of content
    201      * are performed within a hardware backed trusted execution environment
    202      */
    203     HW_SECURE_DECODE,
    204 
    205     /**
    206      * DRM key management, crypto operations, decoding of content and all
    207      * handling of the media (compressed and uncompressed) is handled within
    208      * a hardware backed trusted execution environment.
    209      */
    210     HW_SECURE_ALL,
    211 };
    212 
    213 /**
    214  * Encapsulates a secure stop release opaque object
    215  */
    216 struct SecureStopRelease {
    217     vec<uint8_t> opaqueData;
    218 };
    219 
    220