[libcamera-devel] [RFC] [PATCH 0/3] Add an option to enable rendering YUV frame by OpenGL shader

Show Liu show.liu at linaro.org
Fri Mar 20 09:50:26 CET 2020


Hi all,
  I would like to share my adventure on qcam. 
I added an option to enable rendering YUV frame by OpenGL shader for qcam.
Honestly, it's still in progress, and only support NV12 format at present. 
However the improvement is obviously. I logged the messages below when qcam running.
https://pastebin.linaro.org/view/20d91f21
In 1280x800 mode:
format convert by CPU is around ~4 fps, rendering by GPU up to ~30.0 fps
In 1920x1080 mode:
format convert by CPU is around ~2 fps, rendering by GPU still up to ~30.0 fps

  The improvement still in progress, including more YUV formats support ... etc.
And some parts I added are not in good shape, I am trying to make it better. 
So I appreciate any review conments and suggestion.

It's also available on below.
https://github.com/showliu/libcamera/commits/qcam_opengl_hack2

I tested with kernel 5.5rc5 + Panfrost GPU driver on Rock Pi 4B platform.

Show Liu (3):
  qcam: Added statusbar to show the camera stream configuration
  qcam: Added opengl widget class for qcam
  qcam: added an option to enable rendering via OpenGL shader

 src/qcam/glwidget.cpp    | 213 +++++++++++++++++++++++++++++++++++++++
 src/qcam/glwidget.h      |  76 ++++++++++++++
 src/qcam/main.cpp        |   2 +
 src/qcam/main_window.cpp |  36 ++++++-
 src/qcam/main_window.h   |   3 +
 src/qcam/meson.build     |   4 +-
 6 files changed, 330 insertions(+), 4 deletions(-)
 create mode 100644 src/qcam/glwidget.cpp
 create mode 100644 src/qcam/glwidget.h

-- 
2.20.1



More information about the libcamera-devel mailing list