| 954 | } |
| 955 | |
| 956 | void 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 */ |
nothing calls this directly
no test coverage detected