Subtitle API

Ian Monroe ian at monroe.nu
Wed Jun 30 01:08:12 BST 2010


On Tue, Jun 29, 2010 at 6:46 PM, Tanguy Krotoff <tkrotoff at gmail.com> wrote:
> On Tue, Jun 29, 2010 at 11:45 PM, Martin Sandsmark <sandsmark at samfundet.no>
> wrote:
>>
>> On Tuesday 29 June 2010 22:59:13 Ian Monroe wrote:
>>
>> > setAutoDetectSubtitles should be setAutoDetectSubtitle I think. Or all
>>
>> > the API should say "subtitles".
>>
>> Well, setAutoDetectSubtitles might possibly detect several possible
>> subtitles, no?
>
> Usually works as follow: if the player detects a subtitle file that matches
> the video filename, then this subtitle file is loader automatically. Several
> possible subtitles means the user still must choose the right subtitle.
>
> This feature can be very easily coded outside phonon (using
> QDir::entryList() + MediaController::setCurrentSubtitle()). If you add these
> functions to Phonon then all the backends should implement them. Kind of
> complete/complex API vs small/simple for me.
>
>> > I'm worried that setSubtitleEncoding is a bit Xine-specific. But text
>>
>> > codecs suck, so perhaps there's no way around it.
>>
>> I can't find any libvlc API to specify it either, but I think it might
>> warrant an addition.
>
> I don't remember MPlayer offering this feature.
>
>
> About setFileSubtitle(const MediaSource &subtitle), I already use
> setCurrentSubtitle(const Phonon::SubtitleDescription &stream) to load a
> subtitle file:
>
> QHash<QByteArray, QVariant> properties;
> properties.insert("type", "file");
> properties.insert("name", fileName);
> Phonon::SubtitleDescription newSubtitle(newSubtitleId, properties);
> mediaController->setCurrentSubtitle(newSubtitle);

Good point I completely forgot that we already have a subtitle API.
Which is funny since I think I wrote it. So I'm concerned with how
these two APIs will interact. Does the subtitle get added to the
available subtitles?

Ian



More information about the kde-multimedia mailing list