Gstreamer gst\u元素\u类\u get\u pad\u模板不返回pud\u模板
我想要手动链接T恤和自动视频接收器,但是 无法使用gst\u元素\u类\u获取\u焊盘\u模板获取焊盘模板:Gstreamer gst\u元素\u类\u get\u pad\u模板不返回pud\u模板,gstreamer,Gstreamer,我想要手动链接T恤和自动视频接收器,但是 无法使用gst\u元素\u类\u获取\u焊盘\u模板获取焊盘模板: data->video_pipeline = gst_pipeline_new ("videopipeline"); gst_bin_add_many(GST_BIN(data->video_pipeline),udpsrc,rtph264depay,avdec_h264,/*videorate,* /clockoverlay,tee,/*queue,*/autovideos
data->video_pipeline = gst_pipeline_new ("videopipeline");
gst_bin_add_many(GST_BIN(data->video_pipeline),udpsrc,rtph264depay,avdec_h264,/*videorate,* /clockoverlay,tee,/*queue,*/autovideosink,NULL);
if (!gst_element_link_filtered (udpsrc,rtph264depay,udpsrc_caps)){
GST_ERROR ("Can't link udpsrc and rtph264depay with caps");
}
if (!gst_element_link_many (rtph264depay,avdec_h264,/*videorate,*/clockoverlay,tee,NULL)){
GST_ERROR ("Can't link many to tee");
}
gst_object_unref (G_OBJECT(videorate_src_pad));//Возможно получится ошибка с пямятью
gst_caps_unref(videorate_caps);///Освобождаем caps
tee_src_pad_template = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(tee),"src_1");
pad_surface_src = gst_element_request_pad(tee,tee_src_pad_template,"src_%d",NULL);
// pad_surface_src = gst_element_get_request_pad(tee,"src_%d");
if(!pad_surface_src){
g_printerr ("Can't obtain request pad src for tee.\n");
}
/
pad_surface_sink = gst_element_get_static_pad(autovideosink,"sink");
if(!pad_surface_sink){
g_printerr ("Can't obtain request pad sink for autovideosink.\n");
}
if (gst_pad_link (pad_surface_src,pad_surface_sink)!=GST_PAD_LINK_OK){
g_printerr ("Tee could not be linked.\n");
gst_object_unref (data->video_pipeline);
return -1;
}
gst_object_unref(pad_surface_sink);
为什么会发生这种情况 T形三通上的焊盘模板称为“src_u%u”(或0.10中的“src_%d”)。您必须将其用作名称,而不是“src_1”
对于请求焊盘,您可以使用后者,但仅当您希望焊盘使用这些名称,而不是通过T形三通自动选择名称时,才可以使用后者。让tee选择名字更有效。谢谢!问题是我使用的是gst 1.0而不是0.1,所以src必须像“src_u%u”而不是“src_%d”。谢谢