Fix wrong colors in Hangouts on Mac when sharing applications

In DesktopCaptureDevice, get the ICC profile of the webrtc frame
to generate a gfx::ColorSpace. Then in VideoCaptureDeviceClient,
merge the primaries and transfer function into the yuv colorspace
thanks to gfx::ColorSpace::GetWithMatrixAndRange. Otherwise the
gamma color correction is lost and rendering has wrong colors
when attaching the captured stream of the desktop to a <video> tag.

Bug: 945468
Test: content_unittests --gtest_filter=*VideoCaptureControllerTest.*ColorSpace*
Change-Id: I67c5bb01d1addc2f0282ad67a86be859ce74d592
Commit-Queue: Julien Isorce <>
Reviewed-by: Yuri Wiitala <>
Reviewed-by: ccameron <>
Cr-Commit-Position: refs/heads/master@{#662069}
3 files changed