Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2177)

Unified Diff: content/renderer/media/html_video_element_capturer_source.cc

Issue 2150453003: ImageCapture.grabFrame()/<video>.captureStream(), use ABGR pixel format for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/media/image_capture_frame_grabber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..50b82bdc0ccd3fb16964f9d6e7b4a59a57203d1f 100644
--- a/content/renderer/media/html_video_element_capturer_source.cc
+++ b/content/renderer/media/html_video_element_capturer_source.cc
@@ -156,6 +156,13 @@ void HtmlVideoElementCapturerSource::sendNewFrame() {
base::TimeTicks::Now() - base::TimeTicks());
DCHECK(frame);
+#if defined(OS_ANDROID)
+ // See https://crbug.com/627983.
+ const uint32 source_pixel_format = libyuv::FOURCC_ABGR;
+#else
+ const uint32 source_pixel_format = libyuv::FOURCC_ARGB;
+#endif
+
if (libyuv::ConvertToI420(static_cast<uint8*>(bitmap.getPixels()),
bitmap.getSize(),
frame->data(media::VideoFrame::kYPlane),
@@ -171,7 +178,7 @@ void HtmlVideoElementCapturerSource::sendNewFrame() {
frame->coded_size().width(),
frame->coded_size().height(),
libyuv::kRotate0,
- libyuv::FOURCC_ARGB) == 0) {
+ source_pixel_format) == 0) {
emircan 2016/07/14 18:16:00 I think the underlying problem is that bitmap.colo
mcasas 2016/07/14 18:33:08 Great suggestion! Done.
// Success!
io_task_runner_->PostTask(
FROM_HERE, base::Bind(new_frame_callback_, frame, current_time));
« no previous file with comments | « no previous file | content/renderer/media/image_capture_frame_grabber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698