| 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/usb_midi_device_android.h" | 5 #include "media/midi/usb_midi_device_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 8 #include "base/i18n/icu_string_conversions.h" | 10 #include "base/i18n/icu_string_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 10 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 11 #include "jni/UsbMidiDeviceAndroid_jni.h" | 13 #include "jni/UsbMidiDeviceAndroid_jni.h" |
| 12 #include "media/midi/usb_midi_descriptor_parser.h" | 14 #include "media/midi/usb_midi_descriptor_parser.h" |
| 13 | 15 |
| 14 namespace media { | 16 namespace media { |
| 15 namespace midi { | 17 namespace midi { |
| 16 | 18 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 std::string encoded(reinterpret_cast<char*>(&descriptor[0]) + 2, size - 2); | 138 std::string encoded(reinterpret_cast<char*>(&descriptor[0]) + 2, size - 2); |
| 137 std::string result; | 139 std::string result; |
| 138 // Unicode ECN specifies that the string is encoded in UTF-16LE. | 140 // Unicode ECN specifies that the string is encoded in UTF-16LE. |
| 139 if (!base::ConvertToUtf8AndNormalize(encoded, "utf-16le", &result)) | 141 if (!base::ConvertToUtf8AndNormalize(encoded, "utf-16le", &result)) |
| 140 return backup; | 142 return backup; |
| 141 return result; | 143 return result; |
| 142 } | 144 } |
| 143 | 145 |
| 144 } // namespace midi | 146 } // namespace midi |
| 145 } // namespace media | 147 } // namespace media |
| OLD | NEW |