| 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 <jni.h> | 7 #include <jni.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void UsbMidiDeviceAndroid::OnData(JNIEnv* env, | 50 void UsbMidiDeviceAndroid::OnData(JNIEnv* env, |
| 51 jobject caller, | 51 jobject caller, |
| 52 jint endpoint_number, | 52 jint endpoint_number, |
| 53 jbyteArray data) { | 53 jbyteArray data) { |
| 54 std::vector<uint8> bytes; | 54 std::vector<uint8> bytes; |
| 55 base::android::JavaByteArrayToByteVector(env, data, &bytes); | 55 base::android::JavaByteArrayToByteVector(env, data, &bytes); |
| 56 | 56 |
| 57 const uint8* head = bytes.size() ? &bytes[0] : NULL; | 57 const uint8* head = bytes.size() ? &bytes[0] : NULL; |
| 58 delegate_->ReceiveUsbMidiData(this, endpoint_number, head, bytes.size(), | 58 delegate_->ReceiveUsbMidiData(this, endpoint_number, head, bytes.size(), |
| 59 base::TimeTicks::HighResNow()); | 59 base::TimeTicks::Now()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool UsbMidiDeviceAndroid::RegisterUsbMidiDevice(JNIEnv* env) { | 62 bool UsbMidiDeviceAndroid::RegisterUsbMidiDevice(JNIEnv* env) { |
| 63 return RegisterNativesImpl(env); | 63 return RegisterNativesImpl(env); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace media | 66 } // namespace media |
| OLD | NEW |