Can't manualy link pads

Thiago Santos thiagoss at osg.samsung.com
Thu Sep 11 07:30:16 PDT 2014


On 09/07/2014 12:19 PM, Anton Olegovich wrote:
> I need to display video stream and some times, as required, to write 
> the same stream to file. Now i'm in practic with manualy linking pads. 
> I've got this code:
> |  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");|
This seems wrong, you shouldn't be adding pads to tee, but requesting 
pads from it and tee will create and add the pad itself.

> |
>
>
>      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){|
|Did you check what was the error code? Which was the exact return here?|
> |
>          g_printerr ("Tee could not be linked.\n");
>          gst_object_unref (data->video_pipeline);
>          return -1;
>      }
>      gst_object_unref(pad_surface_sink);
> #endif
> |
>
> all pads are initialized, but gst_pad_link does not returns 
> GST_PAD_LINK_OK. Do you know why? May be i can't to link tee and 
> autovideosink directly, may be i need some queue? but queue do more 
> latency.
>

You might just be missing a videoconvert element. Does your pipeline 
work with gst-launch-1.0?

>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


-- 
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140911/7e091487/attachment.html>


More information about the gstreamer-devel mailing list