OLD | NEW |
(Empty) | |
| 1 /* Copyright 2013 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. |
| 4 */ |
| 5 |
| 6 /** |
| 7 * This file defines the API for output protection. Currently, it only supports |
| 8 * Chrome OS. |
| 9 */ |
| 10 |
| 11 [generate_thunk] |
| 12 |
| 13 label Chrome { |
| 14 M31 = 0.1 |
| 15 }; |
| 16 |
| 17 /** |
| 18 * Content protection methods applied on video output link. |
| 19 */ |
| 20 [assert_size(4)] enum PP_OutputProtectionMethod_Private { |
| 21 PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE = 0, |
| 22 PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP = 1 << 0 |
| 23 }; |
| 24 |
| 25 /** |
| 26 * Video output link types. |
| 27 */ |
| 28 [assert_size(4)] enum PP_OutputProtectionLinkType_Private { |
| 29 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_NONE = 0, |
| 30 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_UNKNOWN = 1 << 0, |
| 31 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_INTERNAL = 1 << 1, |
| 32 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_VGA = 1 << 2, |
| 33 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI = 1 << 3, |
| 34 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DVI = 1 << 4, |
| 35 PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_DISPLAYPORT = 1 << 5 |
| 36 }; |
| 37 |
| 38 /** |
| 39 * The <code>PPB_OutputProtection_Private</code> interface allows controlling |
| 40 * output protection. |
| 41 * |
| 42 * <strong>Example:</strong> |
| 43 * |
| 44 * @code |
| 45 * op = output_protection->Create(instance); |
| 46 * output_protection->QueryStatus(op, &link_mask, &protection_mask, |
| 47 * done_callback); |
| 48 * @endcode |
| 49 * |
| 50 * In this example, the plugin wants to enforce HDCP for HDMI link. |
| 51 * @code |
| 52 * if (link_mask & PP_OUTPUT_PROTECTION_LINK_TYPE_PRIVATE_HDMI) { |
| 53 * output_protection->EnableProtection( |
| 54 * op, PP_OUTPUT_PROTECTION_METHOD_PRIVATE_HDCP, done_callback); |
| 55 * } |
| 56 * @endcode |
| 57 * |
| 58 * After EnableProtection() completes, the plugin has to query protection |
| 59 * status periodically to make sure the protection is enabled and remains |
| 60 * enabled. |
| 61 */ |
| 62 interface PPB_OutputProtection_Private { |
| 63 /** |
| 64 * Create() creates a new <code>PPB_OutputProtection_Private</code> object. |
| 65 * |
| 66 * @pram[in] instance A <code>PP_Instance</code> identifying one instance of |
| 67 * a module. |
| 68 * |
| 69 * @return A <code>PP_Resource</code> corresponding to a |
| 70 * <code>PPB_OutputProtection_Private</code> if successful, 0 if creation |
| 71 * failed. |
| 72 */ |
| 73 PP_Resource Create([in] PP_Instance instance); |
| 74 |
| 75 /** |
| 76 * IsOutputProtection() determines if the provided resource is a |
| 77 * <code>PPB_OutputProtection_Private</code>. |
| 78 * |
| 79 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 80 * <code>PPB_OutputProtection_Private</code>. |
| 81 * |
| 82 * @return <code>PP_TRUE</code> if the resource is a |
| 83 * <code>PPB_OutputProtection_Private</code>, <code>PP_FALSE</code> if the |
| 84 * resource is invalid or some type other than |
| 85 * <code>PPB_OutputProtection_Private</code>. |
| 86 */ |
| 87 PP_Bool IsOutputProtection([in] PP_Resource resource); |
| 88 |
| 89 /** |
| 90 * Query link status and protection status. |
| 91 * Clients have to query status periodically in order to detect changes. |
| 92 * |
| 93 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 94 * <code>PPB_OutputProtection_Private</code>. |
| 95 * @param[out] link_mask The type of connected output links, which is a |
| 96 * bit-mask of the <code>PP_OutputProtectionLinkType_Private</code> values. |
| 97 * @param[out] protection_mask Enabled protection methods, which is a |
| 98 * bit-mask of the <code>PP_OutputProtectionMethod_Private</code> values. |
| 99 * @param[in] callback A <code>PP_CompletionCallback</code> to run on |
| 100 * asynchronous completion of QueryStatus(). This callback will only run if |
| 101 * QueryStatus() returns <code>PP_OK_COMPLETIONPENDING</code>. |
| 102 * |
| 103 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 104 */ |
| 105 int32_t QueryStatus( |
| 106 [in] PP_Resource resource, |
| 107 [out] uint32_t link_mask, |
| 108 [out] uint32_t protection_mask, |
| 109 [in] PP_CompletionCallback callback); |
| 110 |
| 111 /** |
| 112 * Set desired protection methods. |
| 113 * |
| 114 * When the desired protection method(s) have been applied to all applicable |
| 115 * output links, the relevant bit(s) of the protection_mask returned by |
| 116 * QueryStatus() will be set. Otherwise, the relevant bit(s) of |
| 117 * protection_mask will not be set; there is no separate error code or |
| 118 * callback. |
| 119 * |
| 120 * Protections will be disabled if no longer desired by all instances. |
| 121 * |
| 122 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 123 * <code>PPB_OutputProtection_Private</code>. |
| 124 * @param[in] desired_protection_mask The desired protection methods, which |
| 125 * is a bit-mask of the <code>PP_OutputProtectionMethod_Private</code> |
| 126 * values. |
| 127 * @param[in] callback A <code>PP_CompletionCallback</code> to be called when |
| 128 * the protection request has been made. This may be before the protection |
| 129 * have actually been applied. Call QueryStatus to get protection status. |
| 130 * |
| 131 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 132 */ |
| 133 int32_t EnableProtection( |
| 134 [in] PP_Resource resource, |
| 135 [in] uint32_t desired_protection_mask, |
| 136 [in] PP_CompletionCallback callback); |
| 137 }; |
OLD | NEW |