Changes between Version 1 and Version 2 of QtWebKitMediaElementSupport


Ignore:
Timestamp:
Dec 7, 2009 12:50:15 AM (10 years ago)
Author:
vestbo@webkit.org
Comment:

--

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 =
    22
    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/)]]
    44
    5 ---++ Structure
     5== Structure ==
    66
    77DOM elements:
     
    2020   * =WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp= and =WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h=
    2121
    22 ---++ Limitations
     22== Limitations ==
    2323
    2424The current implementation has some limitations, partly due to lack of support in the Phonon API and backends.
    2525
    26 ---+++ Software rendering
     26=== Software rendering ===
    2727
    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]]=.
     28The 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.
    2929
    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.
     30For 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.
    3131
    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.
     32We 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.
    3333
    3434This works fine on X11 and Mac (a little slow), and the Windows bugs will get ironed out soon.
     
    3636See =$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.
    3737
    38 ---+++ Media loading
     38===  Media loading ===
    3939
    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.
     40Media loading is currently handled by Phonon, since we call MediaObject::setCurrentSource() passing in a =Phonon::MediaSource=
     41constructed 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.
    4242
    4343The 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.