summaryrefslogtreecommitdiffstats
path: root/exynos3/s5pc110/libs3cjpeg/JpegEncoder.h
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2014-01-03 19:13:37 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2014-01-05 00:26:50 +0000
commit674a4f10cac0b36a7d2899e1568c23da9e5f82d2 (patch)
tree2c33e0f913b8f67783027eee0bfb684c524ee51c /exynos3/s5pc110/libs3cjpeg/JpegEncoder.h
parent2fccbdf3da79961370fdeb0e1ec01356c0bdf50e (diff)
downloadandroid_hardware_samsung-674a4f10cac0b36a7d2899e1568c23da9e5f82d2.tar.gz
android_hardware_samsung-674a4f10cac0b36a7d2899e1568c23da9e5f82d2.tar.bz2
android_hardware_samsung-674a4f10cac0b36a7d2899e1568c23da9e5f82d2.zip
exynos3: libs3cjpeg: read memory configuration from kernel
This improves the flexibility (not all devices have the same FFC resolution) and also allows optimization of memory usage. We currently allocate 4 MB to the hardware JPEG encoder, but only 1 MB is actually needed if it's only used for encoding VGA images. Note that the thumbnail encoding function of the kernel driver is not used. This patch is backward compatible with older kernels, but patching is recommended. Cherry-pick the following commits: http://review.cyanogenmod.org/56791 http://review.cyanogenmod.org/56792 Change-Id: I0e89b24e56b99e8e27f5a38d5c158b23021ed035
Diffstat (limited to 'exynos3/s5pc110/libs3cjpeg/JpegEncoder.h')
-rw-r--r--exynos3/s5pc110/libs3cjpeg/JpegEncoder.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/exynos3/s5pc110/libs3cjpeg/JpegEncoder.h b/exynos3/s5pc110/libs3cjpeg/JpegEncoder.h
index b95b1b1..a1302fd 100644
--- a/exynos3/s5pc110/libs3cjpeg/JpegEncoder.h
+++ b/exynos3/s5pc110/libs3cjpeg/JpegEncoder.h
@@ -28,6 +28,10 @@
#include "Exif.h"
namespace android {
+
+#define LEGACY_SUPPORT
+#ifdef LEGACY_SUPPORT
+
#define MAX_JPG_WIDTH 800
#define MAX_JPG_HEIGHT 480
#define MAX_JPG_RESOLUTION (MAX_JPG_WIDTH * MAX_JPG_HEIGHT)
@@ -66,6 +70,7 @@ namespace android {
#define IMG_MAIN_START (JPG_STREAM_BUF_SIZE + JPG_STREAM_THUMB_BUF_SIZE)
#define IMG_THUMB_START (IMG_MAIN_START + JPG_FRAME_BUF_SIZE)
/*******************************************************************************/
+#endif
#define JPG_DRIVER_NAME "/dev/s3c-jpg"
@@ -78,6 +83,7 @@ namespace android {
#define IOCTL_JPG_GET_THUMB_FRMBUF _IO(JPEG_IOCTL_MAGIC, 6)
#define IOCTL_JPG_GET_PHY_FRMBUF _IO(JPEG_IOCTL_MAGIC, 7)
#define IOCTL_JPG_GET_PHY_THUMB_FRMBUF _IO(JPEG_IOCTL_MAGIC, 8)
+#define IOCTL_JPG_GET_INFO _IO(JPEG_IOCTL_MAGIC, 9)
typedef enum {
JPEG_SET_ENCODE_WIDTH,
@@ -181,6 +187,18 @@ typedef struct {
jpg_enc_proc_param *thumb_enc_param;
} jpg_args;
+typedef struct {
+ unsigned int frame_buf_size;
+ unsigned int thumb_frame_buf_size;
+ unsigned int stream_buf_size;
+ unsigned int thumb_stream_buf_size;
+ unsigned int total_buf_size;
+ int max_width;
+ int max_height;
+ int max_thumb_width;
+ int max_thumb_height;
+} jpg_info;
+
class JpegEncoder {
public:
JpegEncoder();
@@ -232,6 +250,7 @@ private:
unsigned char *start);
int mDevFd;
jpg_args mArgs;
+ jpg_info mInfo;
bool available;