| 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 int PhotoCapabilities::getMinIso() const { | 22 int PhotoCapabilities::getMinIso() const { |
| 23 DCHECK(!object_.is_null()); | 23 DCHECK(!object_.is_null()); |
| 24 return Java_PhotoCapabilities_getMinIso(AttachCurrentThread(), object_.obj()); | 24 return Java_PhotoCapabilities_getMinIso(AttachCurrentThread(), object_); |
| 25 } | 25 } |
| 26 | 26 |
| 27 int PhotoCapabilities::getMaxIso() const { | 27 int PhotoCapabilities::getMaxIso() const { |
| 28 DCHECK(!object_.is_null()); | 28 DCHECK(!object_.is_null()); |
| 29 return Java_PhotoCapabilities_getMaxIso(AttachCurrentThread(), object_.obj()); | 29 return Java_PhotoCapabilities_getMaxIso(AttachCurrentThread(), object_); |
| 30 } | 30 } |
| 31 | 31 |
| 32 int PhotoCapabilities::getCurrentIso() const { | 32 int PhotoCapabilities::getCurrentIso() const { |
| 33 DCHECK(!object_.is_null()); | 33 DCHECK(!object_.is_null()); |
| 34 return Java_PhotoCapabilities_getCurrentIso(AttachCurrentThread(), | 34 return Java_PhotoCapabilities_getCurrentIso(AttachCurrentThread(), object_); |
| 35 object_.obj()); | |
| 36 } | 35 } |
| 37 | 36 |
| 38 int PhotoCapabilities::getMinHeight() const { | 37 int PhotoCapabilities::getMinHeight() const { |
| 39 DCHECK(!object_.is_null()); | 38 DCHECK(!object_.is_null()); |
| 40 return Java_PhotoCapabilities_getMinHeight(AttachCurrentThread(), | 39 return Java_PhotoCapabilities_getMinHeight(AttachCurrentThread(), object_); |
| 41 object_.obj()); | |
| 42 } | 40 } |
| 43 | 41 |
| 44 int PhotoCapabilities::getMaxHeight() const { | 42 int PhotoCapabilities::getMaxHeight() const { |
| 45 DCHECK(!object_.is_null()); | 43 DCHECK(!object_.is_null()); |
| 46 return Java_PhotoCapabilities_getMaxHeight(AttachCurrentThread(), | 44 return Java_PhotoCapabilities_getMaxHeight(AttachCurrentThread(), object_); |
| 47 object_.obj()); | |
| 48 } | 45 } |
| 49 | 46 |
| 50 int PhotoCapabilities::getCurrentHeight() const { | 47 int PhotoCapabilities::getCurrentHeight() const { |
| 51 DCHECK(!object_.is_null()); | 48 DCHECK(!object_.is_null()); |
| 52 return Java_PhotoCapabilities_getCurrentHeight(AttachCurrentThread(), | 49 return Java_PhotoCapabilities_getCurrentHeight(AttachCurrentThread(), |
| 53 object_.obj()); | 50 object_); |
| 54 } | 51 } |
| 55 | 52 |
| 56 int PhotoCapabilities::getMinWidth() const { | 53 int PhotoCapabilities::getMinWidth() const { |
| 57 DCHECK(!object_.is_null()); | 54 DCHECK(!object_.is_null()); |
| 58 return Java_PhotoCapabilities_getMinWidth(AttachCurrentThread(), | 55 return Java_PhotoCapabilities_getMinWidth(AttachCurrentThread(), object_); |
| 59 object_.obj()); | |
| 60 } | 56 } |
| 61 | 57 |
| 62 int PhotoCapabilities::getMaxWidth() const { | 58 int PhotoCapabilities::getMaxWidth() const { |
| 63 DCHECK(!object_.is_null()); | 59 DCHECK(!object_.is_null()); |
| 64 return Java_PhotoCapabilities_getMaxWidth(AttachCurrentThread(), | 60 return Java_PhotoCapabilities_getMaxWidth(AttachCurrentThread(), object_); |
| 65 object_.obj()); | |
| 66 } | 61 } |
| 67 | 62 |
| 68 int PhotoCapabilities::getCurrentWidth() const { | 63 int PhotoCapabilities::getCurrentWidth() const { |
| 69 DCHECK(!object_.is_null()); | 64 DCHECK(!object_.is_null()); |
| 70 return Java_PhotoCapabilities_getCurrentWidth(AttachCurrentThread(), | 65 return Java_PhotoCapabilities_getCurrentWidth(AttachCurrentThread(), object_); |
| 71 object_.obj()); | |
| 72 } | 66 } |
| 73 | 67 |
| 74 int PhotoCapabilities::getMinZoom() const { | 68 int PhotoCapabilities::getMinZoom() const { |
| 75 DCHECK(!object_.is_null()); | 69 DCHECK(!object_.is_null()); |
| 76 return Java_PhotoCapabilities_getMinZoom(AttachCurrentThread(), | 70 return Java_PhotoCapabilities_getMinZoom(AttachCurrentThread(), object_); |
| 77 object_.obj()); | |
| 78 } | 71 } |
| 79 | 72 |
| 80 int PhotoCapabilities::getMaxZoom() const { | 73 int PhotoCapabilities::getMaxZoom() const { |
| 81 DCHECK(!object_.is_null()); | 74 DCHECK(!object_.is_null()); |
| 82 return Java_PhotoCapabilities_getMaxZoom(AttachCurrentThread(), | 75 return Java_PhotoCapabilities_getMaxZoom(AttachCurrentThread(), object_); |
| 83 object_.obj()); | |
| 84 } | 76 } |
| 85 | 77 |
| 86 int PhotoCapabilities::getCurrentZoom() const { | 78 int PhotoCapabilities::getCurrentZoom() const { |
| 87 DCHECK(!object_.is_null()); | 79 DCHECK(!object_.is_null()); |
| 88 return Java_PhotoCapabilities_getCurrentZoom(AttachCurrentThread(), | 80 return Java_PhotoCapabilities_getCurrentZoom(AttachCurrentThread(), object_); |
| 89 object_.obj()); | |
| 90 } | 81 } |
| 91 | 82 |
| 92 PhotoCapabilities::AndroidFocusMode PhotoCapabilities::getFocusMode() const { | 83 PhotoCapabilities::AndroidFocusMode PhotoCapabilities::getFocusMode() const { |
| 93 DCHECK(!object_.is_null()); | 84 DCHECK(!object_.is_null()); |
| 94 return static_cast<AndroidFocusMode>(Java_PhotoCapabilities_getFocusMode( | 85 return static_cast<AndroidFocusMode>( |
| 95 AttachCurrentThread(), object_.obj())); | 86 Java_PhotoCapabilities_getFocusMode(AttachCurrentThread(), object_)); |
| 96 } | 87 } |
| 97 | 88 |
| 98 } // namespace media | 89 } // namespace media |
| OLD | NEW |