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

Unified Diff: trunk/src/media/video/capture/win/video_capture_device_factory_win.cc

Issue 340353003: Revert 276590 "VideoCaptureDevice Win: Enumerate devices' suppor..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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: trunk/src/media/video/capture/win/video_capture_device_factory_win.cc
===================================================================
--- trunk/src/media/video/capture/win/video_capture_device_factory_win.cc (revision 278553)
+++ trunk/src/media/video/capture/win/video_capture_device_factory_win.cc (working copy)
@@ -123,8 +123,7 @@
continue;
}
- // Find the description or friendly name. TODO(mcasas): Investigate using
- // FriendlyName before Description, http://crbug.com/383395.
+ // Find the description or friendly name.
ScopedVariant name;
hr = prop_bag->Read(L"Description", name.Receive(), 0);
if (FAILED(hr))
@@ -224,9 +223,7 @@
device_id.Reset();
hr = prop_bag->Read(L"DevicePath", device_id.Receive(), 0);
if (FAILED(hr) || device_id.type() != VT_BSTR) {
- // If there is no clear DevicePath, try with Description and FriendlyName,
- // this might happen with non-USB cameras such as DeckLinks. TODO(mcasas):
- // use FriendlyName before Description, http://crbug.com/383395.
+ // If there is no clear DevicePath, try with Description and FriendlyName.
ScopedVariant name;
if (SUCCEEDED(prop_bag->Read(L"Description", name.Receive(), 0)) ||
SUCCEEDED(prop_bag->Read(L"FriendlyName", name.Receive(), 0))) {
@@ -300,9 +297,8 @@
h->bmiHeader.biHeight);
// Trust the frame rate from the VIDEOINFOHEADER.
format.frame_rate = (h->AvgTimePerFrame > 0) ?
- kSecondsToReferenceTime / static_cast<float>(h->AvgTimePerFrame) :
- 0.0;
-
+ static_cast<int>(kSecondsToReferenceTime / h->AvgTimePerFrame) :
+ 0;
formats->push_back(format);
DVLOG(1) << device.name() << " resolution: "
<< format.frame_size.ToString() << ", fps: " << format.frame_rate
@@ -349,8 +345,7 @@
DLOG(ERROR) << "MFGetAttributeSize: " << std::hex << hr;
return;
}
- capture_format.frame_rate = denominator ?
- numerator / static_cast<float>(denominator) : 0.0f;
+ capture_format.frame_rate = denominator ? numerator / denominator : 0;
GUID type_guid;
hr = type->GetGUID(MF_MT_SUBTYPE, &type_guid);
« 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