Disable webaudio support on Android ARM by turning off use_openmax_dl_fft.
[chromium-blink-merge.git] / base / android / jni_array.h
blobbb73ea0fa1cf11c04b3fca16beb823b7bf321408
1 // Copyright (c) 2012 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 BASE_ANDROID_JNI_ARRAY_H_
6 #define BASE_ANDROID_JNI_ARRAY_H_
8 #include <jni.h>
9 #include <string>
10 #include <vector>
12 #include "base/android/scoped_java_ref.h"
13 #include "base/basictypes.h"
14 #include "base/string16.h"
16 namespace base {
17 namespace android {
19 // Returns a new Java byte array converted from the given bytes array.
20 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(
21 JNIEnv* env, const uint8* bytes, size_t len);
23 // Returns a new Java long array converted from the given int64 array.
24 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(
25 JNIEnv* env, const int64* longs, size_t len);
27 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(
28 JNIEnv* env, const std::vector<int64>& longs);
30 // Returns a array of Java byte array converted from |v|.
31 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray(
32 JNIEnv* env, const std::vector<std::string>& v);
34 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings(
35 JNIEnv* env, const std::vector<std::string>& v);
37 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings(
38 JNIEnv* env, const std::vector<string16>& v);
40 // Converts a Java string array to a native array.
41 BASE_EXPORT void AppendJavaStringArrayToStringVector(
42 JNIEnv* env,
43 jobjectArray array,
44 std::vector<string16>* out);
46 BASE_EXPORT void AppendJavaStringArrayToStringVector(
47 JNIEnv* env,
48 jobjectArray array,
49 std::vector<std::string>* out);
51 // Appends the Java bytes in |bytes_array| onto the end of |out|.
52 BASE_EXPORT void AppendJavaByteArrayToByteVector(
53 JNIEnv* env,
54 jbyteArray byte_array,
55 std::vector<uint8>* out);
57 // Replaces the content of |out| with the Java bytes in |bytes_array|.
58 BASE_EXPORT void JavaByteArrayToByteVector(
59 JNIEnv* env,
60 jbyteArray byte_array,
61 std::vector<uint8>* out);
63 // Replaces the content of |out| with the Java ints in |int_array|.
64 BASE_EXPORT void JavaIntArrayToIntVector(
65 JNIEnv* env,
66 jintArray int_array,
67 std::vector<int>* out);
69 // Assuming |array| is an byte[][] (array of byte arrays), replaces the
70 // content of |out| with the corresponding vector of strings. No UTF-8
71 // conversion is performed.
72 BASE_EXPORT void JavaArrayOfByteArrayToStringVector(
73 JNIEnv* env,
74 jobjectArray array,
75 std::vector<std::string>* out);
77 } // namespace android
78 } // namespace base
80 #endif // BASE_ANDROID_JNI_ARRAY_H_