gst_element_class_get_pad_template does not return pud_template

Anton Olegovich ivanushkin.anton.olegovich at gmail.com
Sat Sep 6 05:11:32 PDT 2014


I want manualy link tee and autovideosink but
Can't get pad template with 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
#if 1
     /* Инициализируем пады и вручную связываем tee с видеосинком*/

     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");
    }
    /* data->pad_file_src = 
gst_element_request_pad(tee,tee_src_pad_template,NULL,NULL);
     g_print ("Obtained request pad %s for file branch.\n", 
gst_pad_get_name (data->pad_file_src));*/
     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);

why does this happens?


More information about the gstreamer-devel mailing list