GStreamer audiomixer problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GStreamer audiomixer problem

Johan Basore
Hello,

I wrote some codes with Gstreamer ios sdk. But it not works, no errors, but the pipeline not plays.

    gst_element_link(source1, decodebin1);
    gst_element_link(source2, decodebin2);
   
    gst_element_link(decodebin1, audiomixer);
    gst_element_link(decodebin2, audiomixer);
    gst_element_link_many(audiomixer, audioconvert, avenc_ac3, audiosink, nil);

    g_signal_connect(decodebin1, "pad-added", G_CALLBACK(on_pad_added_audio1), audiomixer);
    g_signal_connect(decodebin2, "pad-added", G_CALLBACK(on_pad_added_audio2), audiomixer);


static void on_pad_added_audio1 (GstElement *element, GstPad *pad, gpointer data)
{
    GstPad *sinkpad;
   
    GstCaps *pCaps = gst_pad_get_current_caps(pad);
    GstStructure *pStructure = gst_caps_get_structure(pCaps, 0);
    gchar* pstrName = gst_structure_get_name(pStructure);
   
    if (g_str_has_prefix(pstrName, "audio"))
    {
        GST_DEBUG("Linking input pad to mixer - audio1");
       
        sinkpad = gst_element_get_request_pad((GstElement*)data, "sink_3");
        gst_pad_link(pad, sinkpad);
        gst_object_unref(sinkpad);
    }
}

static void on_pad_added_audio2 (GstElement *element, GstPad *pad, gpointer data)
{
    GstPad *sinkpad;
   
    GstCaps *pCaps = gst_pad_get_current_caps(pad);
    GstStructure *pStructure = gst_caps_get_structure(pCaps, 0);
    gchar* pstrName = gst_structure_get_name(pStructure);
   
    if (g_str_has_prefix(pstrName, "audio"))
    {
        GST_DEBUG("Linking input pad to mixer - audio2");
       
        sinkpad = gst_element_get_request_pad((GstElement*)data, "sink_4");
        gst_pad_link(pad, sinkpad);
        gst_object_unref(sinkpad);
    }
}

I can't understand what is wrong.
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer audiomixer problem

Sebastian Dröge-3
On Di, 2016-04-26 at 08:14 -0700, Johan Basore wrote:
> Hello,
>
> I wrote some codes with Gstreamer ios sdk. But it not works, no
> errors, but the pipeline not plays.

Please provide a complete example that can be compiled and runs, just
the code you pasted is not enough to find any mistakes in there.

Also did you check that the linking of both pads succeeds, i.e. the
gst_pad_link() calls? And gst_element_link_many()?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment