Wasabi ExpressPlay SDK for Embedded Systems
1.10
Main Page
Modules
Data Structures
Files
File List
Globals
Client
Source
Interface
Extended
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
{
47
WSB_DRMDBUS_MT_UNKNOWN
= -1,
48
WSB_DRMDBUS_MT_MARLIN_ACTION_TOKEN
= 0
49
}
WSB_DrmDbus_MessageType
;
50
51
/* Valid action types, currently only PLAY is defined */
52
typedef
enum
{
53
WSB_DRMDBUS_AT_UNKNOWN
= -1,
54
WSB_DRMDBUS_AT_PLAY
= 0
55
}
WSB_DrmDbus_ActionType
;
56
57
/* Result Code Macros */
58
typedef
enum
{
59
/* The entire message was processed successfully. */
60
WSB_DRMDBUS_SUCCESS
= 0,
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. */
65
WSB_DRMDBUS_ERROR_INVALID_STATE
= 1,
66
67
/* Some or all of the message could not be processed because it was
68
* deemed invalid by the DRM client. */
69
WSB_DRMDBUS_ERROR_CLIENT
= 2,
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. */
74
WSB_DRMDBUS_ERROR_SERVER
= 3,
75
76
/* Some or all of the message could not be processed because a
77
remote service denied the request. */
78
WSB_DRMDBUS_ERROR_SERVER_DENIED
= 4,
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. */
83
WSB_DRMDBUS_ERROR_COMMUNICATION
= 5,
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
*/
90
WSB_DRMDBUS_ERROR_LICENSE_UNSUPPORTED
= 7,
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
*/
96
WSB_DRMDBUS_ERROR_BAD_LICENSE_FORMAT
= 8,
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
*/
103
WSB_DRMDBUS_ERROR_MISSING_CREDENTIALS
= 9,
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
*/
109
WSB_DRMDBUS_ERROR_LICENSE_EXPIRED
= 10,
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
*/
115
WSB_DRMDBUS_ERROR_PLAYCOUNT_EXCEEDED
= 11,
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
*/
121
WSB_DRMDBUS_ERROR_SUBSCRIPTION_EXPIRED
= 12,
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
*/
127
WSB_DRMDBUS_ERROR_CONTENT_PROTECTION_OTHER
= 99
128
}
WSB_DrmDbusResult
;
129
130
/* Token processing callback */
131
typedef
struct
{
132
void
*
instance
;
133
void (*TokenProcessed)(
void
* instance,
WSB_DrmDbusResult
result);
134
}
WSB_DrmDbus_TokenProcessed
;
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);
142
}
WSB_DrmDbus_ActionResultValidator
;
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
163
WSB_DrmDbus_ProcessActionToken
(
WSB_DrmDbus
* drm,
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
169
WSB_DrmDbus_IsActionValid
(
WSB_DrmDbus
* drm,
170
const
char
* content_id,
171
WSB_DrmDbus_ActionType
action,
172
WSB_DrmDbus_ActionResultValidator
validator,
173
int
* retval);
174
175
/* Terminate the module execution */
176
WSB_EXPORT
WSB_Result
177
WSB_DrmDbus_Terminate
(
WSB_DrmDbus
* drm);
178
179
/* Map a Wasabi error code to a Canvas D-Bus DRM error code */
180
WSB_EXPORT
WSB_DrmDbusResult
181
WSB_DrmDbus_ResultMap
(
WSB_Result
code);
182
183
#ifdef __cplusplus
184
}
185
#endif
186
187
#endif // _WSB_DRM_DBUS_H_