1 /* Copyright (c) 2012, The Linux Foundation. All rights reserved. 2 * 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions are 5 * met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above 9 * copyright notice, this list of conditions and the following 10 * disclaimer in the documentation and/or other materials provided 11 * with the distribution. 12 * * Neither the name of The Linux Foundation nor the names of its 13 * contributors may be used to endorse or promote products derived 14 * from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 */ 29 30 #ifndef OMX_JPEG_EXT_H_ 31 #define OMX_JPEG_EXT_H_ 32 33 #include <OMX_Image.h> 34 #include "QCamera_Intf.h" 35 #include "omx_jpeg_common.h" 36 37 typedef struct omx_jpeg_pmem_info { 38 int fd; 39 int offset; 40 } omx_jpeg_pmem_info; 41 42 typedef struct omx_jpeg_exif_info_tag { 43 exif_tag_id_t tag_id; 44 exif_tag_entry_t tag_entry; 45 46 } omx_jpeg_exif_info_tag; 47 48 typedef struct omx_jpeg_buffer_offset { 49 int width; 50 int height; 51 int yOffset; 52 int cbcrOffset; 53 int totalSize; 54 int paddedFrameSize; 55 } omx_jpeg_buffer_offset; 56 57 58 #define OMX_JPEG_PREFIX "omx.qcom.jpeg.exttype." 59 #define OMX_JPEG_PREFIX_LENGTH 22 60 61 /*adding to enum also add to the char name array down*/ 62 typedef enum { 63 OMX_JPEG_EXT_START = 0x7F000000, 64 OMX_JPEG_EXT_EXIF, 65 OMX_JPEG_EXT_THUMBNAIL, 66 OMX_JPEG_EXT_THUMBNAIL_QUALITY, 67 OMX_JPEG_EXT_BUFFER_OFFSET, 68 OMX_JPEG_EXT_ACBCR_OFFSET, 69 OMX_JPEG_EXT_USER_PREFERENCES, 70 OMX_JPEG_EXT_REGION, 71 OMX_JPEG_EXT_IMAGE_TYPE, 72 OMX_JPEG_EXT_END, 73 } omx_jpeg_ext_index; 74 75 extern char * omx_jpeg_ext_name[]; 76 /*char * omx_jpeg_ext_name[] = { 77 "start", 78 "exif", 79 "thumbnail", 80 "thumbnail_quality", 81 "buffer_offset", 82 "acbcr_offset", 83 "user_preferences", 84 "region", 85 "end" 86 };*/ 87 88 /*assume main img scaling*/ 89 90 typedef struct omx_jpeg_thumbnail { 91 int width; 92 int height; 93 int scaling; 94 int cropWidth; 95 int cropHeight; 96 int left; 97 int top; 98 } omx_jpeg_thumbnail; 99 100 typedef struct omx_jpeg_thumbnail_quality { 101 OMX_U32 nQFactor; 102 } omx_jpeg_thumbnail_quality; 103 104 typedef struct omx_jpeg_user_preferences { 105 omx_jpeg_color_format color_format; 106 omx_jpeg_color_format thumbnail_color_format; 107 omx_jpeg_preference preference; 108 } omx_jpeg_user_preferences; 109 110 typedef struct omx_jpeg_region{ 111 int32_t left; 112 int32_t top; 113 int32_t right; 114 int32_t bottom; 115 }omx_jpeg_region; 116 117 typedef struct omx_jpeg_type{ 118 omx_jpeg_image_type image_type; 119 }omx_jpeg_type; 120 121 #endif /* OMX_JPEG_EXT_H_ */ 122