return MEDIA_STREAMER_ERROR_NONE;
}
+ if (!(ghost_pad_in = (GstGhostPad *)gst_element_get_static_pad(webrtc_container, pad_name))) {
+ ms_error("Failed to get ghost pad for webrtc_container");
+ return MEDIA_STREAMER_ERROR_INVALID_OPERATION;
+ }
+
+ if (!gst_pad_is_linked((GstPad *)ghost_pad_in)) {
+ ms_error("[%s] is set media format but not linked to peer node", pad_name);
+ MS_SAFE_UNREF(ghost_pad_in);
+ return MEDIA_STREAMER_ERROR_INVALID_OPERATION;
+ }
+
ms_info("%s is found, link it with webrtcbin and export the ghost pad[%s] of webrtc_container",
capsfilter_name, pad_name);
ret = MEDIA_STREAMER_ERROR_INVALID_OPERATION;
goto end;
}
- if (!(ghost_pad_in = (GstGhostPad *)gst_element_get_static_pad(webrtc_container, pad_name))) {
- ms_error("Failed to get ghost pad for webrtc_container");
- ret = MEDIA_STREAMER_ERROR_INVALID_OPERATION;
- goto end;
- }
+
if (!(filter_sink_pad = gst_element_get_static_pad(filter, "sink"))) {
ms_error("Failed to get capsfilter sink pad in webrtc_container");
ret = MEDIA_STREAMER_ERROR_INVALID_OPERATION;