Bug 53325 - [Qt] canvas.drawImage(HTMLVideoElement) doesn't work with Qt Multimedia backend
Summary: [Qt] canvas.drawImage(HTMLVideoElement) doesn't work with Qt Multimedia backend
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2011-01-28 12:53 PST by Kalle Vahlman
Modified: 2011-02-01 05:50 PST (History)
7 users (show)

See Also:


Attachments
Patch to fix drawImage(HTMLVideoElement) for Qt Multimedia (2.40 KB, patch)
2011-01-28 12:55 PST, Kalle Vahlman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kalle Vahlman 2011-01-28 12:53:57 PST
Currently, the 2D canvas API call drawImage() with an video element fails to render the video frame to the canvas with the Qt Multimedia backend.

The drawImage() call eventually ends up calling MediaPlayerPrivate::paintCurrentFrameInContext() which simply delegates to paint().

There seems to be two issues with this:

 - When AC is enabled, the paint() call is a no-op, thus the rendering never happens.
 - Even without AC, rendering the scene to the context painter doesn't work (not sure why this is).

A simple solution for this is to reimplement the paintCurrentFrameInContext() and paint the QGraphicsVideoItem directly, so the video scene state doesn't affect the rendering (I suppose that's the problem currently).

Patch incoming.
Comment 1 Kalle Vahlman 2011-01-28 12:55:51 PST
Created attachment 80485 [details]
Patch to fix drawImage(HTMLVideoElement) for Qt Multimedia
Comment 2 Benjamin Poulain 2011-01-28 18:05:08 PST
Please follow http://trac.webkit.org/wiki/QtWebKitBugs when reporing bug here (missing Qt keyworkd).
Comment 3 Eric Seidel (no email) 2011-01-30 04:02:19 PST
Looks sane to me, but a Qt person shoudl really look.
Comment 4 Andreas Kling 2011-01-31 17:00:10 PST
Comment on attachment 80485 [details]
Patch to fix drawImage(HTMLVideoElement) for Qt Multimedia

Kool fix! r=me
Comment 5 WebKit Commit Bot 2011-01-31 19:46:31 PST
Comment on attachment 80485 [details]
Patch to fix drawImage(HTMLVideoElement) for Qt Multimedia

Clearing flags on attachment: 80485

Committed r77207: <http://trac.webkit.org/changeset/77207>
Comment 6 WebKit Commit Bot 2011-01-31 19:46:36 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Benjamin Poulain 2011-02-01 05:50:51 PST
Nice work. How http://www.craftymind.com/factory/html5video/CanvasVideo.html looks with the patch? :)