OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/capture/video/android/photo_capabilities.h" | 5 #include "media/capture/video/android/photo_capabilities.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "jni/PhotoCapabilities_jni.h" | 10 #include "jni/PhotoCapabilities_jni.h" |
11 | 11 |
12 using base::android::AttachCurrentThread; | 12 using base::android::AttachCurrentThread; |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 | 15 |
16 PhotoCapabilities::PhotoCapabilities( | 16 PhotoCapabilities::PhotoCapabilities( |
17 base::android::ScopedJavaLocalRef<jobject> object) | 17 base::android::ScopedJavaLocalRef<jobject> object) |
18 : object_(object) {} | 18 : object_(object) {} |
19 | 19 |
20 PhotoCapabilities::~PhotoCapabilities() {} | 20 PhotoCapabilities::~PhotoCapabilities() {} |
21 | 21 |
22 // static | 22 // static |
23 bool PhotoCapabilities::RegisterPhotoCapabilities(JNIEnv* env) { | 23 bool PhotoCapabilities::RegisterPhotoCapabilities(JNIEnv* env) { |
24 return RegisterNativesImpl(env); | 24 return RegisterNativesImpl(env); |
25 } | 25 } |
26 | 26 |
| 27 int PhotoCapabilities::getMinIso() const { |
| 28 DCHECK(!object_.is_null()); |
| 29 return Java_PhotoCapabilities_getMinIso(AttachCurrentThread(), object_.obj()); |
| 30 } |
| 31 |
| 32 int PhotoCapabilities::getMaxIso() const { |
| 33 DCHECK(!object_.is_null()); |
| 34 return Java_PhotoCapabilities_getMaxIso(AttachCurrentThread(), object_.obj()); |
| 35 } |
| 36 |
| 37 int PhotoCapabilities::getCurrentIso() const { |
| 38 DCHECK(!object_.is_null()); |
| 39 return Java_PhotoCapabilities_getCurrentIso(AttachCurrentThread(), |
| 40 object_.obj()); |
| 41 } |
| 42 |
| 43 int PhotoCapabilities::getMinHeight() const { |
| 44 DCHECK(!object_.is_null()); |
| 45 return Java_PhotoCapabilities_getMinHeight(AttachCurrentThread(), |
| 46 object_.obj()); |
| 47 } |
| 48 |
| 49 int PhotoCapabilities::getMaxHeight() const { |
| 50 DCHECK(!object_.is_null()); |
| 51 return Java_PhotoCapabilities_getMaxHeight(AttachCurrentThread(), |
| 52 object_.obj()); |
| 53 } |
| 54 |
| 55 int PhotoCapabilities::getCurrentHeight() const { |
| 56 DCHECK(!object_.is_null()); |
| 57 return Java_PhotoCapabilities_getCurrentHeight(AttachCurrentThread(), |
| 58 object_.obj()); |
| 59 } |
| 60 |
| 61 int PhotoCapabilities::getMinWidth() const { |
| 62 DCHECK(!object_.is_null()); |
| 63 return Java_PhotoCapabilities_getMinWidth(AttachCurrentThread(), |
| 64 object_.obj()); |
| 65 } |
| 66 |
| 67 int PhotoCapabilities::getMaxWidth() const { |
| 68 DCHECK(!object_.is_null()); |
| 69 return Java_PhotoCapabilities_getMaxWidth(AttachCurrentThread(), |
| 70 object_.obj()); |
| 71 } |
| 72 |
| 73 int PhotoCapabilities::getCurrentWidth() const { |
| 74 DCHECK(!object_.is_null()); |
| 75 return Java_PhotoCapabilities_getCurrentWidth(AttachCurrentThread(), |
| 76 object_.obj()); |
| 77 } |
| 78 |
27 int PhotoCapabilities::getMinZoom() const { | 79 int PhotoCapabilities::getMinZoom() const { |
28 DCHECK(!object_.is_null()); | 80 DCHECK(!object_.is_null()); |
29 return Java_PhotoCapabilities_getMinZoom(AttachCurrentThread(), | 81 return Java_PhotoCapabilities_getMinZoom(AttachCurrentThread(), |
30 object_.obj()); | 82 object_.obj()); |
31 } | 83 } |
32 | 84 |
33 int PhotoCapabilities::getMaxZoom() const { | 85 int PhotoCapabilities::getMaxZoom() const { |
34 DCHECK(!object_.is_null()); | 86 DCHECK(!object_.is_null()); |
35 return Java_PhotoCapabilities_getMaxZoom(AttachCurrentThread(), | 87 return Java_PhotoCapabilities_getMaxZoom(AttachCurrentThread(), |
36 object_.obj()); | 88 object_.obj()); |
37 } | 89 } |
38 | 90 |
39 int PhotoCapabilities::getCurrentZoom() const { | 91 int PhotoCapabilities::getCurrentZoom() const { |
40 DCHECK(!object_.is_null()); | 92 DCHECK(!object_.is_null()); |
41 return Java_PhotoCapabilities_getCurrentZoom(AttachCurrentThread(), | 93 return Java_PhotoCapabilities_getCurrentZoom(AttachCurrentThread(), |
42 object_.obj()); | 94 object_.obj()); |
43 } | 95 } |
44 | 96 |
45 bool PhotoCapabilities::getAutoFocusInUse() const { | 97 bool PhotoCapabilities::getAutoFocusInUse() const { |
46 DCHECK(!object_.is_null()); | 98 DCHECK(!object_.is_null()); |
47 return Java_PhotoCapabilities_getAutoFocusInUse(AttachCurrentThread(), | 99 return Java_PhotoCapabilities_getAutoFocusInUse(AttachCurrentThread(), |
48 object_.obj()); | 100 object_.obj()); |
49 } | 101 } |
50 | 102 |
51 } // namespace media | 103 } // namespace media |
OLD | NEW |