diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/jpeg_load.c | 11 | ||||
-rw-r--r-- | apps/recorder/jpeg_load.h | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c index 9ab42b7a9f..5b287aff75 100644 --- a/apps/recorder/jpeg_load.c +++ b/apps/recorder/jpeg_load.c | |||
@@ -2228,4 +2228,15 @@ int read_jpeg_fd(int fd, | |||
2228 | } | 2228 | } |
2229 | #endif | 2229 | #endif |
2230 | 2230 | ||
2231 | const size_t JPEG_DECODE_OVERHEAD = | ||
2232 | /* Reserve an arbitrary amount for the decode buffer | ||
2233 | * FIXME: Somebody who knows what they're doing should look at this */ | ||
2234 | (32 * 1024) | ||
2235 | #ifndef JPEG_FROM_MEM | ||
2236 | /* Unless the struct jpeg is defined statically, we need to allocate | ||
2237 | * it in the bitmap buffer as well */ | ||
2238 | + sizeof(struct jpeg) | ||
2239 | #endif | ||
2240 | ; | ||
2241 | |||
2231 | /**************** end JPEG code ********************/ | 2242 | /**************** end JPEG code ********************/ |
diff --git a/apps/recorder/jpeg_load.h b/apps/recorder/jpeg_load.h index 6ff96dabad..129b0fbf19 100644 --- a/apps/recorder/jpeg_load.h +++ b/apps/recorder/jpeg_load.h | |||
@@ -32,6 +32,13 @@ | |||
32 | #ifndef _JPEG_LOAD_H | 32 | #ifndef _JPEG_LOAD_H |
33 | #define _JPEG_LOAD_H | 33 | #define _JPEG_LOAD_H |
34 | 34 | ||
35 | /* Approximate memory overhead required for JPEG decoding. This memory is | ||
36 | * taken from the bitmap buffer so you must ensure the buffer is big enough | ||
37 | * to contain all decoded pixel data plus decoder overhead, otherwise the | ||
38 | * image cannot be loaded. After the image is loaded this extra memory can | ||
39 | * be freed. */ | ||
40 | extern const size_t JPEG_DECODE_OVERHEAD; | ||
41 | |||
35 | int read_jpeg_file(const char* filename, | 42 | int read_jpeg_file(const char* filename, |
36 | struct bitmap *bm, | 43 | struct bitmap *bm, |
37 | int maxsize, | 44 | int maxsize, |