From 4b1935cdecda5fd02955b4529daf828a4353e664 Mon Sep 17 00:00:00 2001
From: Ruben Brunk <rubenbrunk@google.com>
Date: Fri, 28 Jun 2013 20:02:54 -0700
Subject: [PATCH] Added jpeg streaming classes.

- Provides streaming operations for decompressing/compressing
  JPEG files.
- Allows pixel operations to be performed on large JPEG images
  without holding the entire bitmap in memory.

Change-Id: I597ddf282b59d2ba6d6bca4722208121e3728f94
---
 Android.mk                |  4 ++--
 jni_jpegstream/Android.mk | 41 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 jni_jpegstream/Android.mk

diff --git a/Android.mk b/Android.mk
index 2dd759f30..cf5b767bb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -37,9 +37,9 @@ LOCAL_SDK_VERSION := current
 # the libraries in the APK, otherwise just put them in /system/lib and
 # leave them out of the APK
 ifneq (,$(TARGET_BUILD_APPS))
-  LOCAL_JNI_SHARED_LIBRARIES := libjni_eglfence libjni_filtershow_filters librsjni
+  LOCAL_JNI_SHARED_LIBRARIES := libjni_eglfence libjni_filtershow_filters librsjni libjni_jpegstream
 else
-  LOCAL_REQUIRED_MODULES := libjni_eglfence libjni_filtershow_filters
+  LOCAL_REQUIRED_MODULES := libjni_eglfence libjni_filtershow_filters libjni_jpegstream
 endif
 
 LOCAL_PROGUARD_FLAG_FILES := proguard.flags
diff --git a/jni_jpegstream/Android.mk b/jni_jpegstream/Android.mk
new file mode 100644
index 000000000..de11733f8
--- /dev/null
+++ b/jni_jpegstream/Android.mk
@@ -0,0 +1,41 @@
+LOCAL_PATH:= $(call my-dir)
+
+# Jpeg Streaming native
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE        := libjni_jpegstream
+
+LOCAL_NDK_STL_VARIANT := stlport_static
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH) \
+                    $(LOCAL_PATH)/src \
+                    external/jpeg
+
+LOCAL_SHARED_LIBRARIES := libjpeg
+ifeq (,$(TARGET_BUILD_APPS))
+   # platform build
+   LOCAL_SHARED_LIBRARIES := libcutils
+endif
+
+LOCAL_LDFLAGS        := -llog
+LOCAL_SDK_VERSION   := 9
+LOCAL_ARM_MODE := arm
+
+LOCAL_CFLAGS    += -ffast-math -O3 -funroll-loops
+LOCAL_CPPFLAGS += $(JNI_CFLAGS)
+
+
+LOCAL_CPP_EXTENSION := .cpp
+LOCAL_SRC_FILES     := \
+    src/inputstream_wrapper.cpp \
+    src/jpegstream.cpp \
+    src/jerr_hook.cpp \
+    src/jpeg_hook.cpp \
+    src/jpeg_writer.cpp \
+    src/jpeg_reader.cpp \
+    src/outputstream_wrapper.cpp \
+    src/stream_wrapper.cpp
+
+
+include $(BUILD_SHARED_LIBRARY)
-- 
GitLab