G
G
gfirf2017-01-10 00:04:44
Android
gfirf, 2017-01-10 00:04:44

How to find the color of a pixel in an OpenGL ES/NDK screen?

Hello!
Given: TV box Eltex NV 501 wac, Android 4.4.4, towelroot (before reboot).
I'm trying to make a backlight for TV + Android set-top box - a la Ambilight / Kodi + Boblight, but without xbmc, etc.
I want to quickly (from 5 frames / sec) get the color of a pixel at the given coordinates.
I searched the internet and narrowed it down to:

  1. OpenGL ES - there is a method glReadPixel. This option seems to me the most successful, but I'm not familiar with OpenGL. Could not understand whether opengl can read from the "system" buffer frame? Those. open /dev/graphics/fb0 and get the desired pixel.
  2. Adnroid NDK + /dev/framebuffer - read from the buffer, get the desired pixel. I'm afraid that it will take a long time to read the buffer (10Mb) + parse.
  3. screencap/minicap/ffmpeg - in principle, you can use the application to take screenshots, but I'm afraid it will be slow or take a lot of resources.

Question: Can opengl do what I need?
Which of the proposed options is easier to implement, but at the expense of speed?
If you offer a better one I will be very grateful! Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question