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

Unified Diff: media/capture/video/fake_video_capture_device.cc

Issue 2167313002: ImageCapture: introduce image_capture Blob to allow move-only semantics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: foolip comments and rebase 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
Index: media/capture/video/fake_video_capture_device.cc
diff --git a/media/capture/video/fake_video_capture_device.cc b/media/capture/video/fake_video_capture_device.cc
index 3292d75fcbe470096d8cf747e2accb2fa125a762..698588f3ecb13104696a0bb1afc4622178c482c9 100644
--- a/media/capture/video/fake_video_capture_device.cc
+++ b/media/capture/video/fake_video_capture_device.cc
@@ -101,14 +101,15 @@ void DoTakeFakePhoto(VideoCaptureDevice::TakePhotoCallback callback,
DrawPacman(true /* use_argb */, buffer.get(), elapsed_time, fake_capture_rate,
capture_format.frame_size, zoom);
- std::vector<uint8_t> encoded_data;
+ mojom::BlobPtr blob = mojom::Blob::New();
const bool result = gfx::PNGCodec::Encode(
buffer.get(), gfx::PNGCodec::FORMAT_RGBA, capture_format.frame_size,
capture_format.frame_size.width() * 4, true /* discard_transparency */,
- std::vector<gfx::PNGCodec::Comment>(), &encoded_data);
+ std::vector<gfx::PNGCodec::Comment>(), &blob->data);
DCHECK(result);
- callback.Run("image/png", encoded_data);
+ blob->mime_type = "image/png";
+ callback.Run(std::move(blob));
}
FakeVideoCaptureDevice::FakeVideoCaptureDevice(BufferOwnership buffer_ownership,
« no previous file with comments | « media/capture/video/android/video_capture_device_android.cc ('k') | media/capture/video/fake_video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698