1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/**
17 ************************************************************************
18 * @file   M4Common_Types.h
19 * @brief  defines common structures
20 * @note
21 *
22 ************************************************************************
23*/
24#ifndef M4COMMON_TYPES_H
25#define M4COMMON_TYPES_H
26
27#include "M4OSA_Types.h"
28#include "M4OSA_Memory.h"
29
30/**
31 ************************************************************************
32 * structure M4COMMON_MetadataType
33 ************************************************************************
34*/
35typedef enum
36{
37    M4COMMON_kUnknownMetaDataType,
38    /* Local files */
39    M4COMMON_kTagID3v1,                /**<  Metadata from TAG ID3 V1 */
40    M4COMMON_kTagID3v2,                /**<  Metadata from TAG ID3 V2 */
41    M4COMMON_kASFContentDesc,        /**<  Metadata from ASF content description  */
42
43    M4COMMON_k3GppAssetMovieBox,    /**<  Metadata from a 3gpp file (movie box) */
44    M4COMMON_k3GppAssetTrackBox,    /**<  Metadata from a 3gpp file (track box) */
45
46    /* Streaming */
47    M4COMMON_kMetaDataSdpSession,    /**<  Metadata from an SDP file (Session level) */
48    M4COMMON_kMetaDataSdpAudio,        /**<  Metadata from an SDP file (media audio level) */
49    M4COMMON_kMetaDataSdpVideo,        /**<  Metadata from an SDP file (media video level) */
50
51    M4COMMON_kJpegExif                /**< EXIF in JPEG */
52} M4COMMON_MetadataType;
53
54/**
55 ************************************************************************
56 * enumeration    M4VPS_EncodingFormat
57 * @brief        Text encoding format
58 ************************************************************************
59*/
60typedef enum
61{
62    M4COMMON_kEncFormatUnknown    = 0,      /**< Unknown format                                 */
63    M4COMMON_kEncFormatASCII    = 1,        /**< ISO-8859-1. Terminated with $00                */
64    M4COMMON_kEncFormatUTF8        = 2,     /**< UTF-8 encoded Unicode . Terminated with $00    */
65    M4COMMON_kEncFormatUTF16    = 3         /**< UTF-16 encoded Unicode. Terminated with $00 00 */
66}  M4COMMON_EncodingFormat;
67
68/**
69 ************************************************************************
70 * structure    M4VPS_String
71 * @brief        This structure defines string attribute
72 ************************************************************************
73*/
74typedef struct
75{
76    M4OSA_Void*            m_pString;                /**< Pointer to text        */
77    M4OSA_UInt32        m_uiSize;                /**< Text size in bytes        */
78    M4COMMON_EncodingFormat    m_EncodingFormat;    /**< Text encoding format    */
79
80} M4COMMON_String;
81
82/**
83 ************************************************************************
84 * structure    M4COMMON_Buffer
85 * @brief        This structure defines generic buffer attribute
86 ************************************************************************
87*/
88typedef struct
89{
90    M4OSA_MemAddr8         m_pBuffer;        /**< Pointer to buffer        */
91    M4OSA_UInt32        m_size;            /**< size of buffer in bytes    */
92} M4COMMON_Buffer;
93
94typedef enum
95{
96    M4COMMON_kMimeType_NONE,
97    M4COMMON_kMimeType_JPG,
98    M4COMMON_kMimeType_PNG,
99    M4COMMON_kMimeType_BMP,   /* bitmap, with header */
100    M4COMMON_kMimeType_RGB24, /* raw RGB 24 bits */
101    M4COMMON_kMimeType_RGB565, /* raw, RGB 16 bits */
102    M4COMMON_kMimeType_YUV420,
103    M4COMMON_kMimeType_MPEG4_IFrame /* RC: to support PV art */
104
105} M4COMMON_MimeType;
106
107/* picture type definition from id3v2 tag*/
108typedef enum
109{
110    M4COMMON_kPicType_Other                = 0x00,
111    M4COMMON_kPicType_32_32_Icon            = 0x01,
112    M4COMMON_kPicType_Other_Icon            = 0x02,
113    M4COMMON_kPicType_FrontCover            = 0x03,
114    M4COMMON_kPicType_BackCover            = 0x04,
115    M4COMMON_kPicType_LeafletPage            = 0x05,
116    M4COMMON_kPicType_Media                = 0x06,
117    M4COMMON_kPicType_LeadArtist            = 0x07,
118    M4COMMON_kPicType_Artist                = 0x08,
119    M4COMMON_kPicType_Conductor            = 0x09,
120    M4COMMON_kPicType_Orchestra            = 0x0A,
121    M4COMMON_kPicType_Composer            = 0x0B,
122    M4COMMON_kPicType_Lyricist            = 0x0C,
123    M4COMMON_kPicType_RecordingLocation    = 0x0D,
124    M4COMMON_kPicType_DuringRecording        = 0x0E,
125    M4COMMON_kPicType_DuringPerformance    = 0x0F,
126    M4COMMON_kPicType_MovieScreenCapture    = 0x10,
127    M4COMMON_kPicType_BrightColouredFish    = 0x11,
128    M4COMMON_kPicType_Illustration        = 0x12,
129    M4COMMON_kPicType_ArtistLogo            = 0x13,
130    M4COMMON_kPicType_StudioLogo            = 0x14
131} M4COMMON_PictureType;
132
133/**
134 ******************************************************************************
135 * enum        M4COMMON_Orientation
136 * @brief        This enum defines the possible orientation of a frame as described
137 *            in the EXIF standard.
138 ******************************************************************************
139*/
140typedef enum
141{
142    M4COMMON_kOrientationUnknown = 0,
143    M4COMMON_kOrientationTopLeft,
144    M4COMMON_kOrientationTopRight,
145    M4COMMON_kOrientationBottomRight,
146    M4COMMON_kOrientationBottomLeft,
147    M4COMMON_kOrientationLeftTop,
148    M4COMMON_kOrientationRightTop,
149    M4COMMON_kOrientationRightBottom,
150    M4COMMON_kOrientationLeftBottom
151}M4COMMON_Orientation ;
152
153/**
154 ******************************************************************************
155 * structure    M4EXIFC_Location
156 * @brief        The Image GPS location (example : 48°52.21' )
157 ******************************************************************************
158*/
159typedef struct
160{
161    M4OSA_Float    degrees;
162    M4OSA_Float    minsec;
163} M4COMMON_Location;
164
165/**
166 ************************************************************************
167 * structure    M4COMMON_MetaDataAlbumArt
168 * @brief        This structure defines fields of a album art
169 ************************************************************************
170*/
171typedef struct
172{
173    M4COMMON_MimeType    m_mimeType;
174    M4OSA_UInt32        m_uiSize;
175    M4OSA_Void*            m_pData;
176
177    M4COMMON_String        m_pDescription;
178
179} M4COMMON_MetaDataAlbumArt;
180
181/**
182 ************************************************************************
183 * structure    M4COMMON_MetaDataFields
184 * @brief        This structure defines fields of metadata information
185 ************************************************************************
186*/
187typedef struct
188{
189    M4COMMON_MetadataType    m_MetadataType;
190
191    /* Meta data fields */
192    M4COMMON_String    m_pTitle;            /**< Title for the media  */
193    M4COMMON_String    m_pArtist;            /**< Performer or artist */
194    M4COMMON_String    m_pAlbum;            /**< Album title for the media */
195    M4COMMON_String    m_pAuthor;            /**< Author of the media */
196    M4COMMON_String    m_pGenre;            /**< Genre (category and style) of the media */
197    M4COMMON_String    m_pDescription;        /**< Caption or description for the media */
198    M4COMMON_String    m_pCopyRights;        /**< Notice about organization holding copyright
199                                                     for the media file */
200    M4COMMON_String    m_pRecordingYear;    /**< Recording year for the media */
201    M4COMMON_String    m_pRating;            /**< Media rating */
202
203    M4COMMON_String    m_pClassification;    /**< Classification of the media */
204    M4COMMON_String    m_pKeyWords;        /**< Media keywords */
205    M4COMMON_String    m_pLocation;        /**< Location information */
206    M4COMMON_String    m_pUrl;                /**< Reference of the resource */
207
208    M4OSA_UInt8        m_uiTrackNumber;    /**< Track number for the media*/
209    M4OSA_UInt32    m_uiDuration;        /**< The track duration in milliseconds */
210
211    M4COMMON_MetaDataAlbumArt    m_albumArt;    /**< AlbumArt description */
212    M4COMMON_String                m_pMood;    /**< Mood of the media */
213
214    /**< Modifs ACO 4/12/07 : add Exif specific infos */
215    M4COMMON_String    m_pCreationDateTime;    /**< date and time original image was generated */
216    M4COMMON_String    m_pLastChangeDateTime;    /**< file change date and time */
217    M4COMMON_String    m_pManufacturer;        /**< manufacturer of image input equipment */
218    M4COMMON_String    m_pModel;                /**< model of image input equipment */
219    M4COMMON_String    m_pSoftware;            /**< software used */
220    M4COMMON_Orientation m_Orientation;        /**< Orientation of the picture */
221
222    /**< Modifs FS 29/08/08 : additionnal Exif infos */
223    M4OSA_UInt32    m_width;            /**< image width in pixels */
224    M4OSA_UInt32    m_height;            /**< image height in pixels */
225    M4OSA_UInt32    m_thumbnailSize;    /**< size of the thumbnail */
226    M4COMMON_String    m_pLatitudeRef;        /**< Latitude reference */
227    M4COMMON_Location m_latitude;        /**< Latitude */
228    M4COMMON_String    m_pLongitudeRef;    /**< Longitude reference */
229    M4COMMON_Location m_longitude;        /**< Longitude  */
230
231} M4COMMON_MetaDataFields;
232
233
234#endif /*M4COMMON_TYPES_H*/
235
236