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

Unified Diff: media/midi/midi_manager_alsa.h

Issue 968663004: Improve MidiManagerAlsa manufacturer reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@udev
Patch Set: Undo incorrect use of MEDIA_IMPLEMENTATION Created 5 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
Index: media/midi/midi_manager_alsa.h
diff --git a/media/midi/midi_manager_alsa.h b/media/midi/midi_manager_alsa.h
index cbe03c5fee776a69e1ec715e40a71a7edd936c1e..02fb6ff5c3fcbaef5bd32fcb17e15039a135f606 100644
--- a/media/midi/midi_manager_alsa.h
+++ b/media/midi/midi_manager_alsa.h
@@ -15,9 +15,28 @@
#include "base/threading/thread.h"
#include "media/midi/midi_manager.h"
+#if defined(USE_UDEV)
Ryan Sleevi 2015/03/04 19:46:56 Yes, this is fine because it's forced into the ent
+#include "device/udev_linux/scoped_udev.h"
+#endif // defined(USE_UDEV)
+
namespace media {
-class MidiManagerAlsa : public MidiManager {
+namespace internal {
+
+// Decodes just \xXX in strings.
+MEDIA_EXPORT_PRIVATE std::string UnescapeUdev(const std::string& s);
Takashi Toyoshima 2015/03/04 09:33:37 Do you have any reason to place these two function
wolenetz 2015/03/04 19:28:58 +1. I'm not fully conversant with the pros/cons he
Adam Goode 2015/03/04 19:59:18 Done.
+
+// Extracts the manufacturer using heuristics and a variety of sources.
+MEDIA_EXPORT_PRIVATE std::string ExtractManufacturer(
+ const std::string& udev_id_vendor_enc,
+ const std::string& udev_id_vendor_id,
+ const std::string& udev_id_vendor_from_database,
+ const std::string& alsa_name,
+ const std::string& alsa_longname);
+
+} // namespace internal
+
+class MEDIA_EXPORT MidiManagerAlsa : public MidiManager {
public:
MidiManagerAlsa();
~MidiManagerAlsa() override;
@@ -55,6 +74,11 @@ class MidiManagerAlsa : public MidiManager {
typedef std::vector<snd_midi_event_t*> EncoderList;
EncoderList encoders_;
+ // udev, for querying hardware devices.
+#if defined(USE_UDEV)
+ device::ScopedUdevPtr udev_;
+#endif // defined(USE_UDEV)
+
base::Thread send_thread_;
base::Thread event_thread_;
« media/media.gyp ('K') | « media/media.gyp ('k') | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698