jvcleave / ofxOMXPlayer

OpenMax accelerated video player for openFrameworks on the Raspberry Pi 0-3. Does not work with RPI4
GNU General Public License v2.0
180 stars 61 forks source link

Draw a video in non rectangular shape of the window #144

Closed oomek closed 5 years ago

oomek commented 5 years ago

Hi, I have several questions if I may:

  1. Is it possible to draw the video window in non rectangular (perspective) shape providing 4 pairs of coordinates?
  2. Can I integrate it with sfml-pi so the draw order is preserved? ie. draw some sfml objects, call ofApp.draw() and then draw the rest of sfml objects?
  3. Is it possible somehow to get a GLuint of the currently decoded frame so I could draw it with Opengl with zero copy?
jvcleave commented 5 years ago
  1. yes with texture mode
  2. not familiar with sfml-pi
  3. yes in texture mode see https://github.com/jvcleave/ofxOMXPlayer/blob/master/src/ofxOMXPlayer.h#L54
oomek commented 5 years ago

That's great, If only I could find a way to integrate it with SFML :P not sure if it's actually possible

oomek commented 5 years ago

I'm not gonna lie I'm actually looking for a conventional c++ wrapper for the omxPlayer which would give me an access to the Gluint of the rendered frame as the current ffmpeg+mmal method we are using in our app based on the SFML framework has dreadful performance.

oomek commented 5 years ago

I'll dig through your code for inspiration maybe if you don't mind.

jvcleave commented 5 years ago

good luck - you can also check out hello_videocube if you want an alternative route

https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/hello_pi/hello_videocube

oomek commented 5 years ago

Thanks for the link. Unfortunately this example plays only raw h264 files without audio.