Does anyone know how to support subtitles by Phonon?

W W linuxmeego at
Wed Jul 6 08:32:53 BST 2011

Hi Guys

Does anyone know how to support subtitles (such as srt, sub, ass/ssa,
smi...) by Phonon which backend is phonon-backend-gstreamer?
I check the Phonon source code,I find the MediaController class.It provide
some functions for subtitles.
But I try these code following which don't work.

       //Create the new subtitle and add it to the list of available

        if(mediaController == NULL)


            mediaController = new Phonon::MediaController(media);


        QString fileName = "/home/simon/Desktop/video/test.sub";

        QHash<QByteArray, QVariant> properties;

        properties.insert("type", "file");

        properties.insert("name", fileName);

        Phonon::SubtitleDescription newSubtitle(0, properties);


And I download the source code of phonon-backend-gstreamer.

I find there are some function about subtitle in MediaObject.cpp.

void MediaObject::addSubtitle(GstPad *pad)


    GstState currentState = GST_STATE(m_pipeline);

    if (addToPipeline(m_videoGraph)) {

        GstPad *subtitlepad = gst_element_get_pad(m_videoGraph,

        if (!GST_PAD_IS_LINKED(subtitlepad) && (gst_pad_link(pad,
subtitlepad) == GST_PAD_LINK_OK)) {

            gst_element_set_state(m_videoGraph, currentState ==

            m_backend->logMessage("Subtitle track connected", Backend::Info,

        } else {

            m_backend->logMessage("Could not connect subtitle track");



    } else {

        m_backend->logMessage("The video stream could not be plugged.",
Backend::Info, this);



But there is no prase subtitle function.

So Could anyone give me some suggestion about how to support subtitles by
Phonon or gstreamer?

Or Is there any media player which write by Phonon and whose backend is
phonon-backend-gstreamer can support subtitle ?

I can download the source code to check how it works
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
kde-multimedia mailing list
kde-multimedia at

More information about the kde-multimedia mailing list