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

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

Issue 2735083002: [Mojo Video Capture] Add test coverage for accelerated jpeg decoding (Closed)
Patch Set: Rebase to March 15th, Remove #include jpeg_parser Created 3 years, 9 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/video_capture_device_client.cc
diff --git a/media/capture/video/video_capture_device_client.cc b/media/capture/video/video_capture_device_client.cc
index 729c02edc9ed76e7da9eb4f91f5074c86123f2f9..8d95f3da6f05cfdd3992be1dbeb2da8bcb5faba1 100644
--- a/media/capture/video/video_capture_device_client.cc
+++ b/media/capture/video/video_capture_device_client.cc
@@ -104,7 +104,11 @@ VideoCaptureDeviceClient::VideoCaptureDeviceClient(
jpeg_decoder_factory_callback_(jpeg_decoder_factory),
external_jpeg_decoder_initialized_(false),
buffer_pool_(std::move(buffer_pool)),
- last_captured_pixel_format_(media::PIXEL_FORMAT_UNKNOWN) {}
+ last_captured_pixel_format_(media::PIXEL_FORMAT_UNKNOWN) {
+ on_started_using_gpu_cb_ =
+ base::Bind(&VideoFrameReceiver::OnStartedUsingGpuDecode,
+ base::Unretained(receiver_.get()));
+}
VideoCaptureDeviceClient::~VideoCaptureDeviceClient() {
// This should be on the platform auxiliary thread since
@@ -281,6 +285,8 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData(
} else if (status == VideoCaptureJpegDecoder::INIT_PASSED &&
format.pixel_format == media::PIXEL_FORMAT_MJPEG &&
rotation == 0 && !flip) {
+ if (on_started_using_gpu_cb_)
+ std::move(on_started_using_gpu_cb_).Run();
external_jpeg_decoder_->DecodeCapturedData(
data, length, format, reference_time, timestamp, std::move(buffer));
return;
@@ -336,9 +342,8 @@ VideoCaptureDeviceClient::ReserveOutputBuffer(
if (!base::ContainsValue(buffer_ids_known_by_receiver_, buffer_id)) {
receiver_->OnNewBufferHandle(
- buffer_id,
- base::MakeUnique<BufferPoolBufferHandleProvider>(buffer_pool_,
- buffer_id));
+ buffer_id, base::MakeUnique<BufferPoolBufferHandleProvider>(
+ buffer_pool_, buffer_id));
buffer_ids_known_by_receiver_.push_back(buffer_id);
}
« no previous file with comments | « media/capture/video/video_capture_device_client.h ('k') | media/capture/video/video_capture_device_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698