| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/midi/midi_manager_alsa.h" | 5 #include "media/midi/midi_manager_alsa.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <poll.h> | 8 #include <poll.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 | 263 |
| 264 // Success! Now, initialize members from the temporaries. Do not | 264 // Success! Now, initialize members from the temporaries. Do not |
| 265 // initialize these earlier, since they need to be destroyed by the | 265 // initialize these earlier, since they need to be destroyed by the |
| 266 // thread that calls Finalize(), not the destructor thread (and we | 266 // thread that calls Finalize(), not the destructor thread (and we |
| 267 // check this in the destructor). | 267 // check this in the destructor). |
| 268 in_client_.reset(in_client.release()); | 268 in_client_.reset(in_client.release()); |
| 269 out_client_.reset(out_client.release()); | 269 out_client_.reset(out_client.release()); |
| 270 decoder_.reset(decoder.release()); | 270 decoder_.reset(decoder.release()); |
| 271 udev_.reset(udev.release()); | 271 udev_.reset(udev.release()); |
| 272 udev_monitor_.reset(udev_monitor_.release()); | 272 udev_monitor_.reset(udev_monitor.release()); |
| 273 | 273 |
| 274 // Generate hotplug events for existing ports. | 274 // Generate hotplug events for existing ports. |
| 275 // TODO(agoode): Check the return value for failure. | 275 // TODO(agoode): Check the return value for failure. |
| 276 EnumerateAlsaPorts(); | 276 EnumerateAlsaPorts(); |
| 277 | 277 |
| 278 // Generate hotplug events for existing udev devices. This must be done | 278 // Generate hotplug events for existing udev devices. This must be done |
| 279 // after udev_monitor_enable_receiving() is called. See the algorithm | 279 // after udev_monitor_enable_receiving() is called. See the algorithm |
| 280 // at http://www.signal11.us/oss/udev/. | 280 // at http://www.signal11.us/oss/udev/. |
| 281 EnumerateUdevCards(); | 281 EnumerateUdevCards(); |
| 282 | 282 |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 source_map_[AddrToInt(client_id, port_id)] = port_index; | 1394 source_map_[AddrToInt(client_id, port_id)] = port_index; |
| 1395 return true; | 1395 return true; |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 MidiManager* MidiManager::Create() { | 1398 MidiManager* MidiManager::Create() { |
| 1399 return new MidiManagerAlsa(); | 1399 return new MidiManagerAlsa(); |
| 1400 } | 1400 } |
| 1401 | 1401 |
| 1402 } // namespace midi | 1402 } // namespace midi |
| 1403 } // namespace media | 1403 } // namespace media |
| OLD | NEW |