[webkit-dev] Rendering Video using video overlay rather than on a Cairo surface (Graphics overlay)

Ajit Singh ajit.singh at 2wire.com
Thu Jun 4 21:26:36 PDT 2009


The first problem which i'm facing in this endaveour is of translating the coordinates from WebKit domain to the BCM Framebuffer. Basically the coordinates supplied in paint/setsize cannot be directly used on the native graphics software layer.
Let me explain:
I'm trying to render a web page of 1280x720, I also made sue that DirectFB creates a Frame Buffer of 1280x720 and then finally I made sure that output resolution of the display is also 1280x720.
In this web page the Video Element is at an offset of x=300,y=300, w=160,120 with  a Background Poster. when I try to create a rectangle with the supplied coordinates on the video plane, it does not completely cover the background poster, or in other words the coordinate cannot be directly used.
Do you guys have some suggestion ?

-----Original Message-----
From: Simon Fraser [mailto:simon.fraser at apple.com]
Sent: Sat 5/30/2009 8:52 AM
To: Sriram Neelakandan
Cc: Ajit Singh; webkit-dev at lists.webkit.org
Subject: Re: [webkit-dev] Rendering Video using video overlay rather than on	a Cairo surface (Graphics overlay)
 
On May 29, 2009, at 10:12 PM, Sriram Neelakandan wrote:

> On Sat, May 30, 2009 at 9:44 AM, Ajit Singh <ajit.singh at 2wire.com>  
> wrote:
>> a custom MIPS processor which has a dedicated video scalar on it.
> I guess the BCM7xxx chip must have an attribute window to control the
> Video and Graphics Plane blending.
>
>>
>> I want to render video using a video scalar instead of this Cairo  
>> surface. I
>> came to know the video coordinates of the Videobox are inside paint  
>> function
>> of MediaPlayerPrivateGstreamer..
>> What is the best way to do it?
>
> So what u can do is this:
> When the setSize/paint function gets called; "size and rect indicate
> the visible video area to be displayed"
> Setup the Attribute window to blend the Graphics over Video.
> In case you dont have an attribute window and use the Alpha bits in
> ARGB8888 OSD mode ;
> then u will have to fill the necessary Alpha bits in your primary  
> OSD plane !

Something else you should consider here is ways that the video can be  
clipped
and transformed. Video should be clipped by CSS overflow and clip, and  
can also
be scrolled inside an iframe. All these need to clip the video  
correctly.

You should also consider CSS transforms, which can cause the video to  
be rotated,
or scaled.

Any solution which naively puts a hardware surface over some rect  
where the video is
supposed to be will be broken in many cases.

> Now the tough job is to blend Graphics/HTML controls that the page
> will render on top of the Video plane
> That may require some hacking in the Renderer to see whats below and
> ensure we tweak the Alpha bits to bring Graphics on top for those
> player controls alone (with transparency maintained as per CSS rules
> !)
>
> Will be interested in knowing your proceedings ..

This is exactly what the ACCELERATED_COMPOSITING code path does. There  
is
currently a Core Animation backend for Mac (GraphicsLayerCA.mm); you'd  
have to
write a backend for your compositing system if you wish to use this  
code path.

Simon







More information about the webkit-dev mailing list