首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法链接焊盘

无法链接焊盘
EN

Stack Overflow用户
提问于 2014-09-07 18:53:37
回答 1查看 1.5K关注 0票数 2

我正在使用gstreamer 1.0为android编写一个应用程序。我需要显示视频流,有时,根据需要,将相同的流写入文件。现在我正在练习手动连接焊盘。我有这样的代码:

代码语言:javascript
复制
 gst_bin_add_many(GST_BIN(data->video_pipeline),udpsrc,rtph264depay,avdec_h264,/*videorate,*/clockoverlay,tee,queue_video_sink,queue_file_sink,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


#if 1
    if(!gst_element_add_pad(tee,pad_surface_src))
        GST_ERROR("Cant add pad to tee");


    tee_src_pad_template =  gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(tee),"src_%u");
    pad_surface_src = gst_element_request_pad(tee,tee_src_pad_template,NULL,NULL);

   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);
#endif

所有焊盘都已初始化,但gst_pad_link不返回GST_PAD_LINK_OK。你知道为什么吗?也许我不能直接连接tee和自动视频链接,也许我需要一些队列?但是队列有更多的延迟。

EN

回答 1

Stack Overflow用户

发布于 2014-09-09 00:47:01

没问题的。我只是没有将自动视频链接添加到管道中。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25709433

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档