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

Unified Diff: media/video/capture/linux/video_capture_device_linux.cc

Issue 13165005: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge, fixes Created 7 years, 7 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 | « gpu/tools/compositor_model_bench/compositor_model_bench.cc ('k') | net/base/directory_lister.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/linux/video_capture_device_linux.cc
diff --git a/media/video/capture/linux/video_capture_device_linux.cc b/media/video/capture/linux/video_capture_device_linux.cc
index cf53ce0d262c3c80a4f6485c7d23aab867f68e94..6c9047ee62a874896cca7124a1e53460b8e809bd 100644
--- a/media/video/capture/linux/video_capture_device_linux.cc
+++ b/media/video/capture/linux/video_capture_device_linux.cc
@@ -19,6 +19,7 @@
#include "base/bind.h"
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/stringprintf.h"
namespace media {
@@ -100,15 +101,14 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) {
device_names->clear();
base::FilePath path("/dev/");
- file_util::FileEnumerator enumerator(
- path, false, file_util::FileEnumerator::FILES, "video*");
+ base::FileEnumerator enumerator(
+ path, false, base::FileEnumerator::FILES, "video*");
while (!enumerator.Next().empty()) {
- file_util::FileEnumerator::FindInfo info;
- enumerator.GetFindInfo(&info);
+ base::FileEnumerator::FileInfo info = enumerator.GetInfo();
Name name;
- name.unique_id = path.value() + info.filename;
+ name.unique_id = path.value() + info.GetName().value();
if ((fd = open(name.unique_id.c_str() , O_RDONLY)) < 0) {
// Failed to open this device.
continue;
@@ -123,7 +123,7 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) {
name.device_name = base::StringPrintf("%s", cap.card);
device_names->push_back(name);
} else {
- DVLOG(1) << "No usable formats reported by " << info.filename;
+ DVLOG(1) << "No usable formats reported by " << info.GetName().value();
}
}
close(fd);
« no previous file with comments | « gpu/tools/compositor_model_bench/compositor_model_bench.cc ('k') | net/base/directory_lister.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698