NAME

UAV::Pilot::Video::JPEGDecoder

SYNOPSIS

# $display is some object that does the role UAV::Pilot::Video::RawHandler, like 
# UAV::Pilot::SDL::Video
my $display = ...;

my $decoder = UAV::Pilot::Video::JPEGDecoder->new({
    displays => [ $display ],
});

DESCRIPTION

Decodes a JPEG image using ffmpeg. Does the UAV::Pilot::Video::JPEGHandler role.

Like UAV::Pilot::Video::H264Handler, this can be used to decode a stream of JPEG images for real-time video.

FETCHING LAST PROCESSED FRAME

After a frame is decoded, there are two ways to fetch it: a fast way for things implemented in C, and a slow way for things implemented in Perl.

get_last_frame_c_obj

Returns a scalar which contains a pointer to the decoded AVFrame object. In C, you can dereference the pointer to get the AVFrame and handle it from there.

get_last_frame_pixel_arrayref

Converts data of the three YUV channels into one array each, and then pushes those onto an array and returns the an arrayref. This is really, really slow, and not at all suitable for real-time processing. It has the advantage that you can do everything in Perl.