Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
WsbDrmDbus.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi DRM D-Bus interface
4 |
5 | $Id: WsbDrmDbus.h 11546 2015-02-03 07:31:48Z jebaseelir $
6 | Original author: Edin Hodzic ([email protected])
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2010-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
16 
17 #ifndef _WSB_DRM_DBUS_H_
18 #define _WSB_DRM_DBUS_H_
19 
27 /*----------------------------------------------------------------------
28 | includes
29 +---------------------------------------------------------------------*/
30 #include "Sushi.h"
31 #include "WsbTypes.h"
32 #include "WsbResults.h"
33 
34 /*----------------------------------------------------------------------
35 | macros
36 +---------------------------------------------------------------------*/
37 #define WSB_DRMDBUS_SERVICE "com.intertrust.wasabi"
38 #define WSB_DRMDBUS_METHOD_PROCESS_MESSAGE "processMessage"
39 #define WSB_DRMDBUS_METHOD_IS_ACTION_VALID "isActionValid"
40 
41 /*----------------------------------------------------------------------
42 | types
43 +---------------------------------------------------------------------*/
44 /* Valid message types for Process message, currently only
45  * ACTION_TOKEN is defined */
46 typedef enum {
50 
51 /* Valid action types, currently only PLAY is defined */
52 typedef enum {
56 
57 /* Result Code Macros */
58 typedef enum {
59  /* The entire message was processed successfully. */
61 
62  /* The message was not processed because the DRM system is not in
63  * a fully functional state. A software upgrade may resolve the
64  * problem. */
66 
67  /* Some or all of the message could not be processed because it was
68  * deemed invalid by the DRM client. */
70 
71  /* Some or all of the message could not be processed because it
72  * required access to a remote service which could not be
73  * contacted. */
75 
76  /* Some or all of the message could not be processed because a
77  remote service denied the request. */
79 
80  /* Some or all of the message could not be processed because a
81  * response from a remote service was deemed invalid or
82  * unacceptable by the DRM client. */
84 
85  /* 7 = Unsupported licence requirement: a licence for the content
86  * exists but the device cannot meet all of its requirements.
87  * Examples: unsupported output control; unsupported callbacks or
88  * obligations.
89  */
91 
92  /* 8 = Licence format error: a licence was located for the media
93  * but it is invalid. Examples: invalid signature on licence;
94  * licence is incomplete; licence cannot be parsed.
95  */
97 
98  /* 9 = Missing credentials: a licence was located for the media
99  * but is dependent on other entities which are not present.
100  * Example: Marlin Broadband licence dependent on a Link which
101  * does not exist (IsNodeReachable failed).
102  */
104 
105  /* 10 = Expired: a time constraint associated with a licence has
106  * been violated. Example: Marlin Broadband licence that is past
107  * its expiry date and time.
108  */
110 
111  /* 11 = Play count exceeded: a play count constraint associated
112  * with a licence has been violated. Example: Marlin Broadband
113  * licence permitted play count has reached zero.
114  */
116 
117  /* 12 = Subscription expired: a time constraint associated with an
118  * entity on which a licence depends has been violated. Example:
119  * a Marlin Broadband link on which a licence depends has expired.
120  */
122 
123  /* 99 = Other content protection error: the requested operation
124  * would fail due to a content protection problem other than those
125  * described by specific response codes.
126  */
129 
130 /* Token processing callback */
131 typedef struct {
132  void* instance;
133  void (*TokenProcessed)(void* instance, WSB_DrmDbusResult result);
135 
136 /* Action validation callback. ValidateActionResult can be set to NULL,
137  in which case a default validator gets invoked. */
138 typedef struct {
139  void* instance;
140  WSB_Result (*ValidateActionResult)(void* instance,
141  SHI_ActionResult* action_result);
143 
144 /* Opaque DRM D-Bus object */
145 typedef struct WSB_DrmDbus WSB_DrmDbus;
146 
147 /*----------------------------------------------------------------------
148 | functions
149 +---------------------------------------------------------------------*/
150 
151 #ifdef __cplusplus
152 extern "C" {
153 #elif 0
154 }
155 #endif
156 
160 /* Initialize the DrmDbus module */
161 WSB_EXPORT WSB_Result
162 WSB_DrmDbus_Initialize(WSB_DrmDbus** drm, WSB_Size max_pending_requests);
163 
164 /* Process an action token */
165 WSB_EXPORT WSB_Result
167  const char* token,
168  const WSB_DrmDbus_TokenProcessed callback);
169 
170 /* Check whether an action is valid for a content ID */
171 WSB_EXPORT WSB_Result
173  const char* content_id,
174  WSB_DrmDbus_ActionType action,
176  int* retval);
177 
178 /* Terminate the module execution */
179 WSB_EXPORT WSB_Result
181 
182 /* Map a Wasabi error code to a Canvas D-Bus DRM error code */
183 WSB_EXPORT WSB_DrmDbusResult
185 
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif // _WSB_DRM_DBUS_H_
Definition: WsbDrmDbus.h:53
Definition: WsbDrmDbus.h:103
WSB_DrmDbus_MessageType
Definition: WsbDrmDbus.h:46
Definition: WsbDrmDbus.h:138
WSB_DrmDbus_ActionType
Definition: WsbDrmDbus.h:52
Definition: WsbDrmDbus.h:115
Definition: WsbDrmDbus.h:69
Definition: WsbDrmDbus.h:74
WSB_DrmDbusResult
Definition: WsbDrmDbus.h:58
struct WSB_DrmDbus WSB_DrmDbus
Definition: WsbDrmDbus.h:145
Definition: WsbDrmDbus.h:121
Definition: WsbDrmDbus.h:127
void * instance
Definition: WsbDrmDbus.h:132
Definition: WsbDrmDbus.h:90
Definition: WsbDrmDbus.h:83
Definition: WsbDrmDbus.h:48
WSB_EXPORT WSB_DrmDbusResult WSB_DrmDbus_ResultMap(WSB_Result code)
Definition: WsbDrmDbus.h:54
WSB_EXPORT WSB_Result WSB_DrmDbus_ProcessActionToken(WSB_DrmDbus *drm, const char *token, const WSB_DrmDbus_TokenProcessed callback)
Definition: WsbDrmDbus.h:96
int WSB_Result
Signed integer value representing a function or method result (return value).
Definition: WsbTypes.h:83
WSB_EXPORT WSB_Result WSB_DrmDbus_Terminate(WSB_DrmDbus *drm)
Definition: WsbDrmDbus.h:60
WSB_EXPORT WSB_Result WSB_DrmDbus_Initialize(WSB_DrmDbus **drm, WSB_Size max_pending_requests)
Definition: WsbDrmDbus.h:65
Result codes.
Definition: WsbDrmDbus.h:78
struct SHI_ActionResult SHI_ActionResult
A SHI_ActionResult object represents the result returned by several different SHI_Action methods...
Definition: ShiAction.h:444
Definition: WsbDrmDbus.h:109
Wasabi Result.
void * instance
Definition: WsbDrmDbus.h:139
WSB_EXPORT WSB_Result WSB_DrmDbus_IsActionValid(WSB_DrmDbus *drm, const char *content_id, WSB_DrmDbus_ActionType action, WSB_DrmDbus_ActionResultValidator validator, int *retval)
WSB_UInt32 WSB_Size
An unsigned integer used to represent a measurable quantity (e.g., the size of a file).
Definition: WsbTypes.h:104
Definition: WsbDrmDbus.h:131
Definition: WsbDrmDbus.h:47