How to create metadatacontainer without egl display?

We want use BayerAverageMap extension in our project.
So we have to create a metadatacontainer by EGLStream::MetadataContainer::create method, Just like jetson mmapi samples.
But the first parameter of create method is EGLDisplay, In our scenario, there is no display available. For example, in a gstreamer source plugin(like nvarguscamerasrc) , How can we create a metadatacontainer?

Thank you!!

There is reference code in 10_camera_recording. Please try

    /* Get default EGL display */
    eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);

Hi, Dane
Thanks for your reply!

The eglGetDisplay(EGL_DEFAULT_DISPLAY) works on X11. 
But our app using nvoverlaysink without X.

Is there a way get display without X?

Beside,I can’t understood why metadatacontainer require a display parameter.
The all metadata provided by stream. Maybe the host does not have a display,

Please refer to

Could you check if you have nvdisplay enabled? On default r32.4.3, we can run 10_camera_recording after disabling display manager:

$ sudo systemctl stop gdm 
$ sudo loginctl terminate-seat seat0

So it should work without X.