Contents |
Blts-pixelformat package (0.1.4) provides a pixel format conversion API for the BLTS test assets.
The conversion code is based on the libswscale library of the FFMPEG project (http://www.ffmpeg.org), with modifications to remove unnecessary code. Support for additional V4L2 pixel formats has also been added.
For some pixel formats, only limited conversion support is available:
The blts-pixelformat package comes with a packaging script that can be used to build tarball out of the sources, RPM package or Debian package. To build RPM package, in the root directory execute command:
./pack.sh -r
To get packaging script help, execute command:
./pack.sh -h
The building environment requires the following RPM packages installed:
Some of blts test packages have dependency to the blts-pixelformat package and blts-pixelformat package itself has dependency to the blts-common package.
The test environment must have following packages installed:
The library package can be installed in the device by executing the command:
rpm -ivh libbltspixelformat1_{version}.rpm
The development package can be installed by executing the command:
rpm -ivh libbltspixelformat-devel_{version}.rpm
The pixel format conversion API is defined in the file blts-pixelformat.h and at the moment there is only one conversion function to use convert_buffer():
#include <blts-pixelformat.h> #include <linux/videodev2.h> //for pixel format identifiers int convert_buffer(int width, int height, const unsigned char* srcbuffer, __u32 srcformat, unsigned char** dstbuffer, __u32 dstformat);
convert_buffer() converts the image data in srcbuffer from the source pixel format to the destination pixel format. After a successful conversion, dstbuffer contains a pointer to the converted image buffer. The buffer is allocated dynamically in the conversion function, and must be freed by the caller.
After a successful conversion, dstbuffer contains a pointer to the converted image, and the function returns the size of the converted image in bytes.
If the conversion fails, an error code is returned:
The pixel formats are specified with V4L2 pixel format identifiers. The supported formats are:
Both Debian and RPM packaging is provided.
The blts-pixelformat package consists of libbltspixelformat1 runtime library and libbltspixelformat-devel development library.
| blts-pixelformat | blts-pixelformat library |
| www.ffmpeg.org | FFmpeg project |
| linux.bytesex.org | video4linux website |
| Version | Date | Handled By | Status | Comments |
|---|---|---|---|---|
| 0.1 | 15-Dec-2010 | Aki Nyman | Draft | Page created (refers to blts-pixelformat package 0.1.4) |