- else
- gst_pad_link(pad, gst_element_get_static_pad(gst_bin_get_by_name(pipeline,"queue_audio"), "sink"));
- }
- if (g_strrstr(name,"video"))
- {
- gst_pad_link(pad, gst_element_get_static_pad(gst_bin_get_by_name(pipeline,"queue_video"), "sink"));
- }
- if (g_strrstr(name,"subtitle"))
- {
-// GstCaps *caps;
-// const GstStructure *structure;
-// caps = gst_pad_get_caps(name);
-// structure = gst_caps_get_structure(caps, 0);
- char elemname[17];
- sprintf(elemname, "%s_pars", name);
- GstElement *parser = gst_element_factory_make("ssaparse", elemname);
- eDebug ("ssaparse %s = %p", elemname, parser);
- sprintf(elemname, "%s_sink", name);
- GstElement *sink = gst_element_factory_make("fakesink", elemname);
- eDebug ("fakesink %s = %p", elemname, sink);
- g_object_set (G_OBJECT(sink), "signal-handoffs", TRUE, NULL);
- gst_bin_add_many(pipeline, parser, sink, NULL);
- GstPadLinkReturn res = gst_pad_link(pad, gst_element_get_static_pad(parser, "sink"));
- eDebug ("parser link = %d", res);
- res = gst_element_link(parser, sink);
- eDebug ("sink link = %d", res);
- g_signal_connect(sink, "handoff", G_CALLBACK(gstCBsubtitleAvail), _this);
- subtitleStream subs;
- subs.element = sink;
- _this->m_subtitleStreams.push_back(subs);
- }
- g_free (name);
-}
-
-void eServiceMP3::gstCBfilterPadAdded(GstElement *filter, GstPad *pad, gpointer user_data)
-{
- eServiceMP3 *_this = (eServiceMP3*)user_data;
- GstElement *decoder = gst_bin_get_by_name(GST_BIN(_this->m_gst_pipeline),"decoder");
- gst_pad_link(pad, gst_element_get_static_pad (decoder, "sink"));
-}
-
-void eServiceMP3::gstCBnewPad(GstElement *decodebin, GstPad *pad, gboolean last, gpointer user_data)
-{
- eServiceMP3 *_this = (eServiceMP3*)user_data;
- GstCaps *caps;
- GstStructure *str;
- GstPad *audiopad;
-
- /* only link once */
- GstElement *audio = gst_bin_get_by_name(GST_BIN(_this->m_gst_pipeline),"audiobin");
- audiopad = gst_element_get_static_pad (audio, "sink");
- if ( !audiopad || GST_PAD_IS_LINKED (audiopad)) {
- eDebug("audio already linked!");
- g_object_unref (audiopad);
- return;
- }
-
- /* check media type */
- caps = gst_pad_get_caps (pad);
- str = gst_caps_get_structure (caps, 0);
- eDebug("gst new pad! %s", gst_structure_get_name (str));
-
- if (!g_strrstr (gst_structure_get_name (str), "audio")) {
- gst_caps_unref (caps);
- gst_object_unref (audiopad);
- return;