Wasabi ExpressPlay SDK for Embedded Systems  1.10
WsbDrmDbus.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Wasabi DRM D-Bus interface
4 |
5 | $Id: WsbDrmDbus.h 10793 2014-06-25 12:46:08Z jebaseelir $
6 | Original author: Edin Hodzic (dino@concisoft.com)
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 
157 /* Initialize the DrmDbus module */
158 WSB_EXPORT WSB_Result
159 WSB_DrmDbus_Initialize(WSB_DrmDbus** drm, WSB_Size max_pending_requests);
160 
161 /* Process an action token */
162 WSB_EXPORT WSB_Result
164  const char* token,
165  const WSB_DrmDbus_TokenProcessed callback);
166 
167 /* Check whether an action is valid for a content ID */
168 WSB_EXPORT WSB_Result
170  const char* content_id,
171  WSB_DrmDbus_ActionType action,
173  int* retval);
174 
175 /* Terminate the module execution */
176 WSB_EXPORT WSB_Result
178 
179 /* Map a Wasabi error code to a Canvas D-Bus DRM error code */
180 WSB_EXPORT WSB_DrmDbusResult
182 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif // _WSB_DRM_DBUS_H_