forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppb_content_decryptor_private_thunk.cc
215 lines (191 loc) · 8.2 KB
/
ppb_content_decryptor_private_thunk.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// From private/ppb_content_decryptor_private.idl modified Mon Mar 30 22:35:33
// 2015.
#include <stdint.h>
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_content_decryptor_private.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
namespace ppapi {
namespace thunk {
namespace {
void PromiseResolved(PP_Instance instance, uint32_t promise_id) {
VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolved()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->PromiseResolved(instance, promise_id);
}
void PromiseResolvedWithKeyStatus(PP_Instance instance,
uint32_t promise_id,
PP_CdmKeyStatus key_status) {
VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithKeyStatus()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->PromiseResolvedWithKeyStatus(instance, promise_id,
key_status);
}
void PromiseResolvedWithSession(PP_Instance instance,
uint32_t promise_id,
struct PP_Var session_id) {
VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithSession()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->PromiseResolvedWithSession(instance, promise_id,
session_id);
}
void PromiseRejected(PP_Instance instance,
uint32_t promise_id,
PP_CdmExceptionCode exception_code,
uint32_t system_code,
struct PP_Var error_description) {
VLOG(4) << "PPB_ContentDecryptor_Private::PromiseRejected()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->PromiseRejected(instance, promise_id, exception_code,
system_code, error_description);
}
void SessionMessage(PP_Instance instance,
struct PP_Var session_id,
PP_CdmMessageType message_type,
struct PP_Var message,
struct PP_Var legacy_destination_url) {
VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->SessionMessage(instance, session_id, message_type, message,
legacy_destination_url);
}
void SessionKeysChange(PP_Instance instance,
struct PP_Var session_id,
PP_Bool has_additional_usable_key,
uint32_t key_count,
const struct PP_KeyInformation key_information[]) {
VLOG(4) << "PPB_ContentDecryptor_Private::SessionKeysChange()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->SessionKeysChange(instance, session_id,
has_additional_usable_key, key_count,
key_information);
}
void SessionExpirationChange(PP_Instance instance,
struct PP_Var session_id,
PP_Time new_expiry_time) {
VLOG(4) << "PPB_ContentDecryptor_Private::SessionExpirationChange()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->SessionExpirationChange(instance, session_id,
new_expiry_time);
}
void SessionClosed(PP_Instance instance, struct PP_Var session_id) {
VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->SessionClosed(instance, session_id);
}
void LegacySessionError(PP_Instance instance,
struct PP_Var session_id,
PP_CdmExceptionCode exception_code,
uint32_t system_code,
struct PP_Var error_description) {
VLOG(4) << "PPB_ContentDecryptor_Private::LegacySessionError()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->LegacySessionError(instance, session_id, exception_code,
system_code, error_description);
}
void DeliverBlock(PP_Instance instance,
PP_Resource decrypted_block,
const struct PP_DecryptedBlockInfo* decrypted_block_info) {
VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->DeliverBlock(instance, decrypted_block,
decrypted_block_info);
}
void DecoderInitializeDone(PP_Instance instance,
PP_DecryptorStreamType decoder_type,
uint32_t request_id,
PP_Bool success) {
VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->DecoderInitializeDone(instance, decoder_type, request_id,
success);
}
void DecoderDeinitializeDone(PP_Instance instance,
PP_DecryptorStreamType decoder_type,
uint32_t request_id) {
VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->DecoderDeinitializeDone(instance, decoder_type,
request_id);
}
void DecoderResetDone(PP_Instance instance,
PP_DecryptorStreamType decoder_type,
uint32_t request_id) {
VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->DecoderResetDone(instance, decoder_type, request_id);
}
void DeliverFrame(PP_Instance instance,
PP_Resource decrypted_frame,
const struct PP_DecryptedFrameInfo* decrypted_frame_info) {
VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->DeliverFrame(instance, decrypted_frame,
decrypted_frame_info);
}
void DeliverSamples(
PP_Instance instance,
PP_Resource audio_frames,
const struct PP_DecryptedSampleInfo* decrypted_sample_info) {
VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()";
EnterInstance enter(instance);
if (enter.failed())
return;
enter.functions()->DeliverSamples(instance, audio_frames,
decrypted_sample_info);
}
const PPB_ContentDecryptor_Private_0_15
g_ppb_contentdecryptor_private_thunk_0_15 = {&PromiseResolved,
&PromiseResolvedWithKeyStatus,
&PromiseResolvedWithSession,
&PromiseRejected,
&SessionMessage,
&SessionKeysChange,
&SessionExpirationChange,
&SessionClosed,
&LegacySessionError,
&DeliverBlock,
&DecoderInitializeDone,
&DecoderDeinitializeDone,
&DecoderResetDone,
&DeliverFrame,
&DeliverSamples};
} // namespace
PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_15*
GetPPB_ContentDecryptor_Private_0_15_Thunk() {
return &g_ppb_contentdecryptor_private_thunk_0_15;
}
} // namespace thunk
} // namespace ppapi