Go to the source code of this file.
Typedefs | |
| typedef struct _NvOBBDumpCtx | NvOBBDumpCtx |
| OBB dump context handle. More... | |
Functions | |
| NvOBBDumpCtx * | nvobb_dump_create_context (int gpu_id, cudaStream_t cuda_stream) |
| Create OBB dump context. More... | |
| void | nvobb_dump_destroy_context (NvOBBDumpCtx *ctx) |
| Destroy OBB dump context. More... | |
| NvOBBDumpCtx * | nvobb_dump_get_singleton (int gpu_id, cudaStream_t cuda_stream) |
| Get or create singleton OBB dump context. More... | |
| void | nvobb_dump_cleanup_singleton (void) |
| Cleanup singleton OBB dump context. More... | |
| bool | nvobb_dump_frame (NvOBBDumpCtx *ctx, NvBufSurface *input_surf, void *rect_params_array, int num_rects, unsigned int frame_num) |
| Process frame and dump OBBs. More... | |
| cudaError_t | nvobb_rotate_gpu (const uint8_t *aabb_pixels, int aabb_width, int aabb_height, int aabb_pitch, int obb_width, int obb_height, float obb_cx, float obb_cy, float angle_rad, cudaStream_t stream, uint8_t **d_output) |
| Rotate OBB to rectangular RGBA on GPU (standalone) More... | |
| uint8_t * | nvobb_rotate_cpu (const uint8_t *aabb_pixels, int aabb_width, int aabb_height, int aabb_pitch, int obb_width, int obb_height, float obb_cx, float obb_cy, float angle_rad) |
| Rotate OBB to rectangular RGBA on CPU (standalone) More... | |
| typedef struct _NvOBBDumpCtx NvOBBDumpCtx |
OBB dump context handle.
Note: NvOSD_RectParams and NvOSD_ColorParams are defined in nvll_osd_struct.h and are included via nvll_osd_api.h
Definition at line 30 of file 9.0/sources/includes/nvll_obb.h.
| void nvobb_dump_cleanup_singleton | ( | void | ) |
Cleanup singleton OBB dump context.
Should be called during application shutdown to properly release all OBB dump resources. Thread-safe and idempotent.
| NvOBBDumpCtx* nvobb_dump_create_context | ( | int | gpu_id, |
| cudaStream_t | cuda_stream | ||
| ) |
Create OBB dump context.
Initializes the OBB dumping system. Reads configuration from environment variables:
| gpu_id | GPU device ID |
| cuda_stream | CUDA stream to use for async operations |
| void nvobb_dump_destroy_context | ( | NvOBBDumpCtx * | ctx | ) |
Destroy OBB dump context.
Waits for all pending encodes to finish and frees all resources.
| ctx | Context handle |
| bool nvobb_dump_frame | ( | NvOBBDumpCtx * | ctx, |
| NvBufSurface * | input_surf, | ||
| void * | rect_params_array, | ||
| int | num_rects, | ||
| unsigned int | frame_num | ||
| ) |
Process frame and dump OBBs.
Extracts and saves rotated OBBs from the frame. This function:
| ctx | Context handle |
| input_surf | Input surface containing the frame |
| rect_params_array | Array of rectangle parameters (NvOSD_RectParams*) |
| num_rects | Number of rectangles in the array |
| frame_num | Frame number (for filename generation) |
| NvOBBDumpCtx* nvobb_dump_get_singleton | ( | int | gpu_id, |
| cudaStream_t | cuda_stream | ||
| ) |
Get or create singleton OBB dump context.
Thread-safe lazy initialization of global OBB dump context. The context is created once and reused across all OSD drawing calls.
| gpu_id | GPU device ID |
| cuda_stream | CUDA stream (0 for default stream) |
| uint8_t* nvobb_rotate_cpu | ( | const uint8_t * | aabb_pixels, |
| int | aabb_width, | ||
| int | aabb_height, | ||
| int | aabb_pitch, | ||
| int | obb_width, | ||
| int | obb_height, | ||
| float | obb_cx, | ||
| float | obb_cy, | ||
| float | angle_rad | ||
| ) |
Rotate OBB to rectangular RGBA on CPU (standalone)
This function performs ONLY the rotation on CPU. No dumping, no threading, no encoding. Use this when you want to process rotated OBBs yourself and don't need GPU acceleration.
| aabb_pixels | Input AABB pixels (CPU memory, RGBA format) |
| aabb_width | Width of input AABB |
| aabb_height | Height of input AABB |
| aabb_pitch | Pitch (stride) of AABB in bytes |
| obb_width | Width of output OBB |
| obb_height | Height of output OBB |
| obb_cx | Center X of OBB in AABB space |
| obb_cy | Center Y of OBB in AABB space |
| angle_rad | Rotation angle in radians |
| cudaError_t nvobb_rotate_gpu | ( | const uint8_t * | aabb_pixels, |
| int | aabb_width, | ||
| int | aabb_height, | ||
| int | aabb_pitch, | ||
| int | obb_width, | ||
| int | obb_height, | ||
| float | obb_cx, | ||
| float | obb_cy, | ||
| float | angle_rad, | ||
| cudaStream_t | stream, | ||
| uint8_t ** | d_output | ||
| ) |
Rotate OBB to rectangular RGBA on GPU (standalone)
This function performs ONLY the rotation on GPU. No dumping, no threading, no encoding. Use this when you want to process rotated OBBs yourself (e.g., for tracking, feature extraction, etc.)
| aabb_pixels | Input AABB pixels (GPU memory, RGBA format) | |
| aabb_width | Width of input AABB | |
| aabb_height | Height of input AABB | |
| aabb_pitch | Pitch (stride) of AABB in bytes | |
| obb_width | Width of output OBB | |
| obb_height | Height of output OBB | |
| obb_cx | Center X of OBB in AABB space | |
| obb_cy | Center Y of OBB in AABB space | |
| angle_rad | Rotation angle in radians | |
| stream | CUDA stream for async execution (use 0 for default stream) | |
| [out] | d_output | Pointer to receive allocated GPU buffer with rotated OBB Caller must free with cudaFree() |