gstreamerh.264http-live-streamingopenh264

gst_element_request_pad_simple fails for hlssink2


My appsrc pipeline is as follows:

appsrc-openh264enc-h264parse-hlssink2

I first retrieve each element with gst_element_factory_make successfully, each element is checked for nullptrs.

Then I add/link all the elements with 'always' presence via:

gst_bin_add_many(pipeline, appsrc,h264Encoder,h264Parse, NULL);

assert(gst_element_link_many(pipeline, (GstElement*)appsrc, h264Encoder, h264Parse, NULL));

According to the gstreamer plugin docs, h264parse as a 'src' has 'always' but hlssink2 as 'video' is 'request'. So, I try to retrieve the pad to link the two:

//hlspad returns null
GstPad* hlspad = gst_element_request_pad_simple(hlssink2, "video");

//videoParsePad is non-null
GstPad* videoParsePad = gst_element_get_static_pad(h264Parse, "src");

This is native side on Android, anyone know why this isn't working? Everything should be compatible


Solution

  • Using hlssink instead of hlssink2 works, good enough workaround