#include <NvJpegDecoder.h>
Public Member Functions | |
~NvJPEGDecoder () | |
int | decodeToFd (int &fd, unsigned char *in_buf, unsigned long in_buf_size, uint32_t &pixfmt, uint32_t &width, uint32_t &height) |
Decodes a JPEG image to hardware buffer memory. | |
int | decodeToBuffer (NvBuffer **buffer, unsigned char *in_buf, unsigned long in_buf_size, uint32_t *pixfmt, uint32_t *width, uint32_t *height) |
Decodes a JPEG image to software buffer memory. | |
Static Public Member Functions | |
static NvJPEGDecoder * | createJPEGDecoder (const char *comp_name) |
Creates a new JPEG Decoder named comp_name. | |
Private Member Functions | |
NvJPEGDecoder (const char *comp_name) | |
Private Attributes | |
struct jpeg_decompress_struct | cinfo |
struct jpeg_error_mgr | jerr |
Static Private Attributes | |
static const NvElementProfiler::ProfilerField | valid_fields |
NvJPEGDecoder
uses the libjpeg
APIs for decoding JPEG images. It supports two methods for decoding:
DMABUF
and return its file descriptor (FD).malloc
).The jpeg decoder is capable of decoding YUV420, YUV422 and YUV444 jpeg images.
JCS_YCbCr
(YUV420) color space is currently supported. Definition at line 86 of file NvJpegDecoder.h.
NvJPEGDecoder::~NvJPEGDecoder | ( | ) |
Definition at line 63 of file NvJpegDecoder.cpp.
NvJPEGDecoder::NvJPEGDecoder | ( | const char * | comp_name | ) | [private] |
Definition at line 41 of file NvJpegDecoder.cpp.
NvJPEGDecoder * NvJPEGDecoder::createJPEGDecoder | ( | const char * | comp_name | ) | [static] |
Creates a new JPEG Decoder named comp_name.
Definition at line 52 of file NvJpegDecoder.cpp.
int NvJPEGDecoder::decodeToBuffer | ( | NvBuffer ** | buffer, | |
unsigned char * | in_buf, | |||
unsigned long | in_buf_size, | |||
uint32_t * | pixfmt, | |||
uint32_t * | width, | |||
uint32_t * | height | |||
) |
Decodes a JPEG image to software buffer memory.
This method decodes JPEG images in software memory to a specified width and size.
decodeToBuffer
method is slower than the NvJPEGDecoder::decodeToFd method because it involves conversion from hardware buffer memory to software buffer memory.[out] | buffer | Indicates NvBuffer object to contain the decoded image. The object is allocated by the method and the buffer memory is allocated using NvBuffer::allocateMemory. |
[in] | in_buf | Specfies a pointer to the memory containing the JPEG. |
[in] | in_buf_size | Specifies the size of the input buffer in bytes. |
[out] | pixfmt | Indicates a pointer to the v4l2 pixel format of the decoded image. |
[out] | width | Indicates a pointer to the width of the decoded image in pixels. |
[out] | height | Indicates a pointer to the height of the decoded image in pixels. |
Definition at line 136 of file NvJpegDecoder.cpp.
int NvJPEGDecoder::decodeToFd | ( | int & | fd, | |
unsigned char * | in_buf, | |||
unsigned long | in_buf_size, | |||
uint32_t & | pixfmt, | |||
uint32_t & | width, | |||
uint32_t & | height | |||
) |
Decodes a JPEG image to hardware buffer memory.
This method decodes JPEG images in hardware memory to a specified width and size.
[out] | fd | Indicates the file descriptor (FD) of the hardware buffer. |
[in] | in_buf | Specifies a pointer to the memory containing the JPEG image. |
[in] | in_buf_size | Specifies the size of the input buffer in bytes. |
[out] | pixfmt | Indicates a reference to the v4l2 pixel format of the decoded image. |
[out] | width | Indicates a reference to the width of the decoded image in pixels. |
[out] | height | Indicates a reference to the height of the decoded image in pixels. |
Definition at line 70 of file NvJpegDecoder.cpp.
struct jpeg_decompress_struct NvJPEGDecoder::cinfo [read, private] |
Definition at line 153 of file NvJpegDecoder.h.
struct jpeg_error_mgr NvJPEGDecoder::jerr [read, private] |
Definition at line 154 of file NvJpegDecoder.h.
const NvElementProfiler::ProfilerField NvJPEGDecoder::valid_fields [static, private] |
Initial value:
Definition at line 156 of file NvJpegDecoder.h.