Color issue in windowless mode on Chrome (Ver 27)

116 views
Skip to first unread message

John Tan

unread,
May 28, 2013, 10:12:11 PM5/28/13
to firebre...@googlegroups.com
Please refer the attached image.
 
While the video color looks OK when rendered on other browsers, it gets patchy and the color is weird in Chrome.
 
Below is an excerpt of the code on how I render it
 

 

FB::PluginWindowlessWin* pWin = (FB::PluginWindowlessWin*)pScrnInfo;

HDC hDC = pWin->getHDC()

...

BITMAPINFO bm;

bm.bmiHeader.biSize =

sizeof (BITMAPINFOHEADER);

bm.bmiHeader.biPlanes = 1;

bm.bmiHeader.biBitCount = 24;

bm.bmiHeader.biSizeImage = 3 * iSrcCX * iSrcCY;

bm.bmiHeader.biWidth = iSrcCX;

bm.bmiHeader.biHeight = iSrcCY;

bm.bmiHeader.biCompression = BI_RGB;

SetStretchBltMode(hDC, HALFTONE);

...

StretchDIBits(hDC, iDrawX, iDrawY, iDrawCX, iDrawCY, 0,0, iSrcCX, iSrcCY, pData, &bm, DIB_RGB_COLORS,SRCCOPY);

 

Has anyone encountered this and able to solve it?

 

Thanks

John

ChromeColorWrong.PNG

Neil Griffiths

unread,
May 29, 2013, 12:09:32 AM5/29/13
to firebre...@googlegroups.com
I haven't - but my guess is it's that you're drawing 24 bits to something that perhaps has an alpha channel in Chrome?

Just a guess (and I'd imagine you've already tried that already) - but figure it's worth suggesting.


--
 
---
You received this message because you are subscribed to the Google Groups "firebreath-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebreath-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Richard Bateman

unread,
May 29, 2013, 10:27:51 AM5/29/13
to firebre...@googlegroups.com

This looks pretty much exactly like the issue I had; the "fix" was to put it in a div with a black background.

Richard

--
 
---
You received this message because you are subscribed to the Google Groups "firebreath-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebreath-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
<ChromeColorWrong.PNG>

John Tan

unread,
May 29, 2013, 11:43:21 AM5/29/13
to firebre...@googlegroups.com
Thanks Neil for the input...

Richard, could you be a little more specific on what you mean by adding a div? Thanks....

Richard Bateman

unread,
May 29, 2013, 11:52:03 AM5/29/13
to firebre...@googlegroups.com

<div style="background-color: black;">
<object …..></object>
</div>

On May 29, 2013, at 9:43 , John Tan <tjk...@gmail.com> wrote:

> Thanks Neil for the input...
>
> Richard, could you be a little more specific on what you mean by adding a div? Thanks....
>

John Tan

unread,
May 29, 2013, 12:00:27 PM5/29/13
to firebre...@googlegroups.com
Ah I see... Which reminds me I probably didn't encounter this in MediaElement.is as I modded it to load my player . ME.js has a black backgrounds. Was wondering how did I not see such problem to date. Thanks Richard...

Neil Griffiths

unread,
May 29, 2013, 1:04:52 PM5/29/13
to firebre...@googlegroups.com
So given the "fix" is to change the background colour, it appears that the problem really IS to do with the alpha channel. What happens if you render 32-bits instead of just 24?


On Wed, May 29, 2013 at 11:00 AM, John Tan <tjk...@gmail.com> wrote:
Ah I see... Which reminds me I probably didn't encounter this in MediaElement.is as I modded it to load my player . ME.js has a black backgrounds. Was wondering how did I not see such problem to date.  Thanks Richard...

John Tan

unread,
May 29, 2013, 9:15:46 PM5/29/13
to firebre...@googlegroups.com
Yup, the black background did solve the problem. However, I'm gonna try what Neil is suggesting so as to make it more independent.

Richard Bateman

unread,
May 29, 2013, 9:33:55 PM5/29/13
to firebre...@googlegroups.com
Let me know if you get it working; I could not and had to use the workaround. 

Richard

Sent from my iPhone

On May 29, 2013, at 19:15, John Tan <tjk...@gmail.com> wrote:

Yup, the black background did solve the problem. However, I'm gonna try what Neil is suggesting so as to make it more independent.

--

John Tan

unread,
May 30, 2013, 1:24:30 AM5/30/13
to firebre...@googlegroups.com
Sure! However, it's gonna take some time as I need some time to digest the YUV to RGB method used in my code.
 

Tom Helfand

unread,
Jul 17, 2013, 11:52:33 PM7/17/13
to firebre...@googlegroups.com
This looks similar to what I encountered in Chrome (27) experimenting with a windowless plugin. NpapiPlugin::init() sets the value of NPPVpluginTransparentBool to true. I don't pretend to understand what Chrome is doing, but it appears to be alpha-blending the plugin with whatever is z-order behind the plugin in some cases when that value is set. My issue was resolved by changing that value to false. As a bonus, CPU consumption dropped noticeably.

This link is an interesting read explaining the machinations involved with rendering out-of-process transparent plugins: http://www.chromium.org/developers/design-documents/plugin-architecture

-Tom

John Tan

unread,
Jul 18, 2013, 12:22:51 AM7/18/13
to firebre...@googlegroups.com
Thanks Tom! I have just tried it and it works!
 
Originally, I intend to try out filling up the alpha channel values each time it is drawn but looks like there is no need for this now....

Richard Bateman

unread,
Jul 18, 2013, 12:25:19 AM7/18/13
to FireBreath Dev Group

Interesting. I'll have to try that with ours as well.

Richard

Reply all
Reply to author
Forward
0 new messages