OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // From private/ppb_content_decryptor_private.idl, | 5 // From private/ppb_content_decryptor_private.idl modified Mon Apr 7 08:56:43 |
6 // modified Wed Feb 26 16:37:47 2014. | 6 // 2014. |
7 | 7 |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/private/ppb_content_decryptor_private.h" | 9 #include "ppapi/c/private/ppb_content_decryptor_private.h" |
10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
12 #include "ppapi/thunk/ppapi_thunk_export.h" | 12 #include "ppapi/thunk/ppapi_thunk_export.h" |
13 | 13 |
14 namespace ppapi { | 14 namespace ppapi { |
15 namespace thunk { | 15 namespace thunk { |
16 | 16 |
(...skipping 10 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 void SessionMessage(PP_Instance instance, | 29 void SessionMessage(PP_Instance instance, |
30 uint32_t session_id, | 30 uint32_t session_id, |
31 struct PP_Var message, | 31 struct PP_Var message, |
32 struct PP_Var destination_url) { | 32 struct PP_Var destination_url) { |
33 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()"; | 33 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()"; |
34 EnterInstance enter(instance); | 34 EnterInstance enter(instance); |
35 if (enter.failed()) | 35 if (enter.failed()) |
36 return; | 36 return; |
37 enter.functions()->SessionMessage(instance, | 37 enter.functions()->SessionMessage( |
38 session_id, | 38 instance, session_id, message, destination_url); |
39 message, | |
40 destination_url); | |
41 } | 39 } |
42 | 40 |
43 void SessionReady(PP_Instance instance, uint32_t session_id) { | 41 void SessionReady(PP_Instance instance, uint32_t session_id) { |
44 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()"; | 42 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()"; |
45 EnterInstance enter(instance); | 43 EnterInstance enter(instance); |
46 if (enter.failed()) | 44 if (enter.failed()) |
47 return; | 45 return; |
48 enter.functions()->SessionReady(instance, session_id); | 46 enter.functions()->SessionReady(instance, session_id); |
49 } | 47 } |
50 | 48 |
51 void SessionClosed(PP_Instance instance, uint32_t session_id) { | 49 void SessionClosed(PP_Instance instance, uint32_t session_id) { |
52 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()"; | 50 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()"; |
53 EnterInstance enter(instance); | 51 EnterInstance enter(instance); |
54 if (enter.failed()) | 52 if (enter.failed()) |
55 return; | 53 return; |
56 enter.functions()->SessionClosed(instance, session_id); | 54 enter.functions()->SessionClosed(instance, session_id); |
57 } | 55 } |
58 | 56 |
59 void SessionError(PP_Instance instance, | 57 void SessionError(PP_Instance instance, |
60 uint32_t session_id, | 58 uint32_t session_id, |
61 int32_t media_error, | 59 int32_t media_error, |
62 uint32_t system_code) { | 60 uint32_t system_code) { |
63 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()"; | 61 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()"; |
64 EnterInstance enter(instance); | 62 EnterInstance enter(instance); |
65 if (enter.failed()) | 63 if (enter.failed()) |
66 return; | 64 return; |
67 enter.functions()->SessionError(instance, | 65 enter.functions()->SessionError( |
68 session_id, | 66 instance, session_id, media_error, system_code); |
69 media_error, | |
70 system_code); | |
71 } | 67 } |
72 | 68 |
73 void DeliverBlock(PP_Instance instance, | 69 void DeliverBlock(PP_Instance instance, |
74 PP_Resource decrypted_block, | 70 PP_Resource decrypted_block, |
75 const struct PP_DecryptedBlockInfo* decrypted_block_info) { | 71 const struct PP_DecryptedBlockInfo* decrypted_block_info) { |
76 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()"; | 72 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()"; |
77 EnterInstance enter(instance); | 73 EnterInstance enter(instance); |
78 if (enter.failed()) | 74 if (enter.failed()) |
79 return; | 75 return; |
80 enter.functions()->DeliverBlock(instance, | 76 enter.functions()->DeliverBlock( |
81 decrypted_block, | 77 instance, decrypted_block, decrypted_block_info); |
82 decrypted_block_info); | |
83 } | 78 } |
84 | 79 |
85 void DecoderInitializeDone(PP_Instance instance, | 80 void DecoderInitializeDone(PP_Instance instance, |
86 PP_DecryptorStreamType decoder_type, | 81 PP_DecryptorStreamType decoder_type, |
87 uint32_t request_id, | 82 uint32_t request_id, |
88 PP_Bool success) { | 83 PP_Bool success) { |
89 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()"; | 84 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()"; |
90 EnterInstance enter(instance); | 85 EnterInstance enter(instance); |
91 if (enter.failed()) | 86 if (enter.failed()) |
92 return; | 87 return; |
93 enter.functions()->DecoderInitializeDone(instance, | 88 enter.functions()->DecoderInitializeDone( |
94 decoder_type, | 89 instance, decoder_type, request_id, success); |
95 request_id, | |
96 success); | |
97 } | 90 } |
98 | 91 |
99 void DecoderDeinitializeDone(PP_Instance instance, | 92 void DecoderDeinitializeDone(PP_Instance instance, |
100 PP_DecryptorStreamType decoder_type, | 93 PP_DecryptorStreamType decoder_type, |
101 uint32_t request_id) { | 94 uint32_t request_id) { |
102 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()"; | 95 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()"; |
103 EnterInstance enter(instance); | 96 EnterInstance enter(instance); |
104 if (enter.failed()) | 97 if (enter.failed()) |
105 return; | 98 return; |
106 enter.functions()->DecoderDeinitializeDone(instance, | 99 enter.functions()->DecoderDeinitializeDone( |
107 decoder_type, | 100 instance, decoder_type, request_id); |
108 request_id); | |
109 } | 101 } |
110 | 102 |
111 void DecoderResetDone(PP_Instance instance, | 103 void DecoderResetDone(PP_Instance instance, |
112 PP_DecryptorStreamType decoder_type, | 104 PP_DecryptorStreamType decoder_type, |
113 uint32_t request_id) { | 105 uint32_t request_id) { |
114 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()"; | 106 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()"; |
115 EnterInstance enter(instance); | 107 EnterInstance enter(instance); |
116 if (enter.failed()) | 108 if (enter.failed()) |
117 return; | 109 return; |
118 enter.functions()->DecoderResetDone(instance, decoder_type, request_id); | 110 enter.functions()->DecoderResetDone(instance, decoder_type, request_id); |
119 } | 111 } |
120 | 112 |
121 void DeliverFrame(PP_Instance instance, | 113 void DeliverFrame(PP_Instance instance, |
122 PP_Resource decrypted_frame, | 114 PP_Resource decrypted_frame, |
123 const struct PP_DecryptedFrameInfo* decrypted_frame_info) { | 115 const struct PP_DecryptedFrameInfo* decrypted_frame_info) { |
124 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()"; | 116 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()"; |
125 EnterInstance enter(instance); | 117 EnterInstance enter(instance); |
126 if (enter.failed()) | 118 if (enter.failed()) |
127 return; | 119 return; |
128 enter.functions()->DeliverFrame(instance, | 120 enter.functions()->DeliverFrame( |
129 decrypted_frame, | 121 instance, decrypted_frame, decrypted_frame_info); |
130 decrypted_frame_info); | |
131 } | 122 } |
132 | 123 |
133 void DeliverSamples( | 124 void DeliverSamples( |
134 PP_Instance instance, | 125 PP_Instance instance, |
135 PP_Resource audio_frames, | 126 PP_Resource audio_frames, |
136 const struct PP_DecryptedSampleInfo* decrypted_sample_info) { | 127 const struct PP_DecryptedSampleInfo* decrypted_sample_info) { |
137 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()"; | 128 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()"; |
138 EnterInstance enter(instance); | 129 EnterInstance enter(instance); |
139 if (enter.failed()) | 130 if (enter.failed()) |
140 return; | 131 return; |
141 enter.functions()->DeliverSamples(instance, | 132 enter.functions()->DeliverSamples( |
142 audio_frames, | 133 instance, audio_frames, decrypted_sample_info); |
143 decrypted_sample_info); | |
144 } | 134 } |
145 | 135 |
146 const PPB_ContentDecryptor_Private_0_11 | 136 const PPB_ContentDecryptor_Private_0_11 |
147 g_ppb_contentdecryptor_private_thunk_0_11 = { | 137 g_ppb_contentdecryptor_private_thunk_0_11 = { // |
148 &SessionCreated, | 138 &SessionCreated, // |
149 &SessionMessage, | 139 &SessionMessage, // |
150 &SessionReady, | 140 &SessionReady, // |
151 &SessionClosed, | 141 &SessionClosed, // |
152 &SessionError, | 142 &SessionError, // |
153 &DeliverBlock, | 143 &DeliverBlock, // |
154 &DecoderInitializeDone, | 144 &DecoderInitializeDone, // |
155 &DecoderDeinitializeDone, | 145 &DecoderDeinitializeDone, // |
156 &DecoderResetDone, | 146 &DecoderResetDone, // |
157 &DeliverFrame, | 147 &DeliverFrame, // |
158 &DeliverSamples | 148 &DeliverSamples // |
159 }; | 149 }; |
160 | 150 |
161 } // namespace | 151 } // namespace |
162 | 152 |
163 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_11* | 153 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_11* |
164 GetPPB_ContentDecryptor_Private_0_11_Thunk() { | 154 GetPPB_ContentDecryptor_Private_0_11_Thunk() { |
165 return &g_ppb_contentdecryptor_private_thunk_0_11; | 155 return &g_ppb_contentdecryptor_private_thunk_0_11; |
166 } | 156 } |
167 | 157 |
168 } // namespace thunk | 158 } // namespace thunk |
169 } // namespace ppapi | 159 } // namespace ppapi |
OLD | NEW |