Hardware h.264 Decode Fails with Library Error on Android (Quest3) with decodebin3 -> amcvideodec-omxqcomvideodecoderavc

I’m deploying gstreamer to oculus quest, essentially an android device, as a native plugin for a unity 3D application. My plug-in works, mostly. Videotestsrc works, RTP video streaming works, h.264 decoding works. My problem happens when I try to utilize hardware video decoding with decodebin or decodebin3. Default behavior is software decoding is selected by either of those elements. After doing some research, I found a method of upgrading the omx decoder rankings with regard to decodebin and decodebin3. Doing so did result in omxqcomvideodecoderavc being instantiated to decode the video, but ended in pipeline failure and “Internal GStreamer error: code not implemented. Please file a bug at…”.

Here’s the latest pipeline I’m using:

udpsrc port=7331 ! application/x-rtp,media=video,payload=96 ! rtph264depay ! h264parse ! decodebin3 name=decoder ! video/x-raw(memory:GLMemory) ! gldownload name=downloader ! video/x-raw ! videoconvert name=converter ! video/x-raw,format=RGB ! appsink name=videoSink sync=0

After reading in the release notes for gstreamer 1.24 that omx had been removed, I downgraded to 1.22. However, I get the same results with either (which really doesn’t make a lot of sense?).

Gstreamer output asked me to, so I’ve filed an issue tracker report here:

However I do realize I may be doing something wrong. So if anyone has any suggestions I’m all ears. Right now I’m wondering if the required modules were stripped out of my libgstreamer_android.so, or something like that…

Increase the ranking of the element and it will choose the correct decoder.

Check this out. Playback tutorial 8: Hardware-accelerated video decoding

I did this and that’s where it fails to play. Look at the first paragraph of this post.

After doing some research, I found a method of upgrading the omx decoder rankings with regard to decodebin and decodebin3

omxqcomvideodecoderavc is the upgraded decoder. It is what is failing.

If you look at the issue report I linked, it results in this error message:

Warning: : GstPipelineHandler::HandleMessage(): error in module amcvideodec-omxqcomvideodecoderavc1 reported: GStreamer encountered a general supporting library error. - …/sys/androidmedia/gstamcvideodec.c(2012): gst_amc_video_dec_set_format (): /GstPipeline:pipeline0/GstDecodebin3:decoder/GstAmcVideoDec-OmxQcomVideoDecoderAvc:amcvideodec-omxqcomvideodecoderavc1:
Could not retrieve application class loader
Warning: : GstPipelineHandler::HandleMessage(): warning in module converter reported: Internal GStreamer error: code not implemented. Please file a bug at Sign in · GitLab.