(self, task=None)
| 252 | return r |
| 253 | |
| 254 | def process(self, task=None): |
| 255 | # create c task |
| 256 | c_task = csdk.Task(c_module.to_str_array(task.get_inputs().keys()), |
| 257 | c_module.to_str_array(task.get_outputs().keys())) |
| 258 | c_task.set_timestamp(task.get_timestamp()) |
| 259 | |
| 260 | # convert python packet to c packet |
| 261 | # and add to c task queue |
| 262 | for (label, queue) in task.get_inputs().items(): |
| 263 | while not queue.empty(): |
| 264 | py_pkt = queue.get() |
| 265 | c_pkt = self.python_packet_to_c_packet(py_pkt) |
| 266 | if c_pkt is not None and c_pkt.defined(): |
| 267 | c_task.add_packet_to_in_queue(str(label), c_pkt) |
| 268 | Log.log_node(LogLevel.ERROR, task.node_, "push frame", |
| 269 | c_pkt.py_get_data()) |
| 270 | |
| 271 | # call process of c module |
| 272 | self.c_mod_.process(c_task) |
| 273 | task.set_timestamp(c_task.get_timestamp()) |
| 274 | |
| 275 | # get c output packets, convert to python packet |
| 276 | # and add to python output queue |
| 277 | for (label, queue) in task.get_outputs().items(): |
| 278 | while c_task.is_out_queue_empty(str(label)) == 0: |
| 279 | c_pkt = csdk.Packet() |
| 280 | c_task.pop_packet_from_out_queue(str(label), c_pkt) |
| 281 | py_pkt = self.c_packet_to_python_packet(c_pkt) |
| 282 | if py_pkt is not None and py_pkt.defined(): |
| 283 | queue.put(py_pkt) |
| 284 | Log.log_node(LogLevel.ERROR, task.node_, "pull frame", |
| 285 | py_pkt.get_data()) |
| 286 | |
| 287 | return ProcessResult.OK |
nothing calls this directly
no test coverage detected