diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2014-05-22 12:33:54 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2014-05-22 22:57:11 +0000 |
commit | b6079005ed0631c3972ff427f56e12523ec214a7 (patch) | |
tree | 0ed9977a4c689a07702302c72dc1622ce7ae835f | |
parent | 88aca033ff10d3298f06b4c950ef24ec091185b7 (diff) | |
download | frameworks_base-b6079005ed0631c3972ff427f56e12523ec214a7.zip frameworks_base-b6079005ed0631c3972ff427f56e12523ec214a7.tar.gz frameworks_base-b6079005ed0631c3972ff427f56e12523ec214a7.tar.bz2 |
camera2: Move DngCreator to hardware/camera2.
Bug: 15091253
Change-Id: Ibe2ee376436e5c796e33c0b782ea68278589f2e6
-rw-r--r-- | api/current.txt | 26 | ||||
-rw-r--r-- | core/java/android/hardware/camera2/DngCreator.java (renamed from media/java/android/media/DngCreator.java) | 8 | ||||
-rw-r--r-- | core/jni/Android.mk | 1 | ||||
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 2 | ||||
-rw-r--r-- | core/jni/android_hardware_camera2_DngCreator.cpp (renamed from media/jni/android_media_DngCreator.cpp) | 12 | ||||
-rw-r--r-- | media/jni/Android.mk | 3 | ||||
-rw-r--r-- | media/jni/android_media_MediaPlayer.cpp | 6 |
7 files changed, 27 insertions, 31 deletions
diff --git a/api/current.txt b/api/current.txt index a021d59..b399c82 100644 --- a/api/current.txt +++ b/api/current.txt @@ -12618,6 +12618,19 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MODE; } + public final class DngCreator implements java.lang.AutoCloseable { + ctor public DngCreator(android.hardware.camera2.CameraCharacteristics, android.hardware.camera2.CaptureResult); + method public void close(); + method public android.hardware.camera2.DngCreator setDescription(java.lang.String); + method public android.hardware.camera2.DngCreator setLocation(android.location.Location); + method public android.hardware.camera2.DngCreator setOrientation(int); + method public android.hardware.camera2.DngCreator setThumbnail(android.graphics.Bitmap); + method public android.hardware.camera2.DngCreator setThumbnail(android.media.Image); + method public void writeByteBuffer(java.io.OutputStream, android.util.Size, java.nio.ByteBuffer, long) throws java.io.IOException; + method public void writeImage(java.io.OutputStream, android.media.Image) throws java.io.IOException; + method public void writeInputStream(java.io.OutputStream, android.util.Size, java.io.InputStream, long) throws java.io.IOException; + } + } package android.hardware.camera2.params { @@ -14086,19 +14099,6 @@ package android.media { ctor public DeniedByServerException(java.lang.String); } - public final class DngCreator implements java.lang.AutoCloseable { - ctor public DngCreator(android.hardware.camera2.CameraCharacteristics, android.hardware.camera2.CaptureResult); - method public void close(); - method public android.media.DngCreator setDescription(java.lang.String); - method public android.media.DngCreator setLocation(android.location.Location); - method public android.media.DngCreator setOrientation(int); - method public android.media.DngCreator setThumbnail(android.graphics.Bitmap); - method public android.media.DngCreator setThumbnail(android.media.Image); - method public void writeByteBuffer(java.io.OutputStream, android.util.Size, java.nio.ByteBuffer, long) throws java.io.IOException; - method public void writeImage(java.io.OutputStream, android.media.Image) throws java.io.IOException; - method public void writeInputStream(java.io.OutputStream, android.util.Size, java.io.InputStream, long) throws java.io.IOException; - } - public class ExifInterface { ctor public ExifInterface(java.lang.String) throws java.io.IOException; method public double getAltitude(double); diff --git a/media/java/android/media/DngCreator.java b/core/java/android/hardware/camera2/DngCreator.java index 76c6d46..54568ed 100644 --- a/media/java/android/media/DngCreator.java +++ b/core/java/android/hardware/camera2/DngCreator.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package android.media; +package android.hardware.camera2; import android.graphics.Bitmap; import android.graphics.ImageFormat; -import android.hardware.camera2.CameraCharacteristics; -import android.hardware.camera2.CaptureResult; import android.hardware.camera2.impl.CameraMetadataNative; import android.location.Location; +import android.media.ExifInterface; +import android.media.Image; import android.util.Size; import java.io.IOException; @@ -266,6 +266,7 @@ public final class DngCreator implements AutoCloseable { * </p> * * @param dngOutput an {@link java.io.OutputStream} to write the DNG file to. + * @param size the {@link Size} of the image to write, in pixels. * @param pixels an {@link java.nio.ByteBuffer} of pixel data to write. * @param offset the offset of the raw image in bytes. This indicates how many bytes will * be skipped in the input before any pixel data is read. @@ -362,7 +363,6 @@ public final class DngCreator implements AutoCloseable { long offset) throws IOException; static { - System.loadLibrary("media_jni"); nativeClassInit(); } } diff --git a/core/jni/Android.mk b/core/jni/Android.mk index 835a648..a159715 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -138,6 +138,7 @@ LOCAL_SRC_FILES:= \ android_hardware_Camera.cpp \ android_hardware_camera2_CameraMetadata.cpp \ android_hardware_camera2_legacy_LegacyCameraDevice.cpp \ + android_hardware_camera2_DngCreator.cpp \ android_hardware_SensorManager.cpp \ android_hardware_SerialPort.cpp \ android_hardware_UsbDevice.cpp \ diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 2d350e0..0c7eefa 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -80,6 +80,7 @@ extern int register_android_opengl_jni_GLES31Ext(JNIEnv* env); extern int register_android_hardware_Camera(JNIEnv *env); extern int register_android_hardware_camera2_CameraMetadata(JNIEnv *env); extern int register_android_hardware_camera2_legacy_LegacyCameraDevice(JNIEnv *env); +extern int register_android_hardware_camera2_DngCreator(JNIEnv *env); extern int register_android_hardware_SensorManager(JNIEnv *env); extern int register_android_hardware_SerialPort(JNIEnv *env); extern int register_android_hardware_UsbDevice(JNIEnv *env); @@ -1286,6 +1287,7 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_hardware_Camera), REG_JNI(register_android_hardware_camera2_CameraMetadata), REG_JNI(register_android_hardware_camera2_legacy_LegacyCameraDevice), + REG_JNI(register_android_hardware_camera2_DngCreator), REG_JNI(register_android_hardware_SensorManager), REG_JNI(register_android_hardware_SerialPort), REG_JNI(register_android_hardware_UsbDevice), diff --git a/media/jni/android_media_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp index 860d896..7b686e7 100644 --- a/media/jni/android_media_DngCreator.cpp +++ b/core/jni/android_hardware_camera2_DngCreator.cpp @@ -54,7 +54,7 @@ using namespace img_utils; return; \ } -#define ANDROID_MEDIA_DNGCREATOR_CTX_JNI_ID "mNativeContext" +#define ANDROID_DNGCREATOR_CTX_JNI_ID "mNativeContext" static struct { jfieldID mNativeContext; @@ -163,9 +163,10 @@ static void DngCreator_nativeClassInit(JNIEnv* env, jclass clazz) { ALOGV("%s:", __FUNCTION__); gDngCreatorClassInfo.mNativeContext = env->GetFieldID(clazz, - ANDROID_MEDIA_DNGCREATOR_CTX_JNI_ID, "J"); + ANDROID_DNGCREATOR_CTX_JNI_ID, "J"); LOG_ALWAYS_FATAL_IF(gDngCreatorClassInfo.mNativeContext == NULL, - "can't find android/media/DngCreator.%s", ANDROID_MEDIA_DNGCREATOR_CTX_JNI_ID); + "can't find android/hardware/camera2/DngCreator.%s", + ANDROID_DNGCREATOR_CTX_JNI_ID); jclass outputStreamClazz = env->FindClass("java/io/OutputStream"); LOG_ALWAYS_FATAL_IF(outputStreamClazz == NULL, "Can't find java/io/OutputStream class"); @@ -766,7 +767,8 @@ static JNINativeMethod gDngCreatorMethods[] = { (void*) DngCreator_nativeWriteInputStream}, }; -int register_android_media_DngCreator(JNIEnv *env) { +int register_android_hardware_camera2_DngCreator(JNIEnv *env) { return AndroidRuntime::registerNativeMethods(env, - "android/media/DngCreator", gDngCreatorMethods, NELEM(gDngCreatorMethods)); + "android/hardware/camera2/DngCreator", gDngCreatorMethods, + NELEM(gDngCreatorMethods)); } diff --git a/media/jni/Android.mk b/media/jni/Android.mk index d658654..90fe695 100644 --- a/media/jni/Android.mk +++ b/media/jni/Android.mk @@ -2,7 +2,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - android_media_DngCreator.cpp \ android_media_ImageReader.cpp \ android_media_MediaCrypto.cpp \ android_media_MediaCodec.cpp \ @@ -42,7 +41,6 @@ LOCAL_SHARED_LIBRARIES := \ libjhead \ libexif \ libstagefright_amrnb_common \ - libimg_utils \ LOCAL_REQUIRED_MODULES := \ libjhead_jni @@ -55,7 +53,6 @@ LOCAL_C_INCLUDES += \ external/tremor/Tremor \ frameworks/base/core/jni \ frameworks/av/media/libmedia \ - frameworks/av/media/img_utils/include \ frameworks/av/media/libstagefright \ frameworks/av/media/libstagefright/codecs/amrnb/enc/src \ frameworks/av/media/libstagefright/codecs/amrnb/common \ diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp index 9d03cc3..6f42057 100644 --- a/media/jni/android_media_MediaPlayer.cpp +++ b/media/jni/android_media_MediaPlayer.cpp @@ -884,7 +884,6 @@ static int register_android_media_MediaPlayer(JNIEnv *env) "android/media/MediaPlayer", gMethods, NELEM(gMethods)); } -extern int register_android_media_DngCreator(JNIEnv *env); extern int register_android_media_ImageReader(JNIEnv *env); extern int register_android_media_Crypto(JNIEnv *env); extern int register_android_media_Drm(JNIEnv *env); @@ -914,11 +913,6 @@ jint JNI_OnLoad(JavaVM* vm, void* /* reserved */) } assert(env != NULL); - if (register_android_media_DngCreator(env) < 0) { - ALOGE("ERROR: ImageReader native registration failed"); - goto bail; - } - if (register_android_media_ImageReader(env) < 0) { ALOGE("ERROR: ImageReader native registration failed"); goto bail; |