Oculus Quest does not list main profile capabilities for amcviddec-omxqcomvideodecoderhevc plugin after updating gstreamer from 1.18.6 -> 1.20.1
When I'm running following code which print out CAPS of amcviddec-omxqcomvideodecoderhevc feature on Oculus Quest
// https://gstreamer.freedesktop.org/documentation/tutorials/basic/media-formats-and-pad-capabilities.html?gi-language=c
#include <gst/gst.h>
/* Functions below print the Capabilities in a human-friendly format */
static gboolean print_field (GQuark field, const GValue * value, gpointer pfx) {
gchar *str = gst_value_serialize (value);
g_print ("%s %15s: %s\n", (gchar *) pfx, g_quark_to_string (field), str);
g_free (str);
return TRUE;
}
static void print_caps (const GstCaps * caps, const gchar * pfx) {
guint i;
g_return_if_fail (caps != NULL);
if (gst_caps_is_any (caps)) {
g_print ("%sANY\n", pfx);
return;
}
if (gst_caps_is_empty (caps)) {
g_print ("%sEMPTY\n", pfx);
return;
}
for (i = 0; i < gst_caps_get_size (caps); i++) {
GstStructure *structure = gst_caps_get_structure (caps, i);
g_print ("%s%s\n", pfx, gst_structure_get_name (structure));
gst_structure_foreach (structure, print_field, (gpointer) pfx);
}
}
/* Prints information about a Pad Template, including its Capabilities */
static void print_pad_templates_information (GstElementFactory * factory) {
const GList *pads;
GstStaticPadTemplate *padtemplate;
g_print ("Pad Templates for %s:\n", gst_element_factory_get_longname (factory));
if (!gst_element_factory_get_num_pad_templates (factory)) {
g_print (" none\n");
return;
}
pads = gst_element_factory_get_static_pad_templates (factory);
while (pads) {
padtemplate = pads->data;
pads = g_list_next (pads);
if (padtemplate->direction == GST_PAD_SRC)
g_print (" SRC template: '%s'\n", padtemplate->name_template);
else if (padtemplate->direction == GST_PAD_SINK)
g_print (" SINK template: '%s'\n", padtemplate->name_template);
else
g_print (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
if (padtemplate->presence == GST_PAD_ALWAYS)
g_print (" Availability: Always\n");
else if (padtemplate->presence == GST_PAD_SOMETIMES)
g_print (" Availability: Sometimes\n");
else if (padtemplate->presence == GST_PAD_REQUEST)
g_print (" Availability: On request\n");
else
g_print (" Availability: UNKNOWN!!!\n");
if (padtemplate->static_caps.string) {
GstCaps *caps;
g_print (" Capabilities:\n");
caps = gst_static_caps_get (&padtemplate->static_caps);
print_caps (caps, " ");
gst_caps_unref (caps);
}
g_print ("\n");
}
}
// ---- main ----
GstRegistry* registry = gst_registry_get();
GstElementFactory* factory = GST_ELEMENT_FACTORY(gst_registry_lookup_feature(registry, "amcviddec-omxqcomvideodecoderhevc"));
print_pad_templates_information(factory);
On gstreamer 1.18.6 I get:
2022/11/17 14:38:38.731 26291 26315 Info gub Pad Templates for OMX.qcom.video.decoder.hevc:
2022/11/17 14:38:38.731 26291 26315 Info gub SINK template: 'sink'
2022/11/17 14:38:38.731 26291 26315 Info gub Availability: Always
2022/11/17 14:38:38.731 26291 26315 Info gub Capabilities:
2022/11/17 14:38:38.731 26291 26315 Info gub video/x-h265
2022/11/17 14:38:38.731 26291 26315 Info gub width: [ 16, 4096 ]
2022/11/17 14:38:38.731 26291 26315 Info gub height: [ 16, 4096 ]
2022/11/17 14:38:38.731 26291 26315 Info gub framerate: [ 0/1, 2147483647/1 ]
2022/11/17 14:38:38.731 26291 26315 Info gub parsed: true
2022/11/17 14:38:38.731 26291 26315 Info gub stream-format: byte-stream
2022/11/17 14:38:38.731 26291 26315 Info gub alignment: au
2022/11/17 14:38:38.731 26291 26315 Info gub profile: main-10
2022/11/17 14:38:38.731 26291 26315 Info gub video/x-h265
2022/11/17 14:38:38.731 26291 26315 Info gub width: [ 16, 4096 ]
2022/11/17 14:38:38.731 26291 26315 Info gub height: [ 16, 4096 ]
2022/11/17 14:38:38.731 26291 26315 Info gub framerate: [ 0/1, 2147483647/1 ]
2022/11/17 14:38:38.731 26291 26315 Info gub parsed: true
2022/11/17 14:38:38.731 26291 26315 Info gub stream-format: byte-stream
2022/11/17 14:38:38.731 26291 26315 Info gub alignment: au
2022/11/17 14:38:38.731 26291 26315 Info gub profile: main
2022/11/17 14:38:38.731 26291 26315 Info gub -------
2022/11/17 14:38:38.731 26291 26315 Info gub SRC template: 'src'
2022/11/17 14:38:38.731 26291 26315 Info gub Availability: Always
2022/11/17 14:38:38.731 26291 26315 Info gub Capabilities:
2022/11/17 14:38:38.731 26291 26315 Info gub video/x-raw
2022/11/17 14:38:38.731 26291 26315 Info gub format: RGBA
2022/11/17 14:38:38.731 26291 26315 Info gub texture-target: external-oes
2022/11/17 14:38:38.731 26291 26315 Info gub -------
,but with 1.20.4 it does not list the main
profile anymore, only main-10
is listed:
2022/11/17 14:45:31.046 26830 26857 Info gub Pad Templates for OMX.qcom.video.decoder.hevc:
2022/11/17 14:45:31.046 26830 26857 Info gub SINK template: 'sink'
2022/11/17 14:45:31.046 26830 26857 Info gub Availability: Always
2022/11/17 14:45:31.046 26830 26857 Info gub Capabilities:
2022/11/17 14:45:31.046 26830 26857 Info gub video/x-h265
2022/11/17 14:45:31.046 26830 26857 Info gub width: [ 16, 4096 ]
2022/11/17 14:45:31.046 26830 26857 Info gub height: [ 16, 4096 ]
2022/11/17 14:45:31.046 26830 26857 Info gub framerate: [ 0/1, 2147483647/1 ]
2022/11/17 14:45:31.046 26830 26857 Info gub parsed: true
2022/11/17 14:45:31.046 26830 26857 Info gub stream-format: byte-stream
2022/11/17 14:45:31.046 26830 26857 Info gub alignment: au
2022/11/17 14:45:31.046 26830 26857 Info gub profile: main-10
2022/11/17 14:45:31.046 26830 26857 Info gub -------
2022/11/17 14:45:31.046 26830 26857 Info gub SRC template: 'src'
2022/11/17 14:45:31.046 26830 26857 Info gub Availability: Always
2022/11/17 14:45:31.046 26830 26857 Info gub Capabilities:
2022/11/17 14:45:31.046 26830 26857 Info gub video/x-raw
2022/11/17 14:45:31.046 26830 26857 Info gub format: RGBA
2022/11/17 14:45:31.046 26830 26857 Info gub texture-target: external-oes
2022/11/17 14:45:31.046 26830 26857 Info gub -------
This causes decodebin3
node to have problems when getting HEVC stream created with main
profile instead of main-10
(I have set avdec_h265 plugin rank to 0).
2022/11/17 15:15:03.804 28066 28254 Warn GStreamer+parsebin 0:01:00.065181175 0xb3278090 ../gst/playback/gstparsebin.c:3543:gst_parse_bin_expose:<parsebin0> error: no suitable plugins found:
2022/11/17 15:15:03.804 28066 28254 Warn GStreamer+parsebin Missing parser: H.265 (Main Profile) (video/x-h265, stream-format=(string)byte-stream, alignment=(string)au, width=(int)2048, height=(int)2048, framerate=(fraction)30/1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)sRGB, parsed=(boolean)true, pixel-aspect-ratio=(fraction)1/1, profile=(string)main, tier=(string)main, level=(string)5)