V4L2UserPtrSourceOp
🚧 Documentation is under development
The Holoscan SDK guide is currently under active development. Some sections may be incomplete or change without notice.
Questions? Contact RidgeRun or email to support@ridgerun.com.
-
Overview
-
Build, Run, and Validate
-
Core Concepts
-
Operators and Graphs
-
Tensor Data and Memory
-
Interprocess Communication
-
-
Application and Operator Development
- Building an HSDK Application
- Writing a Minimal Operator
- Typed Parameters and Configuration
- Reading, Writing, and Forwarding Data
- Writing Tensor Operators
- Complete Operator Patterns
- Authoring Runtime Behavior
- Runtime Parameter Updates
- Lifecycle Callbacks and Restart Control
- Performance and Debugging
- SDK Source Map
-
Operator Reference
-
Core Operators
-
Holoscan Camera
-
Holoscan RidgeRun
- Overview
- Build and Installation
- ArgusCameraOp
- V4L2SourceOp
- V4L2UserPtrSourceOp
- BgraToPlanarTensorOp
- RawBayerToBgraOp
- RawBayerToYoloTensorOp
- YuyvToBgraOp
- TensorRtInferenceOp
- DrmDisplayOp
- DrmBgraDisplayOp
- X11DisplayOp
- CudaCompositorOp
- DepthColorizerOp
- FakesinkOp
- FrameSkipperOp
- InterprocessSrcOp
- TestPatternOp
-
-
Migration from Holoscan 4.x
-
Examples
-
Core
-
Holoscan Camera
-
Holoscan RidgeRun
-
-
Benchmark and Use Cases
-
Holoscan vs GStreamer
- Overview
-
Capture and Display
-
Capture and Inference
- Compare the workloads
- Implemented Applications
- Framework Selection
- Interprocess
-
V4L2UserPtrSourceOp
V4L2UserPtrSourceOp captures single-plane RG10 Bayer frames through V4L2 USERPTR buffers backed by CUDA-mapped pinned host memory. The camera writes the same allocation that downstream CUDA operators read through a device alias, avoiding a host-to-device copy in this operator.
Input arguments
| Argument | Default and meaning |
|---|---|
device
|
V4L2 device path, for example /dev/video0.
|
width, height
|
Positive RG10 capture dimensions. |
fps
|
Requested capture rate; defaults to 30.
|
cuda_device
|
Device used for mapped aliases; defaults to 0.
|
sensor_gain
|
Sensor gain setting; defaults to 8,000,000 in the source API.
|
exposure_us
|
Exposure setting; defaults to 15,649 microseconds.
|
frame_limit, start_gate
|
Optional application controls for bounded runs and synchronized starts. |
Ports and data contract
| Port | Memory | Queue | Trigger | Contract |
|---|---|---|---|---|
frame
|
CUDA-visible mapped host memory | N/A | OnClock at fps
|
U16 tensor with shape [height, width, 1] containing unpacked RG10 values. Frame IDs and usable capture timestamps are forwarded.
|
V4L2UserPtrSourceOp -> RawBayerToBgraOp -> X11DisplayOp V4L2UserPtrSourceOp -> RawBayerToBgraOp -> DrmBgraDisplayOp V4L2UserPtrSourceOp -> RawBayerToYoloTensorOp -> TensorRtInferenceOp -> FakesinkOp
Build
Follow Holoscan RidgeRun Build and Installation for the module build and installation. The operator-specific include, target, and runtime requirements are listed below.
Include v4l2_userptr_source/v4l2_userptr_source.hpp and link holoscan::v4l2_userptr_source. The camera driver must support single-plane V4L2_MEMORY_USERPTR buffers for the requested RG10 mode.
Example
The source can feed either the display-oriented or fused inference-oriented path:
auto camera = graph.op<V4L2UserPtrSourceOp>(
"camera", "/dev/video0", 1920, 1080, 60, 0,
8000000, 15649);
auto preprocess = graph.op<RawBayerToYoloTensorOp>(
"preprocess", 1920, 1080, 640, 640);
graph.add_flow(camera->frame, preprocess->input);
compile_options.deployment.bind_tensor_output_device(
holoscan::TensorOutputDevicePlacement{
.operator_path = "camera",
.output_port = "frame",
.device = holoscan::DeviceId{0}});
The constructor validates positive dimensions, an even width, positive gain and exposure, a supported CUDA device and a frame-rate period representable by the Holoscan clock. On startup the operator negotiates the exact RG10 format, applies the configured sensor controls when the driver exposes them, allocates CUDA-mapped host slots with cudaHostAllocMapped, obtains device aliases with cudaHostGetDevicePointer, queues them as USERPTR and starts streaming.