OMX Removal from GStreamer 1.24

From what I can tell, there aren’t any other paths towards hardware h.264 (or other) decoding left on Android after the removal of the OMX plug-in from GStreamer version 1.24.

I could totally be misreading the situation, though. So, if that’s not the case, I would love it if somebody could lead me into the light about what the solution is going forward.

Assuming I’m correct, however, are there any plans to provide hardware decode access to Android devices through some other means? If so, what are they?

Any help is appreciated, thanks in advance.

-Reed

The androidmedia plugin using Android’s MediaCodec is the preferred decoding API on Android phones for the better part of a decade :). You should not be using OMX in an Android application.

Indeed, OMX on Android was a private API. I say was since it’s been deprecated in favor of codec2 APIs, which again is for system integrators, not for application use.

In GStreamer there are amcviddec-... elements that are created dynamically with the information given from Android MediaCodec. You can use this snippet of code:

GList *decoders = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_DECODABLE,
                                                        GST_RANK_MARGINAL);

// Iterate through the list
for (GList *iter = decoders; iter != NULL; iter = iter->next) {
    GstElementFactory *factory = (GstElementFactory *) iter->data;

    // Get the factory name suitable for use in a string pipeline
    const gchar *name = gst_element_get_name(factory);

    // Print the factory name
    g_print("Decoder: %s\n", nam);
}

This will print a bunch of decoders, but what you are looking for is something that involves your chip. For example, I am using rockchip, so for H265, I would be looking for amcviddec-c2rkhevcdecoder, where rk stands for rockchip. Note that the google or android ones are software decoders.

PS: If you’re looking for H264, another name is AVC.

I’m writing a Unity app for Android platforms though, and I’m not sure how to access AMC from within Unity, or from within a native plugin in general. If there’s any documentation on doing that I would love to see it.

I’m going to give this a shot, thanks!

1 Like

Check the androidmedia plugin, which uses the Android MediaCodec API. OpenMAX IL was never public API on Android.