link encodebin to decodebin failed

narcisse doudieu siewe wambenarcisse at yahoo.fr
Sun Sep 29 20:44:51 PDT 2013


Hello I have to link encodebin with decodebin but this failed
I dont know but it seems that gst_element_request_pad has some problems
when using gdb I get this error :

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xa95feb40 (LWP 4685)]
0xb7858c24 in gst_buffer_unmap (buffer=0x3d, info=info at entry=0xa95fdc24)
    at gstbuffer.c:1480
1480gstbuffer.c: Aucun fichier ou dossier de ce type.



the "added-pad" signal handler is like this....(when reading the Gstelement.c source file I don't see gst_element_get_compatible_pad so I never use it.) 


static void padd_added_on_decode(GstElement* decode, GstPad* new_pad, gpointer user_data)
{
McJobPrivate *priv = (MC_JOB(user_data))->priv;
GstCaps* caps = gst_pad_query_caps(new_pad, NULL);
gchar* caps_repr = gst_caps_to_string(caps);
       GstPad* pad = NULL; //gst_element_get_compatible_pad(priv->encode, new_pad, NULL);
printf("capabilities %s\n\n", caps_repr);
if(g_str_has_prefix(caps_repr, "video"))
{
       GstStaticPadTemplate static_tmpl = GST_STATIC_PAD_TEMPLATE("video_%u",
                                                                  GST_PAD_SINK,
                                                                  GST_PAD_REQUEST,
                                                                  GST_STATIC_CAPS_ANY);
        priv->video_tmpl = gst_static_pad_template_get(&static_tmpl);
        pad = gst_element_request_pad( priv->encode,
                                       priv->video_tmpl,
                                       "video_%u",
                                       caps);
    //gst_object_unref(priv->video_tmpl);
    //priv->video_tmpl = NULL;
        if(pad == NULL) goto not_handled;

    printf("video caps\n");
    //printf("just before return video\n");
//printf("get pad video\n");
//printf("salklk video\n");
//printf("link video caps\n");
}
if(g_str_has_prefix(caps_repr, "audio"))
{
    printf("audio caps\n");
        GstStaticPadTemplate static_tmpl = GST_STATIC_PAD_TEMPLATE("audio_%u",
                                                                   GST_PAD_SINK,
                                                                   GST_PAD_REQUEST,
                                                                   GST_STATIC_CAPS_ANY);
        priv->audio_tmpl = gst_static_pad_template_get(&static_tmpl);
        pad = gst_element_request_pad( priv->encode,
                                       priv->audio_tmpl,
                                       "audio_%u",
                                       caps);
    //gst_object_unref(priv->audio_tmpl);
    //priv->video_tmpl = NULL;
        if(pad == NULL) goto not_handled;
//printf("just before audio caps\n");
//if(pad == NULL) return;
//printf("dfdfdf audio\n");
//printf("delooo audio\n");
//printf("link audio pad\n");
}
    if(gst_pad_can_link (new_pad, pad))
    {
      gst_pad_link(new_pad, pad);
    }
    else goto not_handled;
GstCaps* caps1 = gst_pad_query_caps(pad, NULL);
gchar* caps_repr1 = gst_caps_to_string(caps1);
printf("caps_repr1 for %s\n", caps_repr1);
    printf("test i fonction\n");
gst_caps_unref(caps);
g_free(caps_repr);
gst_caps_unref(caps1);
g_free(caps_repr1);
printf("template video is not null\n");
return;
printf("hello\n");
not_handled:
{
        GstMessage* tmp = priv->eos_msg;
priv->eos_msg = gst_message_copy(tmp);
    printf("coco mentole cuisse mentole\n");
gst_bus_post(priv->bus, tmp);
    }
}

I don't know where this problem leave

In attachement you can find two things, a picture to illustrate how to execute my application and another file for my application
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130930/d0f8b191/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mcconverter
Type: application/octet-stream
Size: 191257 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130930/d0f8b191/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture du 2013-09-30 03:30:54.png
Type: image/png
Size: 158349 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130930/d0f8b191/attachment-0001.png>


More information about the gstreamer-devel mailing list