Since it is not possible to run both a viewfinder and capture JPEG images from the same stream, use these test cases to discover how this can be done by accessing the camera HAL directly.
These test cases are based on the Google Test framework and can be found here:
These also demonstrate how to capture full 13 Mpixel resolution images from the 13 MPixel camera. From Gstreamer, the largest resolution stream that can be set up is 4k (3840 x 2160).
Camera HAL via Android camera V3 API
The Camera HAL exposes it's functionality through the Android camera V3 API:
The test cases can be executed by running the following commands:
mkdir temp && cd temp && ldconfig
List the available unit tests
The following commands will provide details of available unit tests:
camera_subsys_test --gtest_list_tests --gtest_filter=-imx135*:imx230*:ov8858*
To demonstrate the capture of a full 13 Mipxel resolution JPEG image while simultaneously having a VGA resolution preview stream configured (this will not be visible though) while waiting until the 3A has stabilized (auto-focus, auto-white-balance, auto-exposure), you can execute the following test case:
The resulting image can be viewed with:
gst-launch-1.0 filesrc location=CameraId_0_jpeg_resolutions_RawHal_Test_Jpeg_Resolutions_TestJpegCapture_0_1_4096x3104.jpeg ! jpegdec ! imagefreeze ! autovideosink
Some of the test cases support dumping all of the captured frames to the file system when the “--dump” parameter is specified.
Maker and Model information in the JPEG EXIF data
JPEG images captured from the CSI cameras will contain EXIF data. To adjust the Maker and Model information that gets inserted to this EXIF data, create the file “/etc/camerahal.cfg” (or edit it if it already exists). The file should have the following content:
Replace the exampleModel and exampleManufacturer text strings with the relevant strings for your device design.
The same can be achieved when building Ref-OS-IoT from source by applying these same edits to the patch named "0001-Add-camerahal.cfg-file.patch" in the build folder "meta-ref-os-iot/recipes-camera-adaptation/camera3hal/files".