How to display picture by HDMI?

how to display a rgb source by HDMI?
/home/fyj/nfs/jetson_multimedia_api/samples/08_video_dec_drm output to HDMI ,and input by file.
ctx->drm_renderer->enqueBuffer(render_fd);
what is the type of the source in the “dma_buf” in “render_id”.
if my source type was rgb24,how can i change my source to the some type as “render_id”

Hi,
The format rgb24 is not supported. Suggest you allocate NvBuffer in NvBufferColorFormat_ABGR32 and put the data into the buffers for rendering.

1 Like

NvBufferColorFormat_ABGR32 is not supported on NX
[ERROR] (NvDrmRenderer.cpp:154) Error in transforming buffer information
[ERROR] (NvDrmRenderer.cpp:684) Failed to convert to DRM params
[ERROR] (NvDrmRenderer.cpp:801) Error in rendering frame
i chosen NvBufferColorFormat_NV12 like the sample 08_video_dec_drm,but it didn’t work.
could point out mistakes for me ?
my code next:

NvDrmRenderer *drm_renderer;
struct drm_tegra_hdr_metadata_smpte_2086 drm_metadata;
memset(&drm_metadata,0,sizeof(struct drm_tegra_hdr_metadata_smpte_2086));


drm_renderer = NvDrmRenderer::createDrmRenderer("renderer0",
        1920, 1088, 0, 0,
         0, 0, drm_metadata, true);
drm_renderer->setFPS(30);
int render_fd;
NvBufferCreateParams cParams = {0};
cParams.width = 1920;
cParams.height = 1088;
cParams.layout = NvBufferLayout_Pitch;
cParams.payloadType = NvBufferPayload_SurfArray;
cParams.nvbuf_tag = NvBufferTag_VIDEO_DEC;
cParams.colorFormat = NvBufferColorFormat_NV12;
NvBufferCreateEx(&render_fd, &cParams);
static float dataRgb[1920*1088*3];
static unsigned char dataNv12[1920*1632];
//read one frame rgb24 from file to dataRgb,and transfromed to nv12 to the buffer dataNv12
void *ptrHw
NvBufferMemMap(render_fd[i],0,NvBufferMem_Write,&ptrHw);
memcpy(ptrHw,dataNv12,1920*1632);
NvBufferMemSyncForDevice(render_fd,0,&ptrHw);
NvBufferMemUnMap(render_fd,0,&ptrHw);
while(1){
    drm_renderer->enqueBuffer(render_fd);
    sleep(1);
}

when memcpy data from dataNv to ptrHw,it “Segmentation fault (core dumped)”

thanks DaneLLL.
i find the solution from other topics
https://forums.developer.nvidia.com/t/jetpack-4-3-multimedia-api-nvvidconv-abgr32/142951/5

void *ptrHw = nullptr;
NvBufferMemMap(render_fd,0,NvBufferMem_Write,&ptrHw);
memcpy(ptrHw,dataNv12,1920*1088);
NvBufferMemSyncForDevice(render_fd,0,&ptrHw);
NvBufferMemUnMap(render_fd,0,&ptrHw);
ptrHw = nullptr;

NvBufferMemMap(render_fd,1,NvBufferMem_Write,&ptrHw);
memcpy(ptrHw,dataNv12 + 1920*1088,1920*544);
NvBufferMemSyncForDevice(render_fd,1,&ptrHw);
NvBufferMemUnMap(render_fd,1,&ptrHw);

it work well