Skip to content

Added sequence in Frame #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/protonect/include/libfreenect2/frame_listener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define FRAME_LISTENER_HPP_

#include <cstddef>
#include <stdint.h>
#include <libfreenect2/config.h>

namespace libfreenect2
Expand All @@ -44,6 +45,7 @@ struct LIBFREENECT2_API Frame

size_t width, height, bytes_per_pixel;
unsigned char* data;
uint32_t sequence;

Frame(size_t width, size_t height, size_t bytes_per_pixel) :
width(width),
Expand Down
3 changes: 3 additions & 0 deletions examples/protonect/src/cpu_depth_packet_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,9 @@ void CpuDepthPacketProcessor::process(const DepthPacket &packet)
}
}

impl_->ir_frame->sequence = packet.sequence;
impl_->depth_frame->sequence = packet.sequence;

if(listener_->onNewFrame(Frame::Ir, impl_->ir_frame))
{
impl_->newIrFrame();
Expand Down
3 changes: 3 additions & 0 deletions examples/protonect/src/opencl_depth_packet_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ void OpenCLDepthPacketProcessor::process(const DepthPacket &packet)

impl_->stopTiming();

impl_->ir_frame->sequence = packet.sequence;
impl_->depth_frame->sequence = packet.sequence;

if(has_listener)
{
if(this->listener_->onNewFrame(Frame::Ir, impl_->ir_frame))
Expand Down
3 changes: 3 additions & 0 deletions examples/protonect/src/opengl_depth_packet_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,9 @@ void OpenGLDepthPacketProcessor::process(const DepthPacket &packet)

impl_->stopTiming();

ir->sequence = packet.sequence;
depth->sequence = packet.sequence;

if(has_listener)
{
if(!this->listener_->onNewFrame(Frame::Ir, ir))
Expand Down
3 changes: 2 additions & 1 deletion examples/protonect/src/turbo_jpeg_rgb_packet_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void TurboJpegRgbPacketProcessor::process(const RgbPacket &packet)

if(r == 0)
{
impl_->frame->sequence = packet.sequence;
if(listener_->onNewFrame(Frame::Color, impl_->frame))
{
impl_->newFrame();
Expand All @@ -126,7 +127,7 @@ void TurboJpegRgbPacketProcessor::process(const RgbPacket &packet)
std::cerr << "[TurboJpegRgbPacketProcessor::doProcess] Failed to decompress rgb image! TurboJPEG error: '" << tjGetErrorStr() << "'" << std::endl;
}

impl_->stopTiming();
impl_->stopTiming();
}
}

Expand Down