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

Issue 1899403002: MediaStream Image Capture (2): Platform::ImageCaptureFrameGrabber and grabFrame() (Closed)

Created:
4 years, 8 months ago by mcasas
Modified:
4 years, 7 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, feature-media-reviews_chromium.org, jam, kinuko+watch, mcasas+watch+vc_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MediaStream Image Capture (2): Platform::ImageCaptureFrameGrabber and grabFrame() This CL adds support in Blink and content/ for capturing VideoFrames via ImageCapture.grabFrame() method. For that, it adds a web/WebImageCaptureFrameGrabber interface implemented in a new content class ImageCaptureFrameGrabber. In order to pass ImageBitmaps in WebCallbacks, ImageBitmap gets a method take(). It also splits the current LayoutTests into extended -creation.html and -grabFrame.html. BUG=518807 TEST= run demo html in https://cdn.rawgit.com/Miguelao/demos/master/imagecapture.html with flag --enable-blink-features=ImageCapture (click on "Open Camera 320x240", then on "Create Image Capturer" and finally, repeatedly, on "grabFrame"). Committed: https://crrev.com/d13e5bd95c4a6799f68d53c3e923ae2cd972da4f Cr-Commit-Position: refs/heads/master@{#390321}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : reillyg@ comments and made SkBitmap immutable #

Total comments: 6

Patch Set 3 : emircan@ comments and using SkImage (ref counted) instead of SkBitmap (moveable-non-copyable) throu… #

Total comments: 6

Patch Set 4 : junov@ comments and beefed up ImageCapture-grabFrame.html #

Patch Set 5 : Rebase. LayoutTests: Replace assert_array_equals with an for-each: assert_aprox_equals #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+341 lines, -88 lines) Patch
M content/content_renderer.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/media/image_capture_frame_grabber.h View 1 2 1 chunk +58 lines, -0 lines 0 comments Download
A content/renderer/media/image_capture_frame_grabber.cc View 1 2 1 chunk +121 lines, -0 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 3 chunks +13 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-creation.html View 2 chunks +30 lines, -25 lines 1 comment Download
M third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-creationAndGrabFrame.html View 1 chunk +0 lines, -59 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html View 1 2 3 4 1 chunk +46 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/imagecapture/ImageCapture.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp View 1 2 2 chunks +19 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/Platform.h View 1 2 3 4 3 chunks +8 lines, -3 lines 0 comments Download
A third_party/WebKit/public/platform/WebImageCaptureFrameGrabber.h View 1 2 1 chunk +30 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (24 generated)
mcasas
reillyg@ PTAL at WebKit parts and in particular to the usage of the CallbackPromiseAdapter and ...
4 years, 8 months ago (2016-04-23 00:48:12 UTC) #13
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1899403002/diff/180001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1899403002/diff/180001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode409 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:409: adoptRef(SkImage::NewFromBitmap(*bitmap.leakPtr()))); I think you just want SkImage::NewFromBitmap(*bitmap). It seems ...
4 years, 7 months ago (2016-04-25 22:37:33 UTC) #16
emircan
lgtm % nits. https://codereview.chromium.org/1899403002/diff/220001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html File third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html (right): https://codereview.chromium.org/1899403002/diff/220001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html#newcode22 third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html:22: assert_equals(document.getElementById('canvas0').height, bitmap.height); You can additionally draw ...
4 years, 7 months ago (2016-04-26 19:19:32 UTC) #18
Reilly Grant (use Gerrit)
CallbackPromiseAdapter usage lgtm.
4 years, 7 months ago (2016-04-26 19:28:43 UTC) #19
mcasas
https://codereview.chromium.org/1899403002/diff/180001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1899403002/diff/180001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode409 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:409: adoptRef(SkImage::NewFromBitmap(*bitmap.leakPtr()))); On 2016/04/25 22:37:33, Reilly Grant wrote: > I ...
4 years, 7 months ago (2016-04-27 00:51:29 UTC) #21
mcasas
junov@ PTAL at image_capture_frame_grabber.* where a VideoFrame is converted to a sk_sp<SkImage> that is subsequently ...
4 years, 7 months ago (2016-04-27 00:53:25 UTC) #23
Justin Novosad
https://codereview.chromium.org/1899403002/diff/260001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html File third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html (right): https://codereview.chromium.org/1899403002/diff/260001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html#newcode13 third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html:13: // We need to paint something on the canvas ...
4 years, 7 months ago (2016-04-27 15:03:18 UTC) #24
mcasas
junov@ PTAL https://codereview.chromium.org/1899403002/diff/260001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html File third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html (right): https://codereview.chromium.org/1899403002/diff/260001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html#newcode13 third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html:13: // We need to paint something on ...
4 years, 7 months ago (2016-04-27 17:48:18 UTC) #25
Justin Novosad
On 2016/04/27 17:48:18, mcasas wrote: > junov@ PTAL > > https://codereview.chromium.org/1899403002/diff/260001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html > File > third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html ...
4 years, 7 months ago (2016-04-27 20:58:02 UTC) #27
mcasas
On 2016/04/27 20:58:02, Justin Novosad wrote: > On 2016/04/27 17:48:18, mcasas wrote: > > junov@ ...
4 years, 7 months ago (2016-04-27 23:09:44 UTC) #28
mcasas
esprehn@: plz RS content/renderer/render_blink_platform_impl.* third_party/WebKit/public/platform/ haraken@ plz RS third_party/WebKit/Source/modules/imagecapture/*
4 years, 7 months ago (2016-04-27 23:13:26 UTC) #30
esprehn
lgtm, it's a bit sad this is adding more surface area to platform, I wish ...
4 years, 7 months ago (2016-04-28 01:57:36 UTC) #31
haraken
LGTM
4 years, 7 months ago (2016-04-28 06:28:33 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1899403002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1899403002/300001
4 years, 7 months ago (2016-04-28 06:34:26 UTC) #35
commit-bot: I haz the power
Committed patchset #5 (id:300001)
4 years, 7 months ago (2016-04-28 07:42:08 UTC) #37
Marijn Kruisselbrink
https://codereview.chromium.org/1899403002/diff/300001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-creation.html File third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-creation.html (right): https://codereview.chromium.org/1899403002/diff/300001/third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-creation.html#newcode10 third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-creation.html:10: var testVideo = promise_test(function() { Both these tests make ...
4 years, 7 months ago (2016-04-28 19:05:21 UTC) #39
commit-bot: I haz the power
4 years, 7 months ago (2016-04-30 17:16:49 UTC) #40
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d13e5bd95c4a6799f68d53c3e923ae2cd972da4f
Cr-Commit-Position: refs/heads/master@{#390321}

Powered by Google App Engine
This is Rietveld 408576698