GStreamer audiomixer problem
Johan Basore
johan_dream at hotmail.com
Tue Apr 26 15:14:04 UTC 2016
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.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/GStreamer-audiomixer-problem-tp4677120.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list