수동 링크 티와 autovideosink를 원하지만 gst_element_class_get_pad_template으로 패드 템플릿을 가져올 수 없습니다.
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);
왜 이런 일이 발생합니까?
티의 패드 템플릿은 "src_ % u"(또는 0.10에서 "src_ % d")라고합니다. "src_1"대신 이름으로 사용해야합니다.
패드를 요청하려면 후자를 사용할 수 있지만, 티가 자동으로 선택한 이름 대신 해당 이름의 패드를 원하는 경우에만 그렇게하십시오. 티가 이름을 선택하게하는 것이 더 효율적입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다