I simply changed samples/08_video_dec_drm.
It’s just called twice createDrmRenderer() with different parameters.
in the file NvDrmRenderer.cpp
Then I added the print after drmOpen().The file descriptor is the same.
./video_dec_drm …/…/data/Video/sample_outdoor_car_1080p_10fps.h264 H264 --disable-ui
Here is the print:
[conn=0,crtc=0] drmOpen fd = 14
[conn=1,crtc=1] drmOpen fd = 14
In my actual project code, I used two threads to call the NvDrmRenderer class function separately to send video buffer to my two display interfaces. Because I need my two display interfaces to output different video at the same time.
However, the two threads I create will cause conflicts because of the same file descriptors.
The areas of conflict include drmClose(drm_fd) or poll(&fds, 1, timeout), the arguments to these functions are only file descriptors.
drmMultiOpen.rar (13.8 KB)