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

Side by Side Diff: media/capture/video/video_capture_device_client.cc

Issue 2803023005: Switch base::Value typemapping to be by value instead of by unique_ptr.
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « media/base/video_frame_metadata.cc ('k') | mojo/common/common_custom_types_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/video_capture_device_client.h" 5 #include "media/capture/video/video_capture_device_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 metadata.SetDouble(media::VideoFrameMetadata::FRAME_RATE, format.frame_rate); 375 metadata.SetDouble(media::VideoFrameMetadata::FRAME_RATE, format.frame_rate);
376 metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, 376 metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME,
377 reference_time); 377 reference_time);
378 378
379 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New(); 379 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New();
380 info->timestamp = timestamp; 380 info->timestamp = timestamp;
381 info->pixel_format = format.pixel_format; 381 info->pixel_format = format.pixel_format;
382 info->storage_type = format.pixel_storage; 382 info->storage_type = format.pixel_storage;
383 info->coded_size = format.frame_size; 383 info->coded_size = format.frame_size;
384 info->visible_rect = visible_rect; 384 info->visible_rect = visible_rect;
385 info->metadata = metadata.CopyInternalValues(); 385 info->metadata = metadata.GetInternalValues();
386 386
387 buffer_pool_->HoldForConsumers(buffer.id, 1); 387 buffer_pool_->HoldForConsumers(buffer.id, 1);
388 receiver_->OnFrameReadyInBuffer( 388 receiver_->OnFrameReadyInBuffer(
389 buffer.id, buffer.frame_feedback_id, 389 buffer.id, buffer.frame_feedback_id,
390 base::MakeUnique<ScopedBufferPoolReservation<ConsumerReleaseTraits>>( 390 base::MakeUnique<ScopedBufferPoolReservation<ConsumerReleaseTraits>>(
391 buffer_pool_, buffer.id), 391 buffer_pool_, buffer.id),
392 std::move(info)); 392 std::move(info));
393 } 393 }
394 394
395 media::VideoCaptureDevice::Client::Buffer 395 media::VideoCaptureDevice::Client::Buffer
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 auto buffer_access = buffer.handle_provider->GetHandleForInProcessAccess(); 476 auto buffer_access = buffer.handle_provider->GetHandleForInProcessAccess();
477 memcpy(buffer_access->data(), data, length); 477 memcpy(buffer_access->data(), data, length);
478 const VideoCaptureFormat output_format = 478 const VideoCaptureFormat output_format =
479 VideoCaptureFormat(format.frame_size, format.frame_rate, 479 VideoCaptureFormat(format.frame_size, format.frame_rate,
480 media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_CPU); 480 media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_CPU);
481 OnIncomingCapturedBuffer(std::move(buffer), output_format, reference_time, 481 OnIncomingCapturedBuffer(std::move(buffer), output_format, reference_time,
482 timestamp); 482 timestamp);
483 } 483 }
484 484
485 } // namespace media 485 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame_metadata.cc ('k') | mojo/common/common_custom_types_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698