| Index: content/renderer/media/html_video_element_capturer_source.cc
|
| diff --git a/content/renderer/media/html_video_element_capturer_source.cc b/content/renderer/media/html_video_element_capturer_source.cc
|
| index 88108ee50e587c10a4fd89136333fa3f5d3e2ec1..3df3ea40422c33654f45cb561ab86f606c9ab699 100644
|
| --- a/content/renderer/media/html_video_element_capturer_source.cc
|
| +++ b/content/renderer/media/html_video_element_capturer_source.cc
|
| @@ -147,7 +147,7 @@ void HtmlVideoElementCapturerSource::sendNewFrame() {
|
| DCHECK(!bitmap.drawsNothing());
|
| DCHECK(bitmap.getPixels());
|
| if (bitmap.colorType() != kN32_SkColorType) {
|
| - DLOG(ERROR) << "Only supported capture format is ARGB";
|
| + DLOG(ERROR) << "Only supported color type is kN32_SkColorType (ARGB/ABGR)";
|
| return;
|
| }
|
|
|
| @@ -156,6 +156,10 @@ void HtmlVideoElementCapturerSource::sendNewFrame() {
|
| base::TimeTicks::Now() - base::TimeTicks());
|
| DCHECK(frame);
|
|
|
| + const uint32 source_pixel_format =
|
| + (kN32_SkColorType == kRGBA_8888_SkColorType) ? libyuv::FOURCC_ABGR
|
| + : libyuv::FOURCC_ARGB;
|
| +
|
| if (libyuv::ConvertToI420(static_cast<uint8*>(bitmap.getPixels()),
|
| bitmap.getSize(),
|
| frame->data(media::VideoFrame::kYPlane),
|
| @@ -171,7 +175,7 @@ void HtmlVideoElementCapturerSource::sendNewFrame() {
|
| frame->coded_size().width(),
|
| frame->coded_size().height(),
|
| libyuv::kRotate0,
|
| - libyuv::FOURCC_ARGB) == 0) {
|
| + source_pixel_format) == 0) {
|
| // Success!
|
| io_task_runner_->PostTask(
|
| FROM_HERE, base::Bind(new_frame_callback_, frame, current_time));
|
|
|