GST 1.11,
我已经创建了一个幻影垫,并通过以下方式确认它正在工作
gchar *ghost_pad_1_name = NULL;
ghost_pad_1_name = "myGhostPad'
ghost_pad_1 = gst_ghost_pad_new (ghost_pad_1_name, pad_src_1);
if(GST_PAD_DIRECTION(ghost_pad_1) == GST_PAD_SRC){
printf("Ghost is SRC -> correct\n"); // Correct
}
printf("Ghost Pad Name = %s\n",GST_ELEMENT_NAME(ghost_pad_1)); // myGhostPad但是,尝试使用以下命令获取元素将返回NULL
GstElement *TestGhostPad = gst_bin_get_by_name (ghost_pad_1_name);
if (!TestGhostPad){
printf("Ghost Pad is NULL\n"); // This is called
}
if (TestGhostPad){
printf("Ghost Pad is NOT NULL\n");
}我是否正确地使用了此函数?有没有其他方法可以通过name获得Ghost Pad。
感谢艺术
发布于 2017-09-11 12:22:51
GstElment* element;
GstElement* element2;
GstPad* GhostPad;
GhostPad = gst_element_get_static_pad(element, "sink");
gst_element_add_pad(element2, gst_ghost_pad_new("videosink", GhostPad));
gst_object_unref(GST_OBJECT(GhostPad));
GstPad* sinkpad = gst_element_get_static_pad(element2,"videosink");https://stackoverflow.com/questions/41015371
复制相似问题