NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.6.0 Release


 
Image Camera Capture and EGL Producer (nvm_imgcap_eglprod)
 
Pipeline
EGLStream Operation Mode
Command Line Usage
Cross Process Examples
Cross Partition Examples
The NvMedia Image Camera Capture and EGL stream producer sample application nvm_imgcap_eglprod demonstrates how to use the NvMedia Image Capture to capture frames from a sensor and share the surfaces with an eglstream consumer.
The nvm_imgcap_eglprod sample application only supports a single OV10635 camera sensor. Since only OV10635 sensor is supported, the capture buffer format is YUV422P.
The application supports the below use-cases:
1. Share the captured YUV422P buffers across process/partition as NvMedia eglstream producer
2. Convert the captured YUV422P buffers to RGBA, with an optional vertical flip (useful with a GL consumer) and share RGBA across process/partition as NvMedia eglstream producer.
For understanding capture and eglstream related details, see the Image Camera Capture section and EGL Stream sections, respectively.
Pipeline
The application pipeline consists of three components:
Image Sensor Control (ISC): The initial configuration of the aggregators, serializers, and sensors are performed by the client application. The client application must:
Create handles for the root, aggregator, serializer and sensor devices.
Perform the initialization.
Pass these handles to the sensor control component at component creation.
Image Capture Processing (ICP): captures the frames coming from the CSI interface. It can capture an individual image coming from a camera, or aggregated images coming from multiple cameras. The output of this component provides the captured images.
NvMedia EGL Stream Producer: Posts the YUV/RGB images for a cross-process or cross partition consumer.
The following figure outlines the application pipeline.
For code flow details of capture and eglstream, see the Image Camera Capture section and EGL Stream sections, respectively.
EGLStream Operation Mode
Only mailbox mode is supported by this application.
Command Line Usage
The following shows the command syntax:
./nvm_imgcap_eglprod -cf <config filename> -c <config setname> [-optional_switches]
The following table describes the command line switches.
Switch
Parameter
Description
Defaults
-f
[file prefix]
Saves captured frames to a file. Each file starts with the specified prefix concatenated with any calibration parameters and the frame index.
Frames are not saved to file(s)
-h
N/A
Prints the usage syntax.
N/A
-v
[level]
Logging Level
0 Errors
1 Warnings
2 Information
3 Debug
If the switch is not provided, uses 0 Errors.
0

If switch is used, but level is not provided. Default: 3
-cf
[filename]
Specifies the configuration file. Co-locate the file with nvmimg_cap.
N/A
-c
[name]
Specifies the name of the configuration set the application is to use.
N/A
-lc
N/A
Lists the configuration sets defined in the configuration file.
N/A
-cross
N/A
Specifies producer type- 1 for cross process and 0 for cross-partition
0
-consumervm
[n]
Specifies VM id of the consumer. Only applicable if operating in cross-partition mode.
N/A
-ip
N/A
Specifies IP address of the consumer partition. Only applicable if operating in cross-partition mode.
N/A
-socketport
N/A
Sets port number used by cross-partition consumer during EGLStream creation for cross-partition producer.
8888
-flip
N/A
Only applicable for RGBA posting case. Flips the image vertically if specified
Not Set
-ot
N/A
Specifies color format: yuv422p or rgba.
YUV422p.
-n
[frames]
Specifies number of frames to capture and quit automatically
N/A
For configuration file parameters, see the Image Camera Capture section.
The following table describes the run-time command switches.
Switch
Parameter
Description
Defaults
q
N/A
Quits the application.
N/A
h
N/A
Prints available commands.
N/A
Cross Process Examples
The following cross process examples can be executed in two shells or run in the background of one shell.
To run cross process samples, specify -cross 1. Parameters consumervm, ip, and socketport are not required for this case.
To run as yuv422p image producer
./nvm_eglstream -producer 1 -consumer 1 -standalone 2 -ot yuv422p -d 0
./nvm_imgcap_eglprod -cf drive-px2-a.conf -c dvp-ov10635-yuv422-1280x800-ab -cross 1 -ot yuv422p
To run as rgba image producer
./nvm_eglstream -producer 1 -consumer 3 -standalone 2 -ot rgba -d 0
./nvm_imgcap_eglprod -cf drive-px2-a.conf -c dvp-ov10635-yuv422-1280x800-ab -cross 1 -ot rgba
Cross Partition Examples
The following cross partition examples can be executed in two shells, one for each partition.
The examples provided are similar to those described for cross process samples except for a few additional arguments: -consumervm, -ip, and -socketport.
To run cross partition samples, hv0 of both the consumer and producer partition must be configured to use two different IP address. For example, on the producer partition, set hv0 to 12.0.0.2 using:
ifconfig hv0 12.0.0.2
Similarly, on the consumer partition, hv0 can be set to 12.0.0.1.
In the producer process, mention the VM ID of the consumer partition using the -consumervm argument. Set -ip as the IP of consumer partition, i.e., 12.0.0.1, as in the above example. Set -socketport to the same port number used while creating EGLStream in the consumer process.
Set the DISPLAY_VM environment variable on the consumer partition if the display is not owned by it. For example,
export DISPLAY_VM=1
Also, display server must be run on the display owning partition with the below commands:
./rpcbind -d &
./displayserver &
To run as rgba image producer
On the Capture owning partition:
ifconfig hv0 12.0.0.1
./nvm_imgcap_eglprod -cf drive-px2-a.conf -c dvp-ov10635-yuv422-1280x800-ab -consumervm 1 -ip 12.0.0.2 -socketport 8888 -ot rgba
On other partitions:
ifconfig hv0 12.0.0.2
export DISPLAY_VM=0
./nvm_eglstream -producer 1 -consumer 2 -standalone 4 -ot rgba -d 0
To run as yuv422p image producer
On VM1, where producer is running:
ifconfig hv0 12.0.0.1
./nvm_imgcap_eglprod -cf drive-px2-a.conf -c dvp-ov10635-yuv422-1280x800-ab -consumervm 1 -ip 12.0.0.2 -socketport 8888 -ot yuv422p
On VM0, where consumer is running:
ifconfig hv0 12.0.0.2
export DISPLAY_VM=0
./nvm_eglstream -producer 1 -consumer 1 -standalone 4 -ot yuv422p -d 0