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

Side by Side Diff: content/browser/renderer_host/media/web_contents_video_capture_device.cc

Issue 22876027: Consolidate duplicated frame / capability structures in video_capture_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased: changed media::VideoCaptureCapability::kI420 -> media::PIXEL_FORMAT_I420 etc. Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Implementation notes: This needs to work on a variety of hardware 5 // Implementation notes: This needs to work on a variety of hardware
6 // configurations where the speed of the CPU and GPU greatly affect overall 6 // configurations where the speed of the CPU and GPU greatly affect overall
7 // performance. Spanning several threads, the process of capturing has been 7 // performance. Spanning several threads, the process of capturing has been
8 // split up into four conceptual stages: 8 // split up into four conceptual stages:
9 // 9 //
10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's 10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the consumer's
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 1069
1070 // Initialize capture settings which will be consistent for the 1070 // Initialize capture settings which will be consistent for the
1071 // duration of the capture. 1071 // duration of the capture.
1072 media::VideoCaptureCapability settings; 1072 media::VideoCaptureCapability settings;
1073 1073
1074 settings.width = width; 1074 settings.width = width;
1075 settings.height = height; 1075 settings.height = height;
1076 settings.frame_rate = frame_rate; 1076 settings.frame_rate = frame_rate;
1077 // Note: the value of |settings.color| doesn't matter if we use only the 1077 // Note: the value of |settings.color| doesn't matter if we use only the
1078 // VideoFrame based methods on |consumer|. 1078 // VideoFrame based methods on |consumer|.
1079 settings.color = media::VideoCaptureCapability::kI420; 1079 settings.color = media::PIXEL_FORMAT_I420;
1080 settings.expected_capture_delay = 0; 1080 settings.expected_capture_delay = 0;
1081 settings.interlaced = false; 1081 settings.interlaced = false;
1082 1082
1083 base::TimeDelta capture_period = base::TimeDelta::FromMicroseconds( 1083 base::TimeDelta capture_period = base::TimeDelta::FromMicroseconds(
1084 1000000.0 / settings.frame_rate + 0.5); 1084 1000000.0 / settings.frame_rate + 0.5);
1085 1085
1086 consumer_ = consumer; 1086 consumer_ = consumer;
1087 consumer_->OnFrameInfo(settings); 1087 consumer_->OnFrameInfo(settings);
1088 scoped_ptr<VideoCaptureOracle> oracle( 1088 scoped_ptr<VideoCaptureOracle> oracle(
1089 new VideoCaptureOracle(capture_period, 1089 new VideoCaptureOracle(capture_period,
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 void WebContentsVideoCaptureDevice::DeAllocate() { 1269 void WebContentsVideoCaptureDevice::DeAllocate() {
1270 impl_->DeAllocate(); 1270 impl_->DeAllocate();
1271 } 1271 }
1272 1272
1273 const media::VideoCaptureDevice::Name& 1273 const media::VideoCaptureDevice::Name&
1274 WebContentsVideoCaptureDevice::device_name() { 1274 WebContentsVideoCaptureDevice::device_name() {
1275 return device_name_; 1275 return device_name_;
1276 } 1276 }
1277 1277
1278 } // namespace content 1278 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698