On Wednesday 30 June 2010 13:24:50 ext Jason H wrote: > SMI is a standard XML-based subtitle format, that WMP and others use... It > uses HTML, so all that setFont() stuff should be irrelevant. Also, note > that if the filename in (filename).(ext) matches, an SMI file, that WMP > will automatically use it if captions are enabled on the player. It > functions as a QLabel over the video. > > I'm just thinking whatever is done shouldn't re-invent the wheel. >
Subtitle fonts are included in many of subtitle formats, and for subtitles with the name matching the main media the current API is sufficient (with the change similar to proposed patch applied). It may be useful to specify font with some older subtitle formats like SRT, maybe also for teletext based subtitles, etc. Regards Dmytro. > > > ----- Original Message ---- > From: Dmytro Poplavskiy <dmytro.poplavs...@nokia.com> > To: "ext Chen, Jacob" <jacob.c...@intel.com> > Cc: "qt-mobility-feedback@trolltech.com" > <qt-mobility-feedback@trolltech.com> Sent: Tue, June 29, 2010 11:11:48 PM > Subject: Re: [Qt-mobility-feedback] Subtitle support in Qt-mobility > > Hi Jacob, > > On Tuesday 29 June 2010 18:50:04 ext Chen, Jacob wrote: > > Hello, Dmytro, > > > > How are you, I’m Jacob from Intel. :) > > As your consideration, “To extend the QMediaContent to add optional > > subtitle url” will just like adding a couple APIs like setSubtitleUri(), > > SubtitleUri() to QMediaContent? If so, I guess that, when calling > > setMedia() in QmediaPlayer, the subtitle will be set in the backend. > > However, I think this may limit to change the subtitle while playing > > video, but there may be requirement to change subtitle while playing > > video. > > For adding subtitles during playback, just extending QMediaContent > may not be enough, in this case the better solution would be to add control > like QMediaPlayerSubtitlesControl, with methods like addSubtitle(), > setFont() etc, with added subtitle stream automatically activated and > presented in QMediaStreamsControl. > > > By the way, any plan to come out the roadmap for external subtitle APIs > > support in qt-mobility? > > I can't tell an exact date, > during the next qtmobility multimedia releases. > > > Best Regards, > > - Jacob > > Regards > Dmytro. > > > ________________________________ > > From: dmytro.poplavs...@nokia.com [mailto:dmytro.poplavs...@nokia.com] > > Sent: Tuesday, June 29, 2010 8:40 AM > > To: Zhao, Halley > > Cc: justin.mcpher...@nokia.com; Chen, Jacob; > > qt-mobility-feedback@trolltech.com Subject: Re: Subtitle support in > > Qt-mobility > > > > Hi Halley, > > > > I'm keeping in mind the subtitles support case, > > currently for subtitles embedded into the stream or connected to the > > stream (like DVD, DVB stream, mkv files, etc) backend may load and > > render subtitles itself, and provide QMediaStreamsControl to allows > > application to select which subtitles or audio tracks to render. > > > > We don't currently have an API to specify the external subtitles url, > > I expect to extend the QMediaContent to add optional subtitle url, but > > this is not decided yet. > > > > Regards > > > > Dmytro. > > > > On 29/06/2010, at 10:25 AM, ext Zhao, Halley wrote: > > > > > > Hi Dmytro & Justin: > > Some customers request subtitle features, we need it support from > > QtMobility. How is your plan to support it? > > Thanks > > > > > > > > ________________________________ > > From: > > qt-mobility-feedback-boun...@trolltech.com<mailto:qt-mobility-feedback-bo > > u n...@trolltech.com> [mailto:qt-mobility-feedback-boun...@trolltech.com] > > On Behalf Of Chen, Jacob Sent: 2010年6月24日 14:23 > > To: > > qt-mobility-feedback@trolltech.com<mailto:qt-mobility-feedb...@trolltech. > > c om> Subject: [Qt-mobility-feedback] Subtitle support in Qt-mobility > > > > Hi here, > > I’m looking for a way to render subtitle file with video playback in > > qt-mobility. I found that qt-mobility is lack of subtitle/APIs support. > > Qt-mobility is using gstream playbin as the back-end of media player, but > > the subtitle functions haven’t been enabled. I made a simple patch to > > enable gstreamer plug-in to find and render the subtitle file which has > > same name as the media file automatically. > > > > ------------------------------------------------------------------------- > > -- > > ------------------------------------------------------------------------ > > --- ------------ > > > > diff --git > > a/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp > > b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp > > index 58ba160..7510be6 100644 > > --- > > a/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp > > +++ > > b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp > > @@ -286,7 +286,7 @@ void QGstreamerPlayerControl::setMedia(const > > QMediaContent &content, QIODevice * m_seekToStartPending = false; > > > > QUrl url; > > > > - > > + > > > > if (m_stream) { > > > > if (m_stream->isReadable() && openFifo()) { > > > > url = > > > > QUrl(QString(QLatin1String("fd://%1<fd://%251>")).arg(m_fifoFd[0])); @@ > > -296,7 +296,7 @@ void QGstreamerPlayerControl::setMedia(const > > QMediaContent &content, QIODevice * } > > > > m_session->load(url); > > > > - > > + > > > > if (m_fifoFd[1] >= 0) { > > > > m_fifoCanWrite = true; > > > > @@ -304,6 +304,20 @@ void QGstreamerPlayerControl::setMedia(const > > QMediaContent &content, QIODevice * } > > > > if (!url.isEmpty()) { > > > > + QString subtitle_file = ".srt"; > > + QFileInfo fi(url.toLocalFile ()); > > + subtitle_file.prepend(fi.baseName()); > > + subtitle_file.prepend("/"); > > + subtitle_file.prepend(fi.absolutePath()); > > + > > + QFile file(subtitle_file); > > + if (file.exists()) { > > + subtitle_file.prepend("file://"); > > + m_session->set_sub_encoding("UTF"); > > + m_session->set_sub_font_desc("san bold 20"); > > + m_session->load_subtitle(QUrl(subtitle_file)); > > + } > > + > > > > if (m_mediaStatus != QMediaPlayer::LoadingMedia) > > > > emit mediaStatusChanged(m_mediaStatus = > > > > QMediaPlayer::LoadingMedia); m_session->pause(); > > diff --git > > a/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp > > b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp > > index 942a8ba..5c6aa77 100644 > > --- > > a/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp > > +++ > > b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.cpp > > @@ -151,6 +151,26 @@ void QGstreamerPlayerSession::load(const QUrl &url) > > > > } > > > > } > > > > + > > +void QGstreamerPlayerSession::load_subtitle(const QUrl &url) > > +{ > > + m_url = url; > > + > > + if (m_playbin) > > + g_object_set(G_OBJECT(m_playbin), "suburi", > > m_url.toEncoded().constData(), NULL); +} > > + > > + > > +void QGstreamerPlayerSession::set_sub_encoding(const QString > > &encoding_String) { + if (m_playbin) > > + g_object_set(G_OBJECT(m_playbin), "subtitle-encoding", > > encoding_String.toLatin1().constData(), NULL); + } > > + > > +void QGstreamerPlayerSession::set_sub_font_desc(const QString > > &font_desc_String) { + if (m_playbin) > > + g_object_set(G_OBJECT(m_playbin), "subtitle-font-desc", > > font_desc_String.toLatin1().constData(), NULL); +} > > + > > > > qint64 QGstreamerPlayerSession::duration() const > > { > > > > return m_duration; > > > > diff --git > > a/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h > > b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h > > index 17f17bd..9550f38 100644 > > --- a/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h > > +++ b/plugins/multimedia/gstreamer/mediaplayer/qgstreamerplayersession.h > > > > @@ -102,6 +102,9 @@ public: > > public slots: > > void load(const QUrl &url); > > > > + void load_subtitle(const QUrl &url); > > + void set_sub_encoding(const QString &encoding_String); > > + void set_sub_font_desc(const QString &font_desc_String); > > > > bool play(); > > bool pause(); > > > > ------------------------------------------------------------------------- > > -- > > ------------------------------------------------------------------------ > > --- ------------ > > > > I think the right way is to let QMediaplayer support subtitle APIs like, > > set_subtitle(), set_subtitle_encoding() and set_subtitle_font(), the > > application could have fully control of subtitle. Any suggestion? > > Jacob > > _______________________________________________ > Qt-mobility-feedback mailing list > Qt-mobility-feedback@trolltech.com > http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback _______________________________________________ Qt-mobility-feedback mailing list Qt-mobility-feedback@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback