Changes between Version 1 and Version 2 of QtWebKitMediaElementSupport
- Timestamp:
- Dec 7, 2009, 12:50:15 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QtWebKitMediaElementSupport
v1 v2 1 ---+ Details of the QtWebKit HTML5 media element implementation 1 = Details of the QtWebKit HTML5 media element implementation = 2 2 3 <a href="http://chaos.troll.no/~tavestbo/webkit/mediaelement/"><img src="http://chaos.troll.no/~tavestbo/webkit/mediaelement/screenshot.png" width=500></a> 3 [[Image(http://chaos.troll.no/~tavestbo/webkit/mediaelement/)]] 4 4 5 ---++ Structure 5 == Structure == 6 6 7 7 DOM elements: … … 20 20 * =WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp= and =WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h= 21 21 22 ---++ Limitations 22 == Limitations == 23 23 24 24 The current implementation has some limitations, partly due to lack of support in the Phonon API and backends. 25 25 26 ---+++ Software rendering 26 === Software rendering === 27 27 28 The implementation is based on a =[[http://doc.trolltech.com/4.4/phonon-videowidget.html][Phonon::VideoWidget]]=, which is rendered in =MediaPlayerPrivate::paint()= by a call to =[[http://doc.trolltech.com/4.4/qwidget.html#render][QWidget::render()]]=, passing the active webkit =[[http://doc.trolltech.com/4.4/qwidget.html][QPainter]]=.28 The implementation is based on a Phonon::VideoWidget, which is rendered in MediaPlayerPrivate::paint() by a call to QWidget::render(), passing the active webkit =QPainter. Update notification of video-frames are triggered by an event filter on the VideoWidget. 29 29 30 For this technique to work we have to make sure the Phonon back-end either uses a software rendering path, using the QPainter to draw the video, or that any accelerated drawing does not change the context state of the =QPainter=and allows WebKit to continue drawing on top after the video has been rendered. In other words, no XVideo or ad hock accelerated drawing.30 For this technique to work we have to make sure the Phonon back-end either uses a software rendering path, using the QPainter to draw the video, or that any accelerated drawing does not change the context state of the QPainter and allows WebKit to continue drawing on top after the video has been rendered. In other words, no XVideo or ad hock accelerated drawing. 31 31 32 We set the window flag =WA_DontShowOnScreen=on the video widget, as a hint to the back-end to use this software path. The reason for the software path requirement is that we want HTML content overlapping with the video to not be clipped by the video.32 We set the window flag WA_DontShowOnScreen on the video widget, as a hint to the back-end to use this software path. The reason for the software path requirement is that we want HTML content overlapping with the video to not be clipped by the video. 33 33 34 34 This works fine on X11 and Mac (a little slow), and the Windows bugs will get ironed out soon. … … 36 36 See =$QTDIR/src/3rdparty/kdebase/runtime/phonon/gstreamer/videowidget.cpp=, =$QTDIR/src/3rdparty/kdebase/runtime/phonon/ds9/videowidget.cpp=, and =$QTDIR/src/3rdparty/kdebase/runtime/phonon/qt7/videowidget.cpp= for examples. 37 37 38 ---+++ Media loading 38 === Media loading === 39 39 40 Media loading is currently handled by Phonon, since we call =[[http://doc.trolltech.com/4.4/phonon-mediaobject.html#setCurrentSource][MediaObject::setCurrentSource()]]=passing in a =Phonon::MediaSource=41 constructed from a URL. The alternative would be to handle loading using WebKit's normal resource loading mechanisms, and then use a =MediaSource= constructed from a =[[http://api.kde.org/4.0-api/kdelibs-apidocs/phonon/html/classPhonon_1_1AbstractMediaStream.html][Phonon::AbstractMediaStream]]=to feed the loaded data from WebKit to Phonon.40 Media loading is currently handled by Phonon, since we call MediaObject::setCurrentSource() passing in a =Phonon::MediaSource= 41 constructed from a URL. The alternative would be to handle loading using WebKit's normal resource loading mechanisms, and then use a =MediaSource= constructed from a Phonon::AbstractMediaStream to feed the loaded data from WebKit to Phonon. 42 42 43 43 The problem is that on Mac OSX there is no way to continuously feed QuickTime the data on the back-end side (only in one big chunk, which is hardly optimal for streaming data), so a solution based on =AbstractMediaStream= would not be cross platform.