DebugAssistant
Posts: 2
Joined: Mon Dec 18, 2017 9:58 am

How to enable vcos log?

Mon Dec 18, 2017 10:19 am

I'm trying to implement "video_decoder -> egl_render" chain in my application. I already have OpenGL SDL crossplatform engine, and need to add EGLImage to use with it.
I'm trying create EGLImage like in hello_videocube:

Code: Select all

GLuint textureId;

EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
                 1280, 720,
                 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

EGLImageKHR eglImage = eglCreateImageKHR(
            display,
            EGL_NO_CONTEXT,
            EGL_GL_TEXTURE_2D_KHR,
            (EGLClientBuffer)textureId,
            NULL);

But i have got EGL_NO_IMAGE_KHR in eglImage and EGL_BAD_PARAMETER in eglGetError().

I'm trying to switch on vcos_logging and view what wrong in eglCreateImageKHR, but don't know how to do this right.

Code: Select all

VCOS_LOG_CAT_T egl_khr_image_client_log = VCOS_LOG_INIT("egl_khr_image_client", VCOS_LOG_INFO);
vcos_log_set_level(&egl_khr_image_client_log, VCOS_LOG_INFO);
How switch on vcos logging for particular VCOS_LOGGING_CATEGORY and how to view it?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5953
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How to enable vcos log?

Fri Dec 22, 2017 12:25 pm

If you're talking about the ARM side logging, then setting

Code: Select all

export VC_LOGLEVEL="egl_khr_image_client:trace"
should do the trick.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

DebugAssistant
Posts: 2
Joined: Mon Dec 18, 2017 9:58 am

Re: How to enable vcos log?

Fri Dec 22, 2017 1:28 pm

And how can i view this log?

I already found mistake.

Code: Select all

GLuint textureId;

EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
EGLContext context = eglGetCurrentContext();
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
                 1280, 720,
                 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

EGLImageKHR eglImage = eglCreateImageKHR(
            display,
            context,
            EGL_GL_TEXTURE_2D_KHR,
            (EGLClientBuffer)textureId,
            NULL);


6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5953
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How to enable vcos log?

Fri Dec 22, 2017 2:23 pm

It'll spit it out to either stdout or stderr (can't remember which off the top of my head).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “OpenMAX”