-void eServiceMP3::gstCBsubtitleLink(subtype_t type, gpointer user_data)
-{
- eServiceMP3 *_this = (eServiceMP3*)user_data;
-
- if ( type == stVOB )
- {
- GstPad *ghostpad = gst_element_get_static_pad(_this->m_gst_subtitlebin, "sink");
- GstElement *dvdsubdec = gst_bin_get_by_name(GST_BIN(_this->m_gst_subtitlebin), "vobsubtitle_decoder");
- GstPad *subdecsinkpad = gst_element_get_static_pad (dvdsubdec, "sink");
- int ret = gst_ghost_pad_set_target((GstGhostPad*)ghostpad, subdecsinkpad);
- GstElement *appsink = gst_bin_get_by_name(GST_BIN(_this->m_gst_subtitlebin), "subtitle_sink");
- ret += gst_element_link(dvdsubdec, appsink);
- eDebug("gstCBsubtitleLink:: dvdsubdec=%p, subdecsinkpad=%p, ghostpad=%p, set target & link=%i", dvdsubdec, subdecsinkpad, ghostpad, ret);
- }
- else if ( type < stVOB && type > stUnknown )
- {
- GstPad *ghostpad = gst_element_get_static_pad(_this->m_gst_subtitlebin, "sink");
- GstElement *appsink = gst_bin_get_by_name(GST_BIN(_this->m_gst_subtitlebin), "subtitle_sink");
- GstPad *appsinkpad = gst_element_get_static_pad (appsink, "sink");
- GstElement *dvdsubdec = gst_bin_get_by_name(GST_BIN(_this->m_gst_subtitlebin), "vobsubtitle_decoder");
- gst_element_unlink(dvdsubdec, appsink);
- int ret = gst_ghost_pad_set_target((GstGhostPad*)ghostpad, appsinkpad);
- eDebug("gstCBsubtitleLink:: appsink=%p, appsinkpad=%p, ghostpad=%p, set target=%i", appsink, appsinkpad, ghostpad, ret);
- }
- else
- {
- eDebug("gstCBsubtitleLink:: unsupported subtitles");
- }
-}