/work/obj-fuzz/ipc/ipdl/PGMPVideoEncoderChild.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Automatically generated by ipdlc. |
3 | | // Edit at your own risk |
4 | | // |
5 | | |
6 | | |
7 | | #include "mozilla/gmp/PGMPVideoEncoderChild.h" |
8 | | |
9 | | #include "mozilla/gmp/PGMPContentChild.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace gmp { |
16 | | |
17 | | |
18 | | auto PGMPVideoEncoderChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | | MOZ_IMPLICIT PGMPVideoEncoderChild::PGMPVideoEncoderChild() : |
23 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
24 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
25 | 0 | { |
26 | 0 | MOZ_COUNT_CTOR(PGMPVideoEncoderChild); |
27 | 0 | } |
28 | | |
29 | | PGMPVideoEncoderChild::~PGMPVideoEncoderChild() |
30 | 0 | { |
31 | 0 | MOZ_COUNT_DTOR(PGMPVideoEncoderChild); |
32 | 0 | } |
33 | | |
34 | | auto PGMPVideoEncoderChild::Manager() const -> PGMPContentChild* |
35 | 0 | { |
36 | 0 | return static_cast<PGMPContentChild*>(IProtocol::Manager()); |
37 | 0 | } |
38 | | |
39 | | auto PGMPVideoEncoderChild::Send__delete__(PGMPVideoEncoderChild* actor) -> bool |
40 | 0 | { |
41 | 0 | if ((!(actor))) { |
42 | 0 | return false; |
43 | 0 | } |
44 | 0 | |
45 | 0 | IPC::Message* msg__ = PGMPVideoEncoder::Msg___delete__((actor)->Id()); |
46 | 0 |
|
47 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
48 | 0 | WriteIPDLParam(msg__, actor, actor); |
49 | 0 | // Sentinel = 'actor' |
50 | 0 | (msg__)->WriteSentinel(875202478); |
51 | 0 |
|
52 | 0 |
|
53 | 0 |
|
54 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
55 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
56 | 0 | } |
57 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg___delete__", OTHER); |
58 | 0 | if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) { |
59 | 0 | mozilla::ipc::LogicError("Transition error"); |
60 | 0 | } |
61 | 0 |
|
62 | 0 | bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__); |
63 | 0 |
|
64 | 0 | IProtocol* mgr = (actor)->Manager(); |
65 | 0 | (actor)->DestroySubtree(Deletion); |
66 | 0 | (actor)->DeallocSubtree(); |
67 | 0 | (mgr)->RemoveManagee(PGMPVideoEncoderMsgStart, actor); |
68 | 0 | return sendok__; |
69 | 0 | } |
70 | | |
71 | | auto PGMPVideoEncoderChild::SendEncoded( |
72 | | const GMPVideoEncodedFrameData& aEncodedFrame, |
73 | | const nsTArray<uint8_t>& aCodecSpecificInfo) -> bool |
74 | 0 | { |
75 | 0 | IPC::Message* msg__ = PGMPVideoEncoder::Msg_Encoded(Id()); |
76 | 0 |
|
77 | 0 | WriteIPDLParam(msg__, this, aEncodedFrame); |
78 | 0 | // Sentinel = 'aEncodedFrame' |
79 | 0 | (msg__)->WriteSentinel(3455883009); |
80 | 0 | WriteIPDLParam(msg__, this, aCodecSpecificInfo); |
81 | 0 | // Sentinel = 'aCodecSpecificInfo' |
82 | 0 | (msg__)->WriteSentinel(742576219); |
83 | 0 |
|
84 | 0 |
|
85 | 0 |
|
86 | 0 |
|
87 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
88 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
89 | 0 | } |
90 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Encoded", OTHER); |
91 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
92 | 0 | mozilla::ipc::LogicError("Transition error"); |
93 | 0 | } |
94 | 0 |
|
95 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
96 | 0 | return sendok__; |
97 | 0 | } |
98 | | |
99 | | auto PGMPVideoEncoderChild::SendError(const GMPErr& aErr) -> bool |
100 | 0 | { |
101 | 0 | IPC::Message* msg__ = PGMPVideoEncoder::Msg_Error(Id()); |
102 | 0 |
|
103 | 0 | WriteIPDLParam(msg__, this, aErr); |
104 | 0 | // Sentinel = 'aErr' |
105 | 0 | (msg__)->WriteSentinel(540683382); |
106 | 0 |
|
107 | 0 |
|
108 | 0 |
|
109 | 0 |
|
110 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
111 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
112 | 0 | } |
113 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Error", OTHER); |
114 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
115 | 0 | mozilla::ipc::LogicError("Transition error"); |
116 | 0 | } |
117 | 0 |
|
118 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
119 | 0 | return sendok__; |
120 | 0 | } |
121 | | |
122 | | auto PGMPVideoEncoderChild::SendShutdown() -> bool |
123 | 0 | { |
124 | 0 | IPC::Message* msg__ = PGMPVideoEncoder::Msg_Shutdown(Id()); |
125 | 0 |
|
126 | 0 |
|
127 | 0 |
|
128 | 0 |
|
129 | 0 |
|
130 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
131 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
132 | 0 | } |
133 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Shutdown", OTHER); |
134 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
135 | 0 | mozilla::ipc::LogicError("Transition error"); |
136 | 0 | } |
137 | 0 |
|
138 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
139 | 0 | return sendok__; |
140 | 0 | } |
141 | | |
142 | | auto PGMPVideoEncoderChild::SendParentShmemForPool(Shmem& aFrameBuffer) -> bool |
143 | 0 | { |
144 | 0 | IPC::Message* msg__ = PGMPVideoEncoder::Msg_ParentShmemForPool(Id()); |
145 | 0 |
|
146 | 0 | WriteIPDLParam(msg__, this, aFrameBuffer); |
147 | 0 | // Sentinel = 'aFrameBuffer' |
148 | 0 | (msg__)->WriteSentinel(3888831322); |
149 | 0 |
|
150 | 0 |
|
151 | 0 |
|
152 | 0 |
|
153 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
154 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
155 | 0 | } |
156 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_ParentShmemForPool", OTHER); |
157 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
158 | 0 | mozilla::ipc::LogicError("Transition error"); |
159 | 0 | } |
160 | 0 |
|
161 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
162 | 0 | return sendok__; |
163 | 0 | } |
164 | | |
165 | | auto PGMPVideoEncoderChild::CallNeedShmem( |
166 | | const uint32_t& aEncodedBufferSize, |
167 | | Shmem* aMem) -> bool |
168 | 0 | { |
169 | 0 | IPC::Message* msg__ = PGMPVideoEncoder::Msg_NeedShmem(Id()); |
170 | 0 |
|
171 | 0 | WriteIPDLParam(msg__, this, aEncodedBufferSize); |
172 | 0 | // Sentinel = 'aEncodedBufferSize' |
173 | 0 | (msg__)->WriteSentinel(2299884566); |
174 | 0 |
|
175 | 0 |
|
176 | 0 |
|
177 | 0 | Message reply__; |
178 | 0 |
|
179 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
180 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
181 | 0 | } |
182 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_NeedShmem", OTHER); |
183 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
184 | 0 | mozilla::ipc::LogicError("Transition error"); |
185 | 0 | } |
186 | 0 |
|
187 | 0 | bool sendok__; |
188 | 0 | { |
189 | 0 | AUTO_PROFILER_TRACING("IPC", "PGMPVideoEncoder::Msg_NeedShmem"); |
190 | 0 | sendok__ = (GetIPCChannel())->Call(msg__, (&(reply__))); |
191 | 0 | } |
192 | 0 | if ((!(sendok__))) { |
193 | 0 | return false; |
194 | 0 | } |
195 | 0 | |
196 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
197 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
198 | 0 | } |
199 | 0 |
|
200 | 0 | PickleIterator iter__(reply__); |
201 | 0 |
|
202 | 0 | if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aMem)))) { |
203 | 0 | FatalError("Error deserializing 'Shmem'"); |
204 | 0 | return false; |
205 | 0 | } |
206 | 0 | // Sentinel = 'aMem' |
207 | 0 | if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3574578916)))) { |
208 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'"); |
209 | 0 | return false; |
210 | 0 | } |
211 | 0 | (reply__).EndRead(iter__, (reply__).type()); |
212 | 0 |
|
213 | 0 | return true; |
214 | 0 | } |
215 | | |
216 | | auto PGMPVideoEncoderChild::RemoveManagee( |
217 | | int32_t aProtocolId, |
218 | | IProtocol* aListener) -> void |
219 | 0 | { |
220 | 0 | FatalError("unreached"); |
221 | 0 | return; |
222 | 0 | } |
223 | | |
224 | | auto PGMPVideoEncoderChild::OnMessageReceived(const Message& msg__) -> PGMPVideoEncoderChild::Result |
225 | 0 | { |
226 | 0 | switch ((msg__).type()) { |
227 | 0 | case PGMPVideoEncoder::Msg_InitEncode__ID: |
228 | 0 | { |
229 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
230 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
231 | 0 | } |
232 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_InitEncode", OTHER); |
233 | 0 |
|
234 | 0 | PickleIterator iter__(msg__); |
235 | 0 | GMPVideoCodec aCodecSettings; |
236 | 0 | nsTArray<uint8_t> aCodecSpecific; |
237 | 0 | int32_t aNumberOfCores; |
238 | 0 | uint32_t aMaxPayloadSize; |
239 | 0 |
|
240 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aCodecSettings)))))) { |
241 | 0 | FatalError("Error deserializing 'GMPVideoCodec'"); |
242 | 0 | return MsgValueError; |
243 | 0 | } |
244 | 0 | // Sentinel = 'aCodecSettings' |
245 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 394896860)))) { |
246 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoCodec'"); |
247 | 0 | return MsgValueError; |
248 | 0 | } |
249 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aCodecSpecific)))))) { |
250 | 0 | FatalError("Error deserializing 'nsTArray'"); |
251 | 0 | return MsgValueError; |
252 | 0 | } |
253 | 0 | // Sentinel = 'aCodecSpecific' |
254 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3773952059)))) { |
255 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
256 | 0 | return MsgValueError; |
257 | 0 | } |
258 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aNumberOfCores)))))) { |
259 | 0 | FatalError("Error deserializing 'int32_t'"); |
260 | 0 | return MsgValueError; |
261 | 0 | } |
262 | 0 | // Sentinel = 'aNumberOfCores' |
263 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3247212389)))) { |
264 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'"); |
265 | 0 | return MsgValueError; |
266 | 0 | } |
267 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aMaxPayloadSize)))))) { |
268 | 0 | FatalError("Error deserializing 'uint32_t'"); |
269 | 0 | return MsgValueError; |
270 | 0 | } |
271 | 0 | // Sentinel = 'aMaxPayloadSize' |
272 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4078750881)))) { |
273 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
274 | 0 | return MsgValueError; |
275 | 0 | } |
276 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
277 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
278 | 0 | FatalError("Transition error"); |
279 | 0 | return MsgValueError; |
280 | 0 | } |
281 | 0 | if ((!(RecvInitEncode(aCodecSettings, std::move(aCodecSpecific), aNumberOfCores, aMaxPayloadSize)))) { |
282 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
283 | 0 | // Error handled in mozilla::ipc::IPCResult |
284 | 0 | return MsgProcessingError; |
285 | 0 | } |
286 | 0 | |
287 | 0 | return MsgProcessed; |
288 | 0 | } |
289 | 0 | case PGMPVideoEncoder::Msg_Encode__ID: |
290 | 0 | { |
291 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
292 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
293 | 0 | } |
294 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_Encode", OTHER); |
295 | 0 |
|
296 | 0 | PickleIterator iter__(msg__); |
297 | 0 | GMPVideoi420FrameData aInputFrame; |
298 | 0 | nsTArray<uint8_t> aCodecSpecificInfo; |
299 | 0 | nsTArray<GMPVideoFrameType> aFrameTypes; |
300 | 0 |
|
301 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aInputFrame)))))) { |
302 | 0 | FatalError("Error deserializing 'GMPVideoi420FrameData'"); |
303 | 0 | return MsgValueError; |
304 | 0 | } |
305 | 0 | // Sentinel = 'aInputFrame' |
306 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3664588317)))) { |
307 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'GMPVideoi420FrameData'"); |
308 | 0 | return MsgValueError; |
309 | 0 | } |
310 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aCodecSpecificInfo)))))) { |
311 | 0 | FatalError("Error deserializing 'nsTArray'"); |
312 | 0 | return MsgValueError; |
313 | 0 | } |
314 | 0 | // Sentinel = 'aCodecSpecificInfo' |
315 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 742576219)))) { |
316 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
317 | 0 | return MsgValueError; |
318 | 0 | } |
319 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aFrameTypes)))))) { |
320 | 0 | FatalError("Error deserializing 'nsTArray'"); |
321 | 0 | return MsgValueError; |
322 | 0 | } |
323 | 0 | // Sentinel = 'aFrameTypes' |
324 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2159018888)))) { |
325 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
326 | 0 | return MsgValueError; |
327 | 0 | } |
328 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
329 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
330 | 0 | FatalError("Transition error"); |
331 | 0 | return MsgValueError; |
332 | 0 | } |
333 | 0 | if ((!(RecvEncode(aInputFrame, std::move(aCodecSpecificInfo), std::move(aFrameTypes))))) { |
334 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
335 | 0 | // Error handled in mozilla::ipc::IPCResult |
336 | 0 | return MsgProcessingError; |
337 | 0 | } |
338 | 0 | |
339 | 0 | return MsgProcessed; |
340 | 0 | } |
341 | 0 | case PGMPVideoEncoder::Msg_SetChannelParameters__ID: |
342 | 0 | { |
343 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
344 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
345 | 0 | } |
346 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_SetChannelParameters", OTHER); |
347 | 0 |
|
348 | 0 | PickleIterator iter__(msg__); |
349 | 0 | uint32_t aPacketLoss; |
350 | 0 | uint32_t aRTT; |
351 | 0 |
|
352 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aPacketLoss)))))) { |
353 | 0 | FatalError("Error deserializing 'uint32_t'"); |
354 | 0 | return MsgValueError; |
355 | 0 | } |
356 | 0 | // Sentinel = 'aPacketLoss' |
357 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 767954619)))) { |
358 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
359 | 0 | return MsgValueError; |
360 | 0 | } |
361 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRTT)))))) { |
362 | 0 | FatalError("Error deserializing 'uint32_t'"); |
363 | 0 | return MsgValueError; |
364 | 0 | } |
365 | 0 | // Sentinel = 'aRTT' |
366 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1233438341)))) { |
367 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
368 | 0 | return MsgValueError; |
369 | 0 | } |
370 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
371 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
372 | 0 | FatalError("Transition error"); |
373 | 0 | return MsgValueError; |
374 | 0 | } |
375 | 0 | if ((!(RecvSetChannelParameters(aPacketLoss, aRTT)))) { |
376 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
377 | 0 | // Error handled in mozilla::ipc::IPCResult |
378 | 0 | return MsgProcessingError; |
379 | 0 | } |
380 | 0 | |
381 | 0 | return MsgProcessed; |
382 | 0 | } |
383 | 0 | case PGMPVideoEncoder::Msg_SetRates__ID: |
384 | 0 | { |
385 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
386 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
387 | 0 | } |
388 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_SetRates", OTHER); |
389 | 0 |
|
390 | 0 | PickleIterator iter__(msg__); |
391 | 0 | uint32_t aNewBitRate; |
392 | 0 | uint32_t aFrameRate; |
393 | 0 |
|
394 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aNewBitRate)))))) { |
395 | 0 | FatalError("Error deserializing 'uint32_t'"); |
396 | 0 | return MsgValueError; |
397 | 0 | } |
398 | 0 | // Sentinel = 'aNewBitRate' |
399 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1554340975)))) { |
400 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
401 | 0 | return MsgValueError; |
402 | 0 | } |
403 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aFrameRate)))))) { |
404 | 0 | FatalError("Error deserializing 'uint32_t'"); |
405 | 0 | return MsgValueError; |
406 | 0 | } |
407 | 0 | // Sentinel = 'aFrameRate' |
408 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 770773236)))) { |
409 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
410 | 0 | return MsgValueError; |
411 | 0 | } |
412 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
413 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
414 | 0 | FatalError("Transition error"); |
415 | 0 | return MsgValueError; |
416 | 0 | } |
417 | 0 | if ((!(RecvSetRates(aNewBitRate, aFrameRate)))) { |
418 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
419 | 0 | // Error handled in mozilla::ipc::IPCResult |
420 | 0 | return MsgProcessingError; |
421 | 0 | } |
422 | 0 | |
423 | 0 | return MsgProcessed; |
424 | 0 | } |
425 | 0 | case PGMPVideoEncoder::Msg_SetPeriodicKeyFrames__ID: |
426 | 0 | { |
427 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
428 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
429 | 0 | } |
430 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_SetPeriodicKeyFrames", OTHER); |
431 | 0 |
|
432 | 0 | PickleIterator iter__(msg__); |
433 | 0 | bool aEnable; |
434 | 0 |
|
435 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aEnable)))))) { |
436 | 0 | FatalError("Error deserializing 'bool'"); |
437 | 0 | return MsgValueError; |
438 | 0 | } |
439 | 0 | // Sentinel = 'aEnable' |
440 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 163837555)))) { |
441 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
442 | 0 | return MsgValueError; |
443 | 0 | } |
444 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
445 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
446 | 0 | FatalError("Transition error"); |
447 | 0 | return MsgValueError; |
448 | 0 | } |
449 | 0 | if ((!(RecvSetPeriodicKeyFrames(aEnable)))) { |
450 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
451 | 0 | // Error handled in mozilla::ipc::IPCResult |
452 | 0 | return MsgProcessingError; |
453 | 0 | } |
454 | 0 | |
455 | 0 | return MsgProcessed; |
456 | 0 | } |
457 | 0 | case PGMPVideoEncoder::Msg_EncodingComplete__ID: |
458 | 0 | { |
459 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
460 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
461 | 0 | } |
462 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_EncodingComplete", OTHER); |
463 | 0 |
|
464 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
465 | 0 | FatalError("Transition error"); |
466 | 0 | return MsgValueError; |
467 | 0 | } |
468 | 0 | if ((!(RecvEncodingComplete()))) { |
469 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
470 | 0 | // Error handled in mozilla::ipc::IPCResult |
471 | 0 | return MsgProcessingError; |
472 | 0 | } |
473 | 0 | |
474 | 0 | return MsgProcessed; |
475 | 0 | } |
476 | 0 | case PGMPVideoEncoder::Msg_ChildShmemForPool__ID: |
477 | 0 | { |
478 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPVideoEncoderChild")) { |
479 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPVideoEncoderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
480 | 0 | } |
481 | 0 | AUTO_PROFILER_LABEL("PGMPVideoEncoder::Msg_ChildShmemForPool", OTHER); |
482 | 0 |
|
483 | 0 | PickleIterator iter__(msg__); |
484 | 0 | Shmem aEncodedBuffer; |
485 | 0 |
|
486 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aEncodedBuffer)))))) { |
487 | 0 | FatalError("Error deserializing 'Shmem'"); |
488 | 0 | return MsgValueError; |
489 | 0 | } |
490 | 0 | // Sentinel = 'aEncodedBuffer' |
491 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3335299401)))) { |
492 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'Shmem'"); |
493 | 0 | return MsgValueError; |
494 | 0 | } |
495 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
496 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
497 | 0 | FatalError("Transition error"); |
498 | 0 | return MsgValueError; |
499 | 0 | } |
500 | 0 | if ((!(RecvChildShmemForPool(std::move(aEncodedBuffer))))) { |
501 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
502 | 0 | // Error handled in mozilla::ipc::IPCResult |
503 | 0 | return MsgProcessingError; |
504 | 0 | } |
505 | 0 | |
506 | 0 | return MsgProcessed; |
507 | 0 | } |
508 | 0 | case PGMPVideoEncoder::Reply___delete____ID: |
509 | 0 | { |
510 | 0 | return MsgProcessed; |
511 | 0 | } |
512 | 0 | default: |
513 | 0 | { |
514 | 0 | return MsgNotKnown; |
515 | 0 | } |
516 | 0 | } |
517 | 0 | } |
518 | | |
519 | | auto PGMPVideoEncoderChild::OnMessageReceived( |
520 | | const Message& msg__, |
521 | | Message*& reply__) -> PGMPVideoEncoderChild::Result |
522 | 0 | { |
523 | 0 | return MsgNotKnown; |
524 | 0 | } |
525 | | |
526 | | auto PGMPVideoEncoderChild::OnCallReceived( |
527 | | const Message& msg__, |
528 | | Message*& reply__) -> PGMPVideoEncoderChild::Result |
529 | 0 | { |
530 | 0 | return MsgNotKnown; |
531 | 0 | } |
532 | | |
533 | | auto PGMPVideoEncoderChild::GetProtocolTypeId() -> int32_t |
534 | 0 | { |
535 | 0 | return PGMPVideoEncoderMsgStart; |
536 | 0 | } |
537 | | |
538 | | auto PGMPVideoEncoderChild::DestroySubtree(ActorDestroyReason why) -> void |
539 | 0 | { |
540 | 0 | // Unregister from our manager. |
541 | 0 | Unregister(Id()); |
542 | 0 |
|
543 | 0 | // Reject owning pending responses. |
544 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
545 | 0 |
|
546 | 0 | // Finally, destroy "us". |
547 | 0 | ActorDestroy(why); |
548 | 0 | } |
549 | | |
550 | | auto PGMPVideoEncoderChild::DeallocSubtree() -> void |
551 | 0 | { |
552 | 0 | } |
553 | | |
554 | | |
555 | | |
556 | | } // namespace gmp |
557 | | } // namespace mozilla |
558 | | namespace mozilla { |
559 | | namespace ipc { |
560 | | auto IPDLParamTraits<mozilla::gmp::PGMPVideoEncoderChild>::Write( |
561 | | IPC::Message* aMsg, |
562 | | mozilla::ipc::IProtocol* aActor, |
563 | | const paramType& aVar) -> void |
564 | 0 | { |
565 | 0 | int32_t id; |
566 | 0 | if ((!(aVar))) { |
567 | 0 | id = 0; |
568 | 0 | } |
569 | 0 | else { |
570 | 0 | id = (aVar)->Id(); |
571 | 0 | if ((1) == (id)) { |
572 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
573 | 0 | } |
574 | 0 | } |
575 | 0 | WriteIPDLParam(aMsg, aActor, id); |
576 | 0 | } |
577 | | |
578 | | auto IPDLParamTraits<mozilla::gmp::PGMPVideoEncoderChild>::Read( |
579 | | const IPC::Message* aMsg, |
580 | | PickleIterator* aIter, |
581 | | mozilla::ipc::IProtocol* aActor, |
582 | | paramType* aVar) -> bool |
583 | 0 | { |
584 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PGMPVideoEncoder", PGMPVideoEncoderMsgStart); |
585 | 0 | if ((actor).isNothing()) { |
586 | 0 | return false; |
587 | 0 | } |
588 | 0 | |
589 | 0 | (*(aVar)) = static_cast<mozilla::gmp::PGMPVideoEncoderChild*>((actor).value()); |
590 | 0 | return true; |
591 | 0 | } |
592 | | |
593 | | } // namespace ipc |
594 | | } // namespace mozilla |