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

Method process

src/turbo_jpeg_rgb_packet_processor.cpp:86–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void TurboJpegRgbPacketProcessor::process(const RgbPacket &packet)
87{
88 if(impl_->decompressor != 0 && listener_ != 0)
89 {
90 impl_->startTiming();
91
92 impl_->frame->timestamp = packet.timestamp;
93 impl_->frame->sequence = packet.sequence;
94 impl_->frame->exposure = packet.exposure;
95 impl_->frame->gain = packet.gain;
96 impl_->frame->gamma = packet.gamma;
97
98 int r = tjDecompress2(impl_->decompressor, packet.jpeg_buffer, packet.jpeg_buffer_length, impl_->frame->data, 1920, 1920 * tjPixelSize[TJPF_BGRX], 1080, TJPF_BGRX, 0);
99
100 impl_->stopTiming(LOG_INFO);
101
102 if(r == 0)
103 {
104 if(listener_->onNewFrame(Frame::Color, impl_->frame))
105 {
106 impl_->newFrame();
107 }
108 }
109 else
110 {
111 LOG_ERROR << "Failed to decompress rgb image! TurboJPEG error: '" << tjGetErrorStr() << "'";
112 }
113
114 }
115}
116
117} /* namespace libfreenect2 */

Callers

nothing calls this directly

Calls 3

startTimingMethod · 0.80
onNewFrameMethod · 0.80
newFrameMethod · 0.45

Tested by

no test coverage detected