The "gst_rtp_get_header_extension_list" function returns "GstElementFactory" elements instead of "GstRTPHeaderExtension" elements.
The documentation for gst_rtp_get_header_extension_list
states that it returns a GList
of GstRTPHeaderExtension
objects.
https://gstreamer.freedesktop.org/documentation/rtplib/gstrtpbasepayload.html?gi-language=c
However, I've found that it actually returns a GList
of GstElementFactory
objects. If you then use gst_element_factory_create
on each of those factories, you get the GstRTPHeaderExtension
objects.
Here is some test code that illustrates this:
#include <gst/gst.h>
#include <gst/gstinfo.h>
#include <gst/rtp/rtp.h>
int main() {
gst_init(NULL, NULL);
GList* header_extension_list = gst_rtp_get_header_extension_list();
g_print("Available RTP Header Extensions:\n");
for (GList* l = header_extension_list; l != NULL; l = l->next) {
GstElement* test_element = gst_element_factory_create(GST_ELEMENT_FACTORY_CAST(l->data), "testing");
g_print("\t%s\t%s\n", G_OBJECT_TYPE_NAME(test_element), gst_rtp_header_extension_get_uri(GST_RTP_HEADER_EXTENSION_CAST(test_element)));
g_object_unref(test_element);
}
gst_plugin_feature_list_free(header_extension_list);
}
Edited by AbleBacon