| 84 | } |
| 85 | |
| 86 | void 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 */ |
nothing calls this directly
no test coverage detected