MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / process

Method process

src/opengl_depth_packet_processor.cpp:956–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956void OpenGLDepthPacketProcessor::process(const DepthPacket &packet)
957{
958 if (!listener_)
959 return;
960 Frame *ir = 0, *depth = 0;
961
962 impl_->startTiming();
963
964 glfwMakeContextCurrent(impl_->opengl_context_ptr);
965
966 std::copy(packet.buffer, packet.buffer + packet.buffer_length/10*9, impl_->input_data.data);
967 impl_->input_data.upload();
968 impl_->run(&ir, &depth);
969
970 if(impl_->do_debug) glfwSwapBuffers(impl_->opengl_context_ptr);
971
972 impl_->stopTiming(LOG_INFO);
973
974 ir->timestamp = packet.timestamp;
975 depth->timestamp = packet.timestamp;
976 ir->sequence = packet.sequence;
977 depth->sequence = packet.sequence;
978
979 if(!listener_->onNewFrame(Frame::Ir, ir))
980 delete ir;
981
982 if(!listener_->onNewFrame(Frame::Depth, depth))
983 delete depth;
984}
985
986} /* namespace libfreenect2 */

Callers

nothing calls this directly

Calls 5

copyFunction · 0.85
startTimingMethod · 0.80
onNewFrameMethod · 0.80
uploadMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected