Does anyone know how to support subtitles by Phonon?

Harald Sitter sitter at kde.org
Wed Jul 6 08:56:29 BST 2011


2011/7/6 W W <linuxmeego at gmail.com>:
> Hi Guys

Dude, stuff is not going to get answered any quicker if you post them
to more lists, particularly not if the list has almost the same
audience as phonon-backends....

> 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
> subtitles
>
>         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);
>
>         mediaController->setCurrentSubtitle(newSubtitle);
>
> 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,
> "subtitle_sink");
>
>         if (!GST_PAD_IS_LINKED(subtitlepad) && (gst_pad_link(pad,
> subtitlepad) == GST_PAD_LINK_OK)) {
>
>             gst_element_set_state(m_videoGraph, currentState ==
> GST_STATE_PLAYING ? GST_STATE_PLAYING : GST_STATE_PAUSED);
>
>             m_backend->logMessage("Subtitle track connected", Backend::Info,
> this);
>
>         } else {
>
>             m_backend->logMessage("Could not connect subtitle track");
>
>         }
>
>         gst_object_unref(subtitlepad);
>
>     } 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
>
> _______________________________________________
> kde-multimedia mailing list
> kde-multimedia at kde.org
> https://mail.kde.org/mailman/listinfo/kde-multimedia
>
>
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list