Page 1 of 1

wxMediaCtrl backend for omxplayer ?

Posted: Sat Feb 27, 2016 5:55 am
by Alexandre GESP
Hello.
Do you know if there is a backend for omxplayer (the linux media player witch come with raspberry PI platform).
I can order to omxplayer to play the file OVER my application, but I would prefer to have it embedded in a wxMediaCtrl.
GStreamer dont work fine the GPU of raspberry.

Re: wxMediaCtrl backend for omxplayer ?

Posted: Sat Feb 27, 2016 9:05 am
by evstevemd
You have to write that backend yourself. Docsstates:
Creating a backend for wxMediaCtrl is a rather simple process. Simply derive from wxMediaBackendCommonBase and implement the methods you want. The methods in wxMediaBackend correspond to those in wxMediaCtrl except for wxMediaCtrl::CreateControl which does the actual creation of the control, in cases where a custom control is not needed you may simply call wxControl::Create().

You need to make sure to use the wxDECLARE_CLASS and wxIMPLEMENT_CLASS macros.

The only real tricky part is that you need to make sure the file in compiled in, which if there are just backends in there will not happen and you may need to use a force link hack (see https://wiki.wxwidgets.org/RTTI).

Re: wxMediaCtrl backend for omxplayer ?

Posted: Sat Feb 27, 2016 5:31 pm
by Alexandre GESP
Yes, I have readed that F.... manual about creating a backend, but as I am a lazy boy, I'd expected the work has already been done !!!

Re: wxMediaCtrl backend for omxplayer ?

Posted: Sun Feb 28, 2016 7:19 pm
by evstevemd
Alexandre GESP wrote:Yes, I have readed that F.... manual about creating a backend, but as I am a lazy boy, I'd expected the work has already been done !!!
Its not. So you can save other lazy boys by doing it now ;)

Re: wxMediaCtrl backend for omxplayer ?

Posted: Mon Feb 29, 2016 7:03 pm
by T-Rex
Just have checked the omxplayer's source code and it seems that it does not support embedding to the existing UI window. All existing wxWidgets media backends just embed the player's UI control inside the host wxMediaCtrl. So if you want to use the omxplayer, then you need either to reuse its source code or just automate the console utility but in this case you either stick with the Audio features or the video will be played outside the wxMediaCtrl. So probably this is not a trivial task. You can try to setup a bounty here or at StackOverflow if you want, maybe someone will implement this for some money.