Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gstreamer Can';t形连接垫_Gstreamer - Fatal编程技术网

Gstreamer Can';t形连接垫

Gstreamer Can';t形连接垫,gstreamer,Gstreamer,我正在使用gstreamer 1.0为android编写一个应用程序。我需要显示视频流,有时还需要将相同的流写入文件。现在我在练习手动连接垫。 我有这个密码: 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_eleme

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

 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\U焊盘\U link不会返回gst\U焊盘\U link\U OK。你知道为什么吗?可能是我无法直接链接tee和autovideosink,可能是我需要一些队列?但队列延迟更大

没关系。我只是没有将autovideosink添加到管道。

gst\U pad\u link返回gst\U pad\u link\u错误\u hierarchy哪个链接会出现该错误?尝试删除where
if(!gst\u element\u add\u pad(tee,pad\u surface\u src))gst\u错误(“无法将pad添加到tee”)
并让请求板创建自动创建它。一定要申报。