libjpegrecoverymap: fix dependencies
Fix dependencies.
Add unspecified transfer function enum
Test: build
Bug: b/252835416
Change-Id: Ib2f695eadebc4eb2b5e0fc0cd0bc744c032d91e8
diff --git a/libs/jpegrecoverymap/Android.bp b/libs/jpegrecoverymap/Android.bp
index 54af7c9..c9bed70 100644
--- a/libs/jpegrecoverymap/Android.bp
+++ b/libs/jpegrecoverymap/Android.bp
@@ -21,7 +21,7 @@
default_applicable_licenses: ["frameworks_native_license"],
}
-cc_library_static {
+cc_library {
name: "libjpegrecoverymap",
host_supported: true,
@@ -37,15 +37,18 @@
shared_libs: [
"libimage_io",
"libjpeg",
- "libutils",
+ "libjpegencoder",
+ "libjpegdecoder",
],
}
-cc_library_static {
+cc_library {
name: "libjpegencoder",
+ host_supported: true,
shared_libs: [
"libjpeg",
+ "liblog",
],
export_include_dirs: ["include"],
@@ -55,11 +58,13 @@
],
}
-cc_library_static {
+cc_library {
name: "libjpegdecoder",
+ host_supported: true,
shared_libs: [
"libjpeg",
+ "liblog",
],
export_include_dirs: ["include"],
diff --git a/libs/jpegrecoverymap/include/jpegrecoverymap/jpegrerrorcode.h b/libs/jpegrecoverymap/include/jpegrecoverymap/jpegrerrorcode.h
index 6995762..699c0d3 100644
--- a/libs/jpegrecoverymap/include/jpegrecoverymap/jpegrerrorcode.h
+++ b/libs/jpegrecoverymap/include/jpegrecoverymap/jpegrerrorcode.h
@@ -38,6 +38,7 @@
ERROR_JPEGR_RESOLUTION_MISMATCH = JPEGR_IO_ERROR_BASE - 3,
ERROR_JPEGR_BUFFER_TOO_SMALL = JPEGR_IO_ERROR_BASE - 4,
ERROR_JPEGR_INVALID_COLORGAMUT = JPEGR_IO_ERROR_BASE - 5,
+ ERROR_JPEGR_INVALID_TRANS_FUNC = JPEGR_IO_ERROR_BASE - 6,
JPEGR_RUNTIME_ERROR_BASE = -20000,
ERROR_JPEGR_ENCODE_ERROR = JPEGR_RUNTIME_ERROR_BASE - 1,
diff --git a/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h b/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h
index 3597903..ae15d24 100644
--- a/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h
+++ b/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h
@@ -30,6 +30,7 @@
// Transfer functions as defined for XMP metadata
typedef enum {
+ JPEGR_TF_UNSPECIFIED = -1,
JPEGR_TF_LINEAR = 0,
JPEGR_TF_HLG = 1,
JPEGR_TF_PQ = 2,
diff --git a/libs/jpegrecoverymap/jpegdecoder.cpp b/libs/jpegrecoverymap/jpegdecoder.cpp
index 0ae6a63..f67f5df 100644
--- a/libs/jpegrecoverymap/jpegdecoder.cpp
+++ b/libs/jpegrecoverymap/jpegdecoder.cpp
@@ -16,7 +16,7 @@
#include <jpegrecoverymap/jpegdecoder.h>
-#include <cutils/log.h>
+#include <utils/Log.h>
#include <errno.h>
#include <setjmp.h>
diff --git a/libs/jpegrecoverymap/jpegencoder.cpp b/libs/jpegrecoverymap/jpegencoder.cpp
index 1997bf9..627dcdf 100644
--- a/libs/jpegrecoverymap/jpegencoder.cpp
+++ b/libs/jpegrecoverymap/jpegencoder.cpp
@@ -16,7 +16,7 @@
#include <jpegrecoverymap/jpegencoder.h>
-#include <cutils/log.h>
+#include <utils/Log.h>
#include <errno.h>
diff --git a/libs/jpegrecoverymap/recoverymap.cpp b/libs/jpegrecoverymap/recoverymap.cpp
index ee68043..6b46d40 100644
--- a/libs/jpegrecoverymap/recoverymap.cpp
+++ b/libs/jpegrecoverymap/recoverymap.cpp
@@ -673,6 +673,9 @@
hdrInvOetf = pqInvOetf;
hdr_white_nits = kPqMaxNits;
break;
+ case JPEGR_TF_UNSPECIFIED:
+ // Should be impossible to hit after input validation.
+ return ERROR_JPEGR_INVALID_TRANS_FUNC;
}
ColorTransformFn hdrGamutConversionFn = getHdrConversionFn(
@@ -771,6 +774,9 @@
case JPEGR_TF_PQ:
hdrOetf = pqOetf;
break;
+ case JPEGR_TF_UNSPECIFIED:
+ // Should be impossible to hit after input validation.
+ return ERROR_JPEGR_INVALID_TRANS_FUNC;
}
for (size_t y = 0; y < height; ++y) {
diff --git a/libs/jpegrecoverymap/tests/Android.bp b/libs/jpegrecoverymap/tests/Android.bp
index b509478..39445f8 100644
--- a/libs/jpegrecoverymap/tests/Android.bp
+++ b/libs/jpegrecoverymap/tests/Android.bp
@@ -30,10 +30,10 @@
],
shared_libs: [
"libjpeg",
+ "libimage_io",
"liblog",
],
static_libs: [
- "libimage_io",
"libgmock",
"libgtest",
"libjpegdecoder",