Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
L4TMJpegLoader Namespace Reference

Functions

bool init ()
 
bool isAvailable ()
 
struct jpeg_error_mgr * std_error (struct jpeg_error_mgr *err)
 
void create_compress (j_compress_ptr cinfo)
 
void destroy_compress (j_compress_ptr cinfo)
 
void mem_dest (j_compress_ptr cinfo, unsigned char **outbuffer, unsigned long *outsize)
 
void set_defaults (j_compress_ptr cinfo)
 
void set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
 
void suppress_tables (j_compress_ptr cinfo, boolean suppress)
 
void start_compress (j_compress_ptr cinfo, boolean write_all_tables)
 
JDIMENSION write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines)
 
JDIMENSION write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines)
 
void finish_compress (j_compress_ptr cinfo)
 
void set_hardware_acceleration_parameters_enc (j_compress_ptr cinfo, boolean hw_acceleration, unsigned int defaultBuffSize, unsigned int maxBuffSize, unsigned int hwBuffSize)
 
void create_decompress (j_decompress_ptr cinfo)
 
void destroy_decompress (j_decompress_ptr cinfo)
 
void mem_src (j_decompress_ptr cinfo, unsigned char *inbuffer, unsigned long insize)
 
int read_header (j_decompress_ptr cinfo, boolean require_image)
 
boolean start_decompress (j_decompress_ptr cinfo)
 
JDIMENSION read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines)
 
boolean finish_decompress (j_decompress_ptr cinfo)
 

Detailed Description

L4TMJpegLoader - Dynamic loader for NVIDIA's libnvjpeg.so

This wrapper exists to resolve a symbol conflict between:

  1. vcpkg's libjpeg-turbo (linked statically, version 62, struct size 520/632)
  2. NVIDIA's libnvjpeg.so (contains libjpeg version 80, struct size 728/776)

L4TM modules (JPEGEncoderL4TM, JPEGDecoderL4TM) need NVIDIA's extended jpeg structs with fields like image_scale, scaled_image_width, etc.

By using dlopen/dlsym, we bypass the linker's symbol resolution and ensure L4TM code calls the correct NVIDIA implementation.

See: docs/declarative-pipeline/JETSON_KNOWN_ISSUES.md (Issue J1)

Dynamic loader for NVIDIA's libnvjpeg.so

This module resolves the libjpeg version conflict between vcpkg (v62) and NVIDIA's L4T Multimedia API (v80) by dynamically loading functions from libnvjpeg.so at runtime, bypassing the static linker.

The struct sizes differ significantly:

  • vcpkg: jpeg_compress_struct=520, jpeg_decompress_struct=632
  • NVIDIA: jpeg_compress_struct=728, jpeg_decompress_struct=776

L4TM code compiled with NVIDIA headers uses the larger structs, so we must call libnvjpeg.so's implementation which expects those struct sizes.

Function Documentation

◆ create_compress()

void L4TMJpegLoader::create_compress ( j_compress_ptr cinfo)
Here is the caller graph for this function:

◆ create_decompress()

void L4TMJpegLoader::create_decompress ( j_decompress_ptr cinfo)
Here is the caller graph for this function:

◆ destroy_compress()

void L4TMJpegLoader::destroy_compress ( j_compress_ptr cinfo)
Here is the caller graph for this function:

◆ destroy_decompress()

void L4TMJpegLoader::destroy_decompress ( j_decompress_ptr cinfo)
Here is the caller graph for this function:

◆ finish_compress()

void L4TMJpegLoader::finish_compress ( j_compress_ptr cinfo)
Here is the caller graph for this function:

◆ finish_decompress()

boolean L4TMJpegLoader::finish_decompress ( j_decompress_ptr cinfo)
Here is the caller graph for this function:

◆ init()

bool L4TMJpegLoader::init ( )

Initialize the loader. Must be called before any other functions. Thread-safe (uses call_once internally).

Returns
true if libnvjpeg.so was loaded successfully
Here is the caller graph for this function:

◆ isAvailable()

bool L4TMJpegLoader::isAvailable ( )

Check if libnvjpeg.so is available and loaded.

Returns
true if loaded and ready to use

◆ mem_dest()

void L4TMJpegLoader::mem_dest ( j_compress_ptr cinfo,
unsigned char ** outbuffer,
unsigned long * outsize )
Here is the caller graph for this function:

◆ mem_src()

void L4TMJpegLoader::mem_src ( j_decompress_ptr cinfo,
unsigned char * inbuffer,
unsigned long insize )
Here is the caller graph for this function:

◆ read_header()

int L4TMJpegLoader::read_header ( j_decompress_ptr cinfo,
boolean require_image )
Here is the caller graph for this function:

◆ read_raw_data()

JDIMENSION L4TMJpegLoader::read_raw_data ( j_decompress_ptr cinfo,
JSAMPIMAGE data,
JDIMENSION max_lines )
Here is the caller graph for this function:

◆ set_defaults()

void L4TMJpegLoader::set_defaults ( j_compress_ptr cinfo)
Here is the caller graph for this function:

◆ set_hardware_acceleration_parameters_enc()

void L4TMJpegLoader::set_hardware_acceleration_parameters_enc ( j_compress_ptr cinfo,
boolean hw_acceleration,
unsigned int defaultBuffSize,
unsigned int maxBuffSize,
unsigned int hwBuffSize )
Here is the caller graph for this function:

◆ set_quality()

void L4TMJpegLoader::set_quality ( j_compress_ptr cinfo,
int quality,
boolean force_baseline )
Here is the caller graph for this function:

◆ start_compress()

void L4TMJpegLoader::start_compress ( j_compress_ptr cinfo,
boolean write_all_tables )
Here is the caller graph for this function:

◆ start_decompress()

boolean L4TMJpegLoader::start_decompress ( j_decompress_ptr cinfo)
Here is the caller graph for this function:

◆ std_error()

struct jpeg_error_mgr * L4TMJpegLoader::std_error ( struct jpeg_error_mgr * err)
Here is the caller graph for this function:

◆ suppress_tables()

void L4TMJpegLoader::suppress_tables ( j_compress_ptr cinfo,
boolean suppress )
Here is the caller graph for this function:

◆ write_raw_data()

JDIMENSION L4TMJpegLoader::write_raw_data ( j_compress_ptr cinfo,
JSAMPIMAGE data,
JDIMENSION num_lines )
Here is the caller graph for this function:

◆ write_scanlines()

JDIMENSION L4TMJpegLoader::write_scanlines ( j_compress_ptr cinfo,
JSAMPARRAY scanlines,
JDIMENSION num_lines )
Here is the caller graph for this function: