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

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

Issue 2715713006: Fix for issue 696098 (potential video capture crash ChromeOS) (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b91042552e8fd31b13939ed4023eb2e146619a62..96f9d22792db1638bb0f4c951c674fff20e33ad4 100644
--- a/media/capture/video/video_capture_device_client.cc
+++ b/media/capture/video/video_capture_device_client.cc
@@ -333,6 +333,15 @@ VideoCaptureDeviceClient::ReserveOutputBuffer(
}
if (buffer_id == VideoCaptureBufferPool::kInvalidId)
return Buffer();
+
+ if (!base::ContainsValue(buffer_ids_known_by_receiver_, buffer_id)) {
+ receiver_->OnNewBufferHandle(
+ buffer_id,
+ base::MakeUnique<BufferPoolBufferHandleProvider>(buffer_pool_,
+ buffer_id));
+ buffer_ids_known_by_receiver_.push_back(buffer_id);
+ }
+
return MakeBufferStruct(buffer_pool_, buffer_id, frame_feedback_id);
}
@@ -356,11 +365,6 @@ void VideoCaptureDeviceClient::OnIncomingCapturedBufferExt(
const VideoFrameMetadata& additional_metadata) {
DFAKE_SCOPED_RECURSIVE_LOCK(call_from_producer_);
- if (!base::ContainsValue(buffer_ids_known_by_receiver_, buffer.id)) {
- receiver_->OnNewBufferHandle(buffer.id, std::move(buffer.handle_provider));
- buffer_ids_known_by_receiver_.push_back(buffer.id);
- }
-
VideoFrameMetadata metadata;
metadata.MergeMetadataFrom(&additional_metadata);
metadata.SetDouble(media::VideoFrameMetadata::FRAME_RATE, format.frame_rate);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698