The camera_sample application is a unit level implementation to demonstrate the use of libv4l2_nvargus interface for streaming.
The application reads the captured buffers for either EGL renderer to preview or dump the raw buffers into a file without any extra memory copy.
$ cd /usr/src/jetson_multimedia_api/samples/unittest_samples/camera_unit_sample $ make
$ ./camera_sample [OPTIONS]
The captured preview stream can display over HDMI.
$ ./camera_sample -r 1920 1080 -fps 30 1
$ ./camera_sample -h
The following diagram shows the flow through this sample.
The sample uses the following key class and structures:
Element | Description |
---|---|
Buffer | Class modeled on v4l2_buffer structure. |
Classes | Description |
---|---|
class NvEGLRender | The class contains elements and functions to render frames to EGL window. |
NvEGLRender is the class that packages all the functions for video rendering. Key members used in the sample are as follows:
NvEGLRender | Description |
---|---|
NvEglRenderer::render | Render the FD to an EGL window. |
The key structures and functions used in the sample are:
Function | Description |
---|---|
dq_buffer | Dequeues a buffer from the plane. |
capture_plane_callback | DQ Callback function. |
q_buffer | Queues a buffer on the plane. |
req_buffers_on_capture_plane | Request buffers on the encoder capture plane. |
set_plane_format | Set format on the encoder capture plane. |
set_controls | Set values of Argus properties and controls. |