This sets up API to release OutputSurface from LTHClient.
[chromium-blink-merge.git] / media / midi / midi_device_android.h
blob4b4882301c2d2f92fa8348c5ae71c16bf0cd28ca
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_MIDI_MIDI_DEVICE_ANDROID_H_
6 #define MEDIA_MIDI_MIDI_DEVICE_ANDROID_H_
8 #include <jni.h>
9 #include <string>
11 #include "base/android/scoped_java_ref.h"
12 #include "base/memory/scoped_vector.h"
13 #include "media/midi/midi_input_port_android.h"
15 namespace media {
16 namespace midi {
18 class MidiOutputPortAndroid;
20 class MidiDeviceAndroid final {
21 public:
22 MidiDeviceAndroid(JNIEnv* env,
23 jobject raw_device,
24 MidiInputPortAndroid::Delegate* delegate);
25 ~MidiDeviceAndroid();
27 std::string GetManufacturer();
28 std::string GetProductName();
29 std::string GetDeviceVersion();
31 const ScopedVector<MidiInputPortAndroid>& input_ports() const {
32 return input_ports_;
34 const ScopedVector<MidiOutputPortAndroid>& output_ports() const {
35 return output_ports_;
37 bool HasRawDevice(JNIEnv* env, jobject raw_device) const {
38 return env->IsSameObject(raw_device_.obj(), raw_device);
41 static bool Register(JNIEnv* env);
43 private:
44 base::android::ScopedJavaGlobalRef<jobject> raw_device_;
45 ScopedVector<MidiInputPortAndroid> input_ports_;
46 ScopedVector<MidiOutputPortAndroid> output_ports_;
49 } // namespace midi
50 } // namespace media
52 #endif // MEDIA_MIDI_MIDI_DEVICE_ANDROID_H_