<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:14pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;">Hello I have to link encodebin with decodebin but this failed</div><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;">I dont know but it seems that gst_element_request_pad has some problems</div><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;">when using gdb I get this error :</div><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;"><br></div><div style="background-color: transparent;"><span style="font-size: 19px;">Program received signal SIGSEGV, Segmentation fault.</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">[Switching to Thread 0xa95feb40 (LWP 4685)]</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">0xb7858c24 in
gst_buffer_unmap (buffer=0x3d, info=info@entry=0xa95fdc24)</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> at gstbuffer.c:1480</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">1480<span class="Apple-tab-span" style="white-space:pre"> </span>gstbuffer.c: Aucun fichier ou dossier de ce type.</span></div><div><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 14pt;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 19px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 19px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">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.) </div><div
style="font-family: arial, helvetica, sans-serif; font-size: 19px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 19px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><span style="font-size: 19px;">static void padd_added_on_decode(GstElement* decode, GstPad* new_pad, gpointer user_data)</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">{</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>McJobPrivate *priv = (MC_JOB(user_data))->priv;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>GstCaps* caps = gst_pad_query_caps(new_pad,
NULL);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>gchar* caps_repr = gst_caps_to_string(caps);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> GstPad* pad = NULL; //gst_element_get_compatible_pad(priv->encode, new_pad, NULL);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>printf("capabilities %s\n\n", caps_repr);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>if(g_str_has_prefix(caps_repr, "video"))</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>{</span></div><div
style="background-color: transparent;"><span style="font-size: 19px;"> GstStaticPadTemplate static_tmpl = GST_STATIC_PAD_TEMPLATE("video_%u",</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> GST_PAD_SINK,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> GST_PAD_REQUEST,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">
GST_STATIC_CAPS_ANY);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> priv->video_tmpl = gst_static_pad_template_get(&static_tmpl);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> pad = gst_element_request_pad( priv->encode,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> priv->video_tmpl,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">
"video_%u",</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> caps);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> //gst_object_unref(priv->video_tmpl);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> //priv->video_tmpl = NULL;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> if(pad == NULL) goto not_handled;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><br></span></div><div
style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> printf("video caps\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> //printf("just before return video\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("get pad video\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("salklk video\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("link video caps\n");</span></div><div style="background-color: transparent;"><span
style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>}</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>if(g_str_has_prefix(caps_repr, "audio"))</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>{</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> printf("audio caps\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> GstStaticPadTemplate static_tmpl = GST_STATIC_PAD_TEMPLATE("audio_%u",</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">
GST_PAD_SINK,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> GST_PAD_REQUEST,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> GST_STATIC_CAPS_ANY);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">
priv->audio_tmpl = gst_static_pad_template_get(&static_tmpl);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> pad = gst_element_request_pad( priv->encode,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> priv->audio_tmpl,</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> "audio_%u",</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">
caps);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> //gst_object_unref(priv->audio_tmpl);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> //priv->video_tmpl = NULL;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> if(pad == NULL) goto not_handled;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("just before audio caps\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//if(pad == NULL) return;</span></div><div style="background-color:
transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("dfdfdf audio\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("delooo audio\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>//printf("link audio pad\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>}</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> if(gst_pad_can_link (new_pad, pad))</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> {</span></div><div style="background-color: transparent;"><span style="font-size:
19px;"> gst_pad_link(new_pad, pad);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> }</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> else goto not_handled;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>GstCaps* caps1 = gst_pad_query_caps(pad, NULL);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>gchar* caps_repr1 = gst_caps_to_string(caps1);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>printf("caps_repr1 for %s\n", caps_repr1);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">
printf("test i fonction\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>gst_caps_unref(caps);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>g_free(caps_repr);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>gst_caps_unref(caps1);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>g_free(caps_repr1);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>printf("template video is not null\n");</span></div><div style="background-color: transparent;"><span
style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>return;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>printf("hello\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>not_handled:</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>{</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> GstMessage* tmp = priv->eos_msg;</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>priv->eos_msg =
gst_message_copy(tmp);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span> printf("coco mentole cuisse mentole\n");</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"><span class="Apple-tab-span" style="white-space:pre"> </span>gst_bus_post(priv->bus, tmp);</span></div><div style="background-color: transparent;"><span style="font-size: 19px;"> }</span></div><div style="background-color: transparent;"><span style="font-size: 19px;">}</span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-size: 19px;"><br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span
style="font-size: 19px;">I don't know where this problem leave</span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-size: 19px;"><br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 19px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-size: 19px;">In attachement you can find two things, a picture to illustrate how to execute my application and another file for my application</span></div></div></body></html>