|
12 | 12 | * * Neither the name of the copyright holder nor the
|
13 | 13 | * names of its contributors may be used to endorse or promote products
|
14 | 14 | * derived from this software without specific prior written permission.
|
15 |
| - * |
| 15 | + * |
16 | 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
17 | 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
30 | 30 |
|
31 | 31 | #include <stdint.h>
|
32 | 32 |
|
33 |
| -#define destroyImage(im) {free((im)->pData); (im)->pData = NULL;} |
| 33 | +#define destroyImage(im) \ |
| 34 | + { \ |
| 35 | + free((im)->pData); \ |
| 36 | + (im)->pData = NULL; \ |
| 37 | + } |
34 | 38 |
|
35 | 39 | /* Color spaces OMX-Components support */
|
36 | 40 | #define COLOR_SPACE_RGB24 0
|
37 | 41 | #define COLOR_SPACE_RGBA 1
|
38 | 42 | #define COLOR_SPACE_YUV420P 2
|
39 | 43 | #define COLOR_SPACE_RGB16 3
|
40 | 44 |
|
41 |
| -typedef struct IMAGE{ |
42 |
| - uint8_t* pData; /* Image pixel data */ |
43 |
| - size_t nData; /* Alloc data length */ |
44 |
| - |
45 |
| - unsigned int width; |
46 |
| - unsigned int height; |
47 |
| - unsigned char colorSpace; |
| 45 | +typedef struct IMAGE |
| 46 | +{ |
| 47 | + uint8_t* pData; /* Image pixel data */ |
| 48 | + size_t nData; /* Alloc data length */ |
| 49 | + |
| 50 | + unsigned int width; |
| 51 | + unsigned int height; |
| 52 | + unsigned char colorSpace; |
48 | 53 | } IMAGE;
|
49 | 54 |
|
50 |
| -typedef struct ANIM_IMAGE{ |
51 |
| - IMAGE *curFrame; |
52 |
| - IMAGE *frames; |
53 |
| - unsigned int decodeCount; |
54 |
| - unsigned int frameNum; |
55 |
| - |
56 |
| - uint8_t* imData; |
57 |
| - size_t size; |
58 |
| - |
59 |
| - void* pExtraData; |
60 |
| - int (*decodeNextFrame)(struct ANIM_IMAGE *); |
61 |
| - void (*finaliseDecoding)(struct ANIM_IMAGE *); |
62 |
| - |
63 |
| - unsigned int frameCount; |
64 |
| - unsigned int frameDelayCs; |
65 |
| - int loopCount; |
| 55 | +typedef struct ANIM_IMAGE |
| 56 | +{ |
| 57 | + IMAGE* curFrame; |
| 58 | + IMAGE* frames; |
| 59 | + unsigned int decodeCount; |
| 60 | + unsigned int frameNum; |
| 61 | + |
| 62 | + uint8_t* imData; |
| 63 | + size_t size; |
| 64 | + |
| 65 | + void* pExtraData; |
| 66 | + int (*decodeNextFrame)(struct ANIM_IMAGE*); |
| 67 | + void (*finaliseDecoding)(struct ANIM_IMAGE*); |
| 68 | + |
| 69 | + unsigned int frameCount; |
| 70 | + unsigned int frameDelayCs; |
| 71 | + int loopCount; |
66 | 72 |
|
67 | 73 | } ANIM_IMAGE;
|
68 | 74 |
|
|
0 commit comments