0
GST 1.11得到鬼觸摸板元件,GStreamer的正確方法通過名稱
我創建了一個鬼墊並確認它是由以下
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");
}
我是否正確使用此功能?是否有另一種方法獲得Ghost Pad name
。
感謝藝術