Hi,
In case you still need it, check this patch:
diff --git a/multimedia_api/ll_samples/samples/13_argus_multi_camera/main.cpp b/multimedia_api/ll_samples/samples/13_argus_multi_camera/main.cpp
index 1bd8ed9..2e83025 100644
--- a/multimedia_api/ll_samples/samples/13_argus_multi_camera/main.cpp
+++ b/multimedia_api/ll_samples/samples/13_argus_multi_camera/main.cpp
@@ -39,6 +39,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <opencv2/opencv.hpp>
+
using namespace Argus;
using namespace EGLStream;
@@ -267,7 +269,8 @@ bool ConsumerThread::threadInitialize()
/* Allocate composited buffer */
input_params.width = STREAM_SIZE.width();
input_params.height = STREAM_SIZE.height();
- input_params.colorFormat = NVBUF_COLOR_FORMAT_NV12;
+ input_params.colorFormat = NVBUF_COLOR_FORMAT_RGBA;
input_params.layout = NVBUF_LAYOUT_PITCH;
input_params.memType = NVBUF_MEM_SURFACE_ARRAY;
input_params.memtag = NvBufSurfaceTag_VIDEO_CONVERT;
@@ -356,8 +359,8 @@ bool ConsumerThread::threadExecute()
{
batch_surf[i] = NULL;
m_dmabufs[i] = iNativeBuffer->createNvBuffer(iEglOutputStreams[i]->getResolution(),
- NVBUF_COLOR_FORMAT_YUV420,
- NVBUF_LAYOUT_BLOCK_LINEAR);
+ NVBUF_COLOR_FORMAT_RGBA,
+ NVBUF_LAYOUT_PITCH);
if (!m_dmabufs[i])
CONSUMER_PRINT("\tFailed to create NvBuffer\n");
if (-1 == NvBufSurfaceFromFd(m_dmabufs[i], (void**)(&batch_surf[i])))
@@ -374,7 +377,19 @@ bool ConsumerThread::threadExecute()
{
/* Composite multiple input to one frame */
NvBufSurfTransformMultiInputBufCompositeBlend(batch_surf, pdstSurf, &m_compositeParam);
- g_renderer->render(m_compositedFrame);
+ NvBufSurfaceMap(pdstSurf, -1, 0, NVBUF_MAP_READ);
+ NvBufSurfaceSyncForCpu(pdstSurf, -1, 0);
+
+ cv::Mat imgbuf = cv::Mat(STREAM_SIZE.height(),
+ STREAM_SIZE.width(),
+ CV_8UC4, pdstSurf->surfaceList->mappedAddr.addr[0]);
+ cv::Mat display_img;
+ cvtColor(imgbuf, display_img, cv::COLOR_RGBA2BGR);
+
+ NvBufSurfaceUnMap(pdstSurf, -1, 0);
+
+ cv::imshow("img", display_img);
+ cv::waitKey(1);
}
else
g_renderer->render(m_dmabufs[0]);
You also need to use opencv4
instead of opencv
in Makefile:
+CPPFLAGS+=`pkg-config --cflags opencv4`
+LDFLAGS+=`pkg-config --libs opencv4`