Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/gmp/PGMPVideoEncoderParent.h"
8 :
9 : #include "mozilla/gmp/PGMPContentParent.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 : namespace gmp {
16 :
17 :
18 0 : auto PGMPVideoEncoderParent::Recv__delete__() -> mozilla::ipc::IPCResult
19 : {
20 0 : return IPC_OK();
21 : }
22 :
23 :
24 0 : MOZ_IMPLICIT PGMPVideoEncoderParent::PGMPVideoEncoderParent() :
25 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
26 0 : mState(PGMPVideoEncoder::__Dead)
27 : {
28 0 : MOZ_COUNT_CTOR(PGMPVideoEncoderParent);
29 0 : }
30 :
31 0 : PGMPVideoEncoderParent::~PGMPVideoEncoderParent()
32 : {
33 0 : MOZ_COUNT_DTOR(PGMPVideoEncoderParent);
34 0 : }
35 :
36 0 : auto PGMPVideoEncoderParent::Manager() const -> PGMPContentParent*
37 : {
38 0 : return static_cast<PGMPContentParent*>(IProtocol::Manager());
39 : }
40 :
41 0 : auto PGMPVideoEncoderParent::SendInitEncode(
42 : const GMPVideoCodec& aCodecSettings,
43 : const nsTArray<uint8_t>& aCodecSpecific,
44 : const int32_t& aNumberOfCores,
45 : const uint32_t& aMaxPayloadSize) -> bool
46 : {
47 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_InitEncode(Id());
48 :
49 0 : Write(aCodecSettings, msg__);
50 : // Sentinel = 'aCodecSettings'
51 0 : (msg__)->WriteSentinel(394896860);
52 0 : Write(aCodecSpecific, msg__);
53 : // Sentinel = 'aCodecSpecific'
54 0 : (msg__)->WriteSentinel(3773952059);
55 0 : Write(aNumberOfCores, msg__);
56 : // Sentinel = 'aNumberOfCores'
57 0 : (msg__)->WriteSentinel(3247212389);
58 0 : Write(aMaxPayloadSize, msg__);
59 : // Sentinel = 'aMaxPayloadSize'
60 0 : (msg__)->WriteSentinel(4078750881);
61 :
62 :
63 :
64 :
65 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
66 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
67 : }
68 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_InitEncode", OTHER);
69 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_InitEncode__ID, (&(mState)));
70 :
71 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
72 0 : return sendok__;
73 : }
74 :
75 0 : auto PGMPVideoEncoderParent::SendEncode(
76 : const GMPVideoi420FrameData& aInputFrame,
77 : const nsTArray<uint8_t>& aCodecSpecificInfo,
78 : const nsTArray<GMPVideoFrameType>& aFrameTypes) -> bool
79 : {
80 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_Encode(Id());
81 :
82 0 : Write(aInputFrame, msg__);
83 : // Sentinel = 'aInputFrame'
84 0 : (msg__)->WriteSentinel(3664588317);
85 0 : Write(aCodecSpecificInfo, msg__);
86 : // Sentinel = 'aCodecSpecificInfo'
87 0 : (msg__)->WriteSentinel(742576219);
88 0 : Write(aFrameTypes, msg__);
89 : // Sentinel = 'aFrameTypes'
90 0 : (msg__)->WriteSentinel(2159018888);
91 :
92 :
93 :
94 :
95 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
96 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
97 : }
98 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Encode", OTHER);
99 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_Encode__ID, (&(mState)));
100 :
101 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
102 0 : return sendok__;
103 : }
104 :
105 0 : auto PGMPVideoEncoderParent::SendSetChannelParameters(
106 : const uint32_t& aPacketLoss,
107 : const uint32_t& aRTT) -> bool
108 : {
109 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_SetChannelParameters(Id());
110 :
111 0 : Write(aPacketLoss, msg__);
112 : // Sentinel = 'aPacketLoss'
113 0 : (msg__)->WriteSentinel(767954619);
114 0 : Write(aRTT, msg__);
115 : // Sentinel = 'aRTT'
116 0 : (msg__)->WriteSentinel(1233438341);
117 :
118 :
119 :
120 :
121 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
122 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
123 : }
124 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_SetChannelParameters", OTHER);
125 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_SetChannelParameters__ID, (&(mState)));
126 :
127 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
128 0 : return sendok__;
129 : }
130 :
131 0 : auto PGMPVideoEncoderParent::SendSetRates(
132 : const uint32_t& aNewBitRate,
133 : const uint32_t& aFrameRate) -> bool
134 : {
135 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_SetRates(Id());
136 :
137 0 : Write(aNewBitRate, msg__);
138 : // Sentinel = 'aNewBitRate'
139 0 : (msg__)->WriteSentinel(1554340975);
140 0 : Write(aFrameRate, msg__);
141 : // Sentinel = 'aFrameRate'
142 0 : (msg__)->WriteSentinel(770773236);
143 :
144 :
145 :
146 :
147 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
148 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
149 : }
150 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_SetRates", OTHER);
151 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_SetRates__ID, (&(mState)));
152 :
153 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
154 0 : return sendok__;
155 : }
156 :
157 0 : auto PGMPVideoEncoderParent::SendSetPeriodicKeyFrames(const bool& aEnable) -> bool
158 : {
159 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_SetPeriodicKeyFrames(Id());
160 :
161 0 : Write(aEnable, msg__);
162 : // Sentinel = 'aEnable'
163 0 : (msg__)->WriteSentinel(163837555);
164 :
165 :
166 :
167 :
168 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
169 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
170 : }
171 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_SetPeriodicKeyFrames", OTHER);
172 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_SetPeriodicKeyFrames__ID, (&(mState)));
173 :
174 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
175 0 : return sendok__;
176 : }
177 :
178 0 : auto PGMPVideoEncoderParent::SendEncodingComplete() -> bool
179 : {
180 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_EncodingComplete(Id());
181 :
182 :
183 :
184 :
185 :
186 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
187 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
188 : }
189 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_EncodingComplete", OTHER);
190 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_EncodingComplete__ID, (&(mState)));
191 :
192 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
193 0 : return sendok__;
194 : }
195 :
196 0 : auto PGMPVideoEncoderParent::SendChildShmemForPool(Shmem& aEncodedBuffer) -> bool
197 : {
198 0 : IPC::Message* msg__ = PGMPVideoEncoder::Msg_ChildShmemForPool(Id());
199 :
200 0 : Write(aEncodedBuffer, msg__);
201 : // Sentinel = 'aEncodedBuffer'
202 0 : (msg__)->WriteSentinel(3335299401);
203 :
204 :
205 :
206 :
207 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
208 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
209 : }
210 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_ChildShmemForPool", OTHER);
211 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_ChildShmemForPool__ID, (&(mState)));
212 :
213 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
214 0 : return sendok__;
215 : }
216 :
217 0 : auto PGMPVideoEncoderParent::RemoveManagee(
218 : int32_t aProtocolId,
219 : ProtocolBase* aListener) -> void
220 : {
221 0 : FatalError("unreached");
222 0 : return;
223 : }
224 :
225 0 : auto PGMPVideoEncoderParent::OnMessageReceived(const Message& msg__) -> PGMPVideoEncoderParent::Result
226 : {
227 0 : switch ((msg__).type()) {
228 : case PGMPVideoEncoder::Msg___delete____ID:
229 : {
230 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
231 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
232 : }
233 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg___delete__", OTHER);
234 :
235 0 : PickleIterator iter__(msg__);
236 : PGMPVideoEncoderParent* actor;
237 :
238 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
239 0 : FatalError("Error deserializing 'PGMPVideoEncoderParent'");
240 0 : return MsgValueError;
241 : }
242 : // Sentinel = 'actor'
243 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
244 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PGMPVideoEncoderParent'");
245 0 : return MsgValueError;
246 : }
247 0 : (msg__).EndRead(iter__, (msg__).type());
248 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg___delete____ID, (&(mState)));
249 0 : if ((!(Recv__delete__()))) {
250 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
251 : // Error handled in mozilla::ipc::IPCResult
252 0 : return MsgProcessingError;
253 : }
254 :
255 :
256 0 : IProtocol* mgr = (actor)->Manager();
257 0 : (actor)->DestroySubtree(Deletion);
258 0 : (actor)->DeallocSubtree();
259 0 : (mgr)->RemoveManagee(PGMPVideoEncoderMsgStart, actor);
260 :
261 0 : return MsgProcessed;
262 : }
263 : case PGMPVideoEncoder::Msg_Encoded__ID:
264 : {
265 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
266 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
267 : }
268 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Encoded", OTHER);
269 :
270 0 : PickleIterator iter__(msg__);
271 0 : GMPVideoEncodedFrameData aEncodedFrame;
272 0 : nsTArray<uint8_t> aCodecSpecificInfo;
273 :
274 0 : if ((!(Read((&(aEncodedFrame)), (&(msg__)), (&(iter__)))))) {
275 0 : FatalError("Error deserializing 'GMPVideoEncodedFrameData'");
276 0 : return MsgValueError;
277 : }
278 : // Sentinel = 'aEncodedFrame'
279 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3455883009)))) {
280 0 : mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoEncodedFrameData'");
281 0 : return MsgValueError;
282 : }
283 0 : if ((!(Read((&(aCodecSpecificInfo)), (&(msg__)), (&(iter__)))))) {
284 0 : FatalError("Error deserializing 'nsTArray'");
285 0 : return MsgValueError;
286 : }
287 : // Sentinel = 'aCodecSpecificInfo'
288 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 742576219)))) {
289 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
290 0 : return MsgValueError;
291 : }
292 0 : (msg__).EndRead(iter__, (msg__).type());
293 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_Encoded__ID, (&(mState)));
294 0 : if ((!(RecvEncoded(mozilla::Move(aEncodedFrame), mozilla::Move(aCodecSpecificInfo))))) {
295 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
296 : // Error handled in mozilla::ipc::IPCResult
297 0 : return MsgProcessingError;
298 : }
299 :
300 0 : return MsgProcessed;
301 : }
302 : case PGMPVideoEncoder::Msg_Error__ID:
303 : {
304 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
305 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
306 : }
307 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Error", OTHER);
308 :
309 0 : PickleIterator iter__(msg__);
310 : GMPErr aErr;
311 :
312 0 : if ((!(Read((&(aErr)), (&(msg__)), (&(iter__)))))) {
313 0 : FatalError("Error deserializing 'GMPErr'");
314 0 : return MsgValueError;
315 : }
316 : // Sentinel = 'aErr'
317 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 540683382)))) {
318 0 : mozilla::ipc::SentinelReadError("Error deserializing 'GMPErr'");
319 0 : return MsgValueError;
320 : }
321 0 : (msg__).EndRead(iter__, (msg__).type());
322 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_Error__ID, (&(mState)));
323 0 : if ((!(RecvError(mozilla::Move(aErr))))) {
324 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
325 : // Error handled in mozilla::ipc::IPCResult
326 0 : return MsgProcessingError;
327 : }
328 :
329 0 : return MsgProcessed;
330 : }
331 : case PGMPVideoEncoder::Msg_Shutdown__ID:
332 : {
333 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
334 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
335 : }
336 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Shutdown", OTHER);
337 :
338 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_Shutdown__ID, (&(mState)));
339 0 : if ((!(RecvShutdown()))) {
340 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
341 : // Error handled in mozilla::ipc::IPCResult
342 0 : return MsgProcessingError;
343 : }
344 :
345 0 : return MsgProcessed;
346 : }
347 : case PGMPVideoEncoder::Msg_ParentShmemForPool__ID:
348 : {
349 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
350 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
351 : }
352 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_ParentShmemForPool", OTHER);
353 :
354 0 : PickleIterator iter__(msg__);
355 0 : Shmem aFrameBuffer;
356 :
357 0 : if ((!(Read((&(aFrameBuffer)), (&(msg__)), (&(iter__)))))) {
358 0 : FatalError("Error deserializing 'Shmem'");
359 0 : return MsgValueError;
360 : }
361 : // Sentinel = 'aFrameBuffer'
362 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3888831322)))) {
363 0 : mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'");
364 0 : return MsgValueError;
365 : }
366 0 : (msg__).EndRead(iter__, (msg__).type());
367 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_ParentShmemForPool__ID, (&(mState)));
368 0 : if ((!(RecvParentShmemForPool(mozilla::Move(aFrameBuffer))))) {
369 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
370 : // Error handled in mozilla::ipc::IPCResult
371 0 : return MsgProcessingError;
372 : }
373 :
374 0 : return MsgProcessed;
375 : }
376 : default:
377 : {
378 0 : return MsgNotKnown;
379 : }
380 : }
381 : }
382 :
383 0 : auto PGMPVideoEncoderParent::OnMessageReceived(
384 : const Message& msg__,
385 : Message*& reply__) -> PGMPVideoEncoderParent::Result
386 : {
387 0 : return MsgNotKnown;
388 : }
389 :
390 0 : auto PGMPVideoEncoderParent::OnCallReceived(
391 : const Message& msg__,
392 : Message*& reply__) -> PGMPVideoEncoderParent::Result
393 : {
394 0 : switch ((msg__).type()) {
395 : case PGMPVideoEncoder::Msg_NeedShmem__ID:
396 : {
397 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
398 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
399 : }
400 0 : AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_NeedShmem", OTHER);
401 :
402 0 : PickleIterator iter__(msg__);
403 : uint32_t aEncodedBufferSize;
404 :
405 0 : if ((!(Read((&(aEncodedBufferSize)), (&(msg__)), (&(iter__)))))) {
406 0 : FatalError("Error deserializing 'uint32_t'");
407 0 : return MsgValueError;
408 : }
409 : // Sentinel = 'aEncodedBufferSize'
410 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2299884566)))) {
411 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
412 0 : return MsgValueError;
413 : }
414 0 : (msg__).EndRead(iter__, (msg__).type());
415 0 : PGMPVideoEncoder::Transition(PGMPVideoEncoder::Msg_NeedShmem__ID, (&(mState)));
416 0 : int32_t id__ = Id();
417 0 : Shmem aMem;
418 0 : if ((!(AnswerNeedShmem(mozilla::Move(aEncodedBufferSize), (&(aMem)))))) {
419 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
420 : // Error handled in mozilla::ipc::IPCResult
421 0 : return MsgProcessingError;
422 : }
423 :
424 0 : reply__ = PGMPVideoEncoder::Reply_NeedShmem(id__);
425 :
426 0 : Write(aMem, reply__);
427 : // Sentinel = 'aMem'
428 0 : (reply__)->WriteSentinel(3574578916);
429 0 : (reply__)->set_interrupt();
430 0 : (reply__)->set_reply();
431 :
432 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderParent")) {
433 0 : mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
434 : }
435 0 : return MsgProcessed;
436 : }
437 : default:
438 : {
439 0 : return MsgNotKnown;
440 : }
441 : }
442 : }
443 :
444 0 : auto PGMPVideoEncoderParent::GetProtocolTypeId() -> int32_t
445 : {
446 0 : return PGMPVideoEncoderMsgStart;
447 : }
448 :
449 0 : auto PGMPVideoEncoderParent::ProtocolName() const -> const char*
450 : {
451 0 : return "PGMPVideoEncoderParent";
452 : }
453 :
454 0 : auto PGMPVideoEncoderParent::DestroySubtree(ActorDestroyReason why) -> void
455 : {
456 : // Unregister from our manager.
457 0 : Unregister(Id());
458 :
459 : // Reject owning pending promises.
460 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
461 :
462 : // Finally, destroy "us".
463 0 : ActorDestroy(why);
464 0 : }
465 :
466 0 : auto PGMPVideoEncoderParent::DeallocSubtree() -> void
467 : {
468 0 : }
469 :
470 0 : auto PGMPVideoEncoderParent::Write(
471 : const GMPDecryptionData& v__,
472 : Message* msg__) -> void
473 : {
474 0 : Write((v__).mKeyId(), msg__);
475 : // Sentinel = 'mKeyId'
476 0 : (msg__)->WriteSentinel(3981028119);
477 0 : Write((v__).mIV(), msg__);
478 : // Sentinel = 'mIV'
479 0 : (msg__)->WriteSentinel(2012943167);
480 0 : Write((v__).mClearBytes(), msg__);
481 : // Sentinel = 'mClearBytes'
482 0 : (msg__)->WriteSentinel(2207723306);
483 0 : Write((v__).mCipherBytes(), msg__);
484 : // Sentinel = 'mCipherBytes'
485 0 : (msg__)->WriteSentinel(2558919233);
486 0 : Write((v__).mSessionIds(), msg__);
487 : // Sentinel = 'mSessionIds'
488 0 : (msg__)->WriteSentinel(2015252892);
489 0 : }
490 :
491 0 : auto PGMPVideoEncoderParent::Read(
492 : GMPDecryptionData* v__,
493 : const Message* msg__,
494 : PickleIterator* iter__) -> bool
495 : {
496 0 : if ((!(Read((&((v__)->mKeyId())), msg__, iter__)))) {
497 0 : FatalError("Error deserializing 'mKeyId' (uint8_t[]) member of 'GMPDecryptionData'");
498 0 : return false;
499 : }
500 : // Sentinel = 'mKeyId'
501 0 : if ((!((msg__)->ReadSentinel(iter__, 3981028119)))) {
502 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mKeyId' (uint8_t[]) member of 'GMPDecryptionData'");
503 0 : return false;
504 : }
505 0 : if ((!(Read((&((v__)->mIV())), msg__, iter__)))) {
506 0 : FatalError("Error deserializing 'mIV' (uint8_t[]) member of 'GMPDecryptionData'");
507 0 : return false;
508 : }
509 : // Sentinel = 'mIV'
510 0 : if ((!((msg__)->ReadSentinel(iter__, 2012943167)))) {
511 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mIV' (uint8_t[]) member of 'GMPDecryptionData'");
512 0 : return false;
513 : }
514 0 : if ((!(Read((&((v__)->mClearBytes())), msg__, iter__)))) {
515 0 : FatalError("Error deserializing 'mClearBytes' (uint16_t[]) member of 'GMPDecryptionData'");
516 0 : return false;
517 : }
518 : // Sentinel = 'mClearBytes'
519 0 : if ((!((msg__)->ReadSentinel(iter__, 2207723306)))) {
520 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mClearBytes' (uint16_t[]) member of 'GMPDecryptionData'");
521 0 : return false;
522 : }
523 0 : if ((!(Read((&((v__)->mCipherBytes())), msg__, iter__)))) {
524 0 : FatalError("Error deserializing 'mCipherBytes' (uint32_t[]) member of 'GMPDecryptionData'");
525 0 : return false;
526 : }
527 : // Sentinel = 'mCipherBytes'
528 0 : if ((!((msg__)->ReadSentinel(iter__, 2558919233)))) {
529 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mCipherBytes' (uint32_t[]) member of 'GMPDecryptionData'");
530 0 : return false;
531 : }
532 0 : if ((!(Read((&((v__)->mSessionIds())), msg__, iter__)))) {
533 0 : FatalError("Error deserializing 'mSessionIds' (nsCString[]) member of 'GMPDecryptionData'");
534 0 : return false;
535 : }
536 : // Sentinel = 'mSessionIds'
537 0 : if ((!((msg__)->ReadSentinel(iter__, 2015252892)))) {
538 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mSessionIds' (nsCString[]) member of 'GMPDecryptionData'");
539 0 : return false;
540 : }
541 0 : return true;
542 : }
543 :
544 0 : auto PGMPVideoEncoderParent::Write(
545 : Shmem& v__,
546 : Message* msg__) -> void
547 : {
548 0 : IPC::WriteParam(msg__, v__);
549 0 : (v__).RevokeRights(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
550 0 : (v__).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
551 0 : }
552 :
553 0 : auto PGMPVideoEncoderParent::Read(
554 : Shmem* v__,
555 : const Message* msg__,
556 : PickleIterator* iter__) -> bool
557 : {
558 0 : Shmem tmp;
559 0 : if ((!(IPC::ReadParam(msg__, iter__, (&(tmp)))))) {
560 0 : return false;
561 : }
562 :
563 0 : Shmem::id_t shmemid = (tmp).Id(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
564 0 : Shmem::SharedMemory* rawmem = LookupSharedMemory(shmemid);
565 0 : if (rawmem) {
566 0 : (*(v__)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, shmemid);
567 0 : return true;
568 : }
569 0 : (*(v__)) = Shmem();
570 0 : return true;
571 : }
572 :
573 0 : auto PGMPVideoEncoderParent::Write(
574 : const GMPVideoi420FrameData& v__,
575 : Message* msg__) -> void
576 : {
577 0 : Write((v__).mYPlane(), msg__);
578 : // Sentinel = 'mYPlane'
579 0 : (msg__)->WriteSentinel(404518467);
580 0 : Write((v__).mUPlane(), msg__);
581 : // Sentinel = 'mUPlane'
582 0 : (msg__)->WriteSentinel(3678319999);
583 0 : Write((v__).mVPlane(), msg__);
584 : // Sentinel = 'mVPlane'
585 0 : (msg__)->WriteSentinel(2699831758);
586 0 : Write((v__).mWidth(), msg__);
587 : // Sentinel = 'mWidth'
588 0 : (msg__)->WriteSentinel(2935937477);
589 0 : Write((v__).mHeight(), msg__);
590 : // Sentinel = 'mHeight'
591 0 : (msg__)->WriteSentinel(1396193839);
592 0 : Write((v__).mTimestamp(), msg__);
593 : // Sentinel = 'mTimestamp'
594 0 : (msg__)->WriteSentinel(2107530829);
595 0 : Write((v__).mDuration(), msg__);
596 : // Sentinel = 'mDuration'
597 0 : (msg__)->WriteSentinel(3773650888);
598 0 : }
599 :
600 0 : auto PGMPVideoEncoderParent::Read(
601 : GMPVideoi420FrameData* v__,
602 : const Message* msg__,
603 : PickleIterator* iter__) -> bool
604 : {
605 0 : if ((!(Read((&((v__)->mYPlane())), msg__, iter__)))) {
606 0 : FatalError("Error deserializing 'mYPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
607 0 : return false;
608 : }
609 : // Sentinel = 'mYPlane'
610 0 : if ((!((msg__)->ReadSentinel(iter__, 404518467)))) {
611 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mYPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
612 0 : return false;
613 : }
614 0 : if ((!(Read((&((v__)->mUPlane())), msg__, iter__)))) {
615 0 : FatalError("Error deserializing 'mUPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
616 0 : return false;
617 : }
618 : // Sentinel = 'mUPlane'
619 0 : if ((!((msg__)->ReadSentinel(iter__, 3678319999)))) {
620 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mUPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
621 0 : return false;
622 : }
623 0 : if ((!(Read((&((v__)->mVPlane())), msg__, iter__)))) {
624 0 : FatalError("Error deserializing 'mVPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
625 0 : return false;
626 : }
627 : // Sentinel = 'mVPlane'
628 0 : if ((!((msg__)->ReadSentinel(iter__, 2699831758)))) {
629 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mVPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
630 0 : return false;
631 : }
632 0 : if ((!(Read((&((v__)->mWidth())), msg__, iter__)))) {
633 0 : FatalError("Error deserializing 'mWidth' (int32_t) member of 'GMPVideoi420FrameData'");
634 0 : return false;
635 : }
636 : // Sentinel = 'mWidth'
637 0 : if ((!((msg__)->ReadSentinel(iter__, 2935937477)))) {
638 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mWidth' (int32_t) member of 'GMPVideoi420FrameData'");
639 0 : return false;
640 : }
641 0 : if ((!(Read((&((v__)->mHeight())), msg__, iter__)))) {
642 0 : FatalError("Error deserializing 'mHeight' (int32_t) member of 'GMPVideoi420FrameData'");
643 0 : return false;
644 : }
645 : // Sentinel = 'mHeight'
646 0 : if ((!((msg__)->ReadSentinel(iter__, 1396193839)))) {
647 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mHeight' (int32_t) member of 'GMPVideoi420FrameData'");
648 0 : return false;
649 : }
650 0 : if ((!(Read((&((v__)->mTimestamp())), msg__, iter__)))) {
651 0 : FatalError("Error deserializing 'mTimestamp' (uint64_t) member of 'GMPVideoi420FrameData'");
652 0 : return false;
653 : }
654 : // Sentinel = 'mTimestamp'
655 0 : if ((!((msg__)->ReadSentinel(iter__, 2107530829)))) {
656 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mTimestamp' (uint64_t) member of 'GMPVideoi420FrameData'");
657 0 : return false;
658 : }
659 0 : if ((!(Read((&((v__)->mDuration())), msg__, iter__)))) {
660 0 : FatalError("Error deserializing 'mDuration' (uint64_t) member of 'GMPVideoi420FrameData'");
661 0 : return false;
662 : }
663 : // Sentinel = 'mDuration'
664 0 : if ((!((msg__)->ReadSentinel(iter__, 3773650888)))) {
665 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mDuration' (uint64_t) member of 'GMPVideoi420FrameData'");
666 0 : return false;
667 : }
668 0 : return true;
669 : }
670 :
671 0 : auto PGMPVideoEncoderParent::Write(
672 : const PGMPVideoEncoderParent* v__,
673 : Message* msg__,
674 : bool nullable__) -> void
675 : {
676 : int32_t id;
677 0 : if ((!(v__))) {
678 0 : if ((!(nullable__))) {
679 0 : FatalError("NULL actor value passed to non-nullable param");
680 : }
681 0 : id = 0;
682 : }
683 : else {
684 0 : id = (v__)->Id();
685 0 : if ((1) == (id)) {
686 0 : FatalError("actor has been |delete|d");
687 : }
688 : }
689 :
690 0 : Write(id, msg__);
691 0 : }
692 :
693 0 : auto PGMPVideoEncoderParent::Read(
694 : PGMPVideoEncoderParent** v__,
695 : const Message* msg__,
696 : PickleIterator* iter__,
697 : bool nullable__) -> bool
698 : {
699 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPVideoEncoder", PGMPVideoEncoderMsgStart);
700 0 : if ((actor).isNothing()) {
701 0 : return false;
702 : }
703 :
704 0 : (*(v__)) = static_cast<PGMPVideoEncoderParent*>((actor).value());
705 0 : return true;
706 : }
707 :
708 0 : auto PGMPVideoEncoderParent::Write(
709 : const GMPVideoEncodedFrameData& v__,
710 : Message* msg__) -> void
711 : {
712 0 : Write((v__).mEncodedWidth(), msg__);
713 : // Sentinel = 'mEncodedWidth'
714 0 : (msg__)->WriteSentinel(1861402050);
715 0 : Write((v__).mEncodedHeight(), msg__);
716 : // Sentinel = 'mEncodedHeight'
717 0 : (msg__)->WriteSentinel(244605666);
718 0 : Write((v__).mTimestamp(), msg__);
719 : // Sentinel = 'mTimestamp'
720 0 : (msg__)->WriteSentinel(2107530829);
721 0 : Write((v__).mDuration(), msg__);
722 : // Sentinel = 'mDuration'
723 0 : (msg__)->WriteSentinel(3773650888);
724 0 : Write((v__).mFrameType(), msg__);
725 : // Sentinel = 'mFrameType'
726 0 : (msg__)->WriteSentinel(3891971702);
727 0 : Write((v__).mSize(), msg__);
728 : // Sentinel = 'mSize'
729 0 : (msg__)->WriteSentinel(2022816943);
730 0 : Write((v__).mBufferType(), msg__);
731 : // Sentinel = 'mBufferType'
732 0 : (msg__)->WriteSentinel(1911156444);
733 0 : Write((v__).mBuffer(), msg__);
734 : // Sentinel = 'mBuffer'
735 0 : (msg__)->WriteSentinel(3436723048);
736 0 : Write((v__).mCompleteFrame(), msg__);
737 : // Sentinel = 'mCompleteFrame'
738 0 : (msg__)->WriteSentinel(2960948789);
739 0 : Write((v__).mDecryptionData(), msg__);
740 : // Sentinel = 'mDecryptionData'
741 0 : (msg__)->WriteSentinel(3882545301);
742 0 : }
743 :
744 0 : auto PGMPVideoEncoderParent::Read(
745 : GMPVideoEncodedFrameData* v__,
746 : const Message* msg__,
747 : PickleIterator* iter__) -> bool
748 : {
749 0 : if ((!(Read((&((v__)->mEncodedWidth())), msg__, iter__)))) {
750 0 : FatalError("Error deserializing 'mEncodedWidth' (uint32_t) member of 'GMPVideoEncodedFrameData'");
751 0 : return false;
752 : }
753 : // Sentinel = 'mEncodedWidth'
754 0 : if ((!((msg__)->ReadSentinel(iter__, 1861402050)))) {
755 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mEncodedWidth' (uint32_t) member of 'GMPVideoEncodedFrameData'");
756 0 : return false;
757 : }
758 0 : if ((!(Read((&((v__)->mEncodedHeight())), msg__, iter__)))) {
759 0 : FatalError("Error deserializing 'mEncodedHeight' (uint32_t) member of 'GMPVideoEncodedFrameData'");
760 0 : return false;
761 : }
762 : // Sentinel = 'mEncodedHeight'
763 0 : if ((!((msg__)->ReadSentinel(iter__, 244605666)))) {
764 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mEncodedHeight' (uint32_t) member of 'GMPVideoEncodedFrameData'");
765 0 : return false;
766 : }
767 0 : if ((!(Read((&((v__)->mTimestamp())), msg__, iter__)))) {
768 0 : FatalError("Error deserializing 'mTimestamp' (uint64_t) member of 'GMPVideoEncodedFrameData'");
769 0 : return false;
770 : }
771 : // Sentinel = 'mTimestamp'
772 0 : if ((!((msg__)->ReadSentinel(iter__, 2107530829)))) {
773 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mTimestamp' (uint64_t) member of 'GMPVideoEncodedFrameData'");
774 0 : return false;
775 : }
776 0 : if ((!(Read((&((v__)->mDuration())), msg__, iter__)))) {
777 0 : FatalError("Error deserializing 'mDuration' (uint64_t) member of 'GMPVideoEncodedFrameData'");
778 0 : return false;
779 : }
780 : // Sentinel = 'mDuration'
781 0 : if ((!((msg__)->ReadSentinel(iter__, 3773650888)))) {
782 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mDuration' (uint64_t) member of 'GMPVideoEncodedFrameData'");
783 0 : return false;
784 : }
785 0 : if ((!(Read((&((v__)->mFrameType())), msg__, iter__)))) {
786 0 : FatalError("Error deserializing 'mFrameType' (uint32_t) member of 'GMPVideoEncodedFrameData'");
787 0 : return false;
788 : }
789 : // Sentinel = 'mFrameType'
790 0 : if ((!((msg__)->ReadSentinel(iter__, 3891971702)))) {
791 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mFrameType' (uint32_t) member of 'GMPVideoEncodedFrameData'");
792 0 : return false;
793 : }
794 0 : if ((!(Read((&((v__)->mSize())), msg__, iter__)))) {
795 0 : FatalError("Error deserializing 'mSize' (uint32_t) member of 'GMPVideoEncodedFrameData'");
796 0 : return false;
797 : }
798 : // Sentinel = 'mSize'
799 0 : if ((!((msg__)->ReadSentinel(iter__, 2022816943)))) {
800 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mSize' (uint32_t) member of 'GMPVideoEncodedFrameData'");
801 0 : return false;
802 : }
803 0 : if ((!(Read((&((v__)->mBufferType())), msg__, iter__)))) {
804 0 : FatalError("Error deserializing 'mBufferType' (GMPBufferType) member of 'GMPVideoEncodedFrameData'");
805 0 : return false;
806 : }
807 : // Sentinel = 'mBufferType'
808 0 : if ((!((msg__)->ReadSentinel(iter__, 1911156444)))) {
809 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mBufferType' (GMPBufferType) member of 'GMPVideoEncodedFrameData'");
810 0 : return false;
811 : }
812 0 : if ((!(Read((&((v__)->mBuffer())), msg__, iter__)))) {
813 0 : FatalError("Error deserializing 'mBuffer' (Shmem) member of 'GMPVideoEncodedFrameData'");
814 0 : return false;
815 : }
816 : // Sentinel = 'mBuffer'
817 0 : if ((!((msg__)->ReadSentinel(iter__, 3436723048)))) {
818 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mBuffer' (Shmem) member of 'GMPVideoEncodedFrameData'");
819 0 : return false;
820 : }
821 0 : if ((!(Read((&((v__)->mCompleteFrame())), msg__, iter__)))) {
822 0 : FatalError("Error deserializing 'mCompleteFrame' (bool) member of 'GMPVideoEncodedFrameData'");
823 0 : return false;
824 : }
825 : // Sentinel = 'mCompleteFrame'
826 0 : if ((!((msg__)->ReadSentinel(iter__, 2960948789)))) {
827 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mCompleteFrame' (bool) member of 'GMPVideoEncodedFrameData'");
828 0 : return false;
829 : }
830 0 : if ((!(Read((&((v__)->mDecryptionData())), msg__, iter__)))) {
831 0 : FatalError("Error deserializing 'mDecryptionData' (GMPDecryptionData) member of 'GMPVideoEncodedFrameData'");
832 0 : return false;
833 : }
834 : // Sentinel = 'mDecryptionData'
835 0 : if ((!((msg__)->ReadSentinel(iter__, 3882545301)))) {
836 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mDecryptionData' (GMPDecryptionData) member of 'GMPVideoEncodedFrameData'");
837 0 : return false;
838 : }
839 0 : return true;
840 : }
841 :
842 0 : auto PGMPVideoEncoderParent::Write(
843 : const GMPPlaneData& v__,
844 : Message* msg__) -> void
845 : {
846 0 : Write((v__).mSize(), msg__);
847 : // Sentinel = 'mSize'
848 0 : (msg__)->WriteSentinel(2022816943);
849 0 : Write((v__).mStride(), msg__);
850 : // Sentinel = 'mStride'
851 0 : (msg__)->WriteSentinel(171840065);
852 0 : Write((v__).mBuffer(), msg__);
853 : // Sentinel = 'mBuffer'
854 0 : (msg__)->WriteSentinel(3436723048);
855 0 : }
856 :
857 0 : auto PGMPVideoEncoderParent::Read(
858 : GMPPlaneData* v__,
859 : const Message* msg__,
860 : PickleIterator* iter__) -> bool
861 : {
862 0 : if ((!(Read((&((v__)->mSize())), msg__, iter__)))) {
863 0 : FatalError("Error deserializing 'mSize' (int32_t) member of 'GMPPlaneData'");
864 0 : return false;
865 : }
866 : // Sentinel = 'mSize'
867 0 : if ((!((msg__)->ReadSentinel(iter__, 2022816943)))) {
868 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mSize' (int32_t) member of 'GMPPlaneData'");
869 0 : return false;
870 : }
871 0 : if ((!(Read((&((v__)->mStride())), msg__, iter__)))) {
872 0 : FatalError("Error deserializing 'mStride' (int32_t) member of 'GMPPlaneData'");
873 0 : return false;
874 : }
875 : // Sentinel = 'mStride'
876 0 : if ((!((msg__)->ReadSentinel(iter__, 171840065)))) {
877 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mStride' (int32_t) member of 'GMPPlaneData'");
878 0 : return false;
879 : }
880 0 : if ((!(Read((&((v__)->mBuffer())), msg__, iter__)))) {
881 0 : FatalError("Error deserializing 'mBuffer' (Shmem) member of 'GMPPlaneData'");
882 0 : return false;
883 : }
884 : // Sentinel = 'mBuffer'
885 0 : if ((!((msg__)->ReadSentinel(iter__, 3436723048)))) {
886 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mBuffer' (Shmem) member of 'GMPPlaneData'");
887 0 : return false;
888 : }
889 0 : return true;
890 : }
891 :
892 :
893 :
894 : } // namespace gmp
895 : } // namespace mozilla
|