You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've done some tests while I was looking for the FrameSubscription API and in all my examples, the frame always turned out to be BGRA not ARGB. I might be doing something wrong since the function that converts from YUV to RGB states that the data will be ARGB 32, but even when I put the raw frame data to a canvas, I need to change the order of the bytes in the buffer to get the right colors.
That function is quite old and not used by Chromium for some time, so it is possible that the underlying data of the frame has changed while that function stayed untouched. Maybe we can just change the docs to say it is returning BGRA?
Activity
zcbenz commentedon Sep 28, 2015
That function is quite old and not used by Chromium for some time, so it is possible that the underlying data of the frame has changed while that function stayed untouched. Maybe we can just change the docs to say it is returning BGRA?
brenca commentedon Sep 28, 2015
I've done some research - this might have to do something with machine endianness.
https://www.chromium.org/developers/design-documents/graphics-and-skia
https://en.wikipedia.org/wiki/RGBA_color_space
Even the code states it's BGRA only on little-endian machines: https://code.google.com/p/chromium/codesearch#chromium/src/media/base/yuv_convert.cc&l=15
We could state this in the documentation, I guess.
zcbenz commentedon Sep 28, 2015
The research is awesome! Can you create a pull request to document them?
brenca commentedon Sep 28, 2015
Sure thing!