M4DA_Types.h revision b5c7784c96a606890eb8a8b560153ef4a5d1a0d9
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 M4DA_Types.h 19 * @brief Data access type definition 20 * @note This file implements media specific types 21 ************************************************************************ 22*/ 23 24#ifndef __M4DA_TYPES_H__ 25#define __M4DA_TYPES_H__ 26 27#include "NXPSW_CompilerSwitches.h" 28 29#include "M4OSA_Types.h" 30#include "M4OSA_Memory.h" 31 32#ifdef __cplusplus 33extern "C" { 34#endif /*__cplusplus*/ 35 36/** 37 ************************************************************************ 38 * enumeration M4_StreamType 39 * @brief Type used to describe a stream (audio or video data flow). 40 ************************************************************************ 41*/ 42typedef enum 43{ 44 M4DA_StreamTypeUnknown = -1, /**< Unknow type */ 45 M4DA_StreamTypeVideoMpeg4 = 0, /**< MPEG-4 video */ 46 M4DA_StreamTypeVideoH263 = 1, /**< H263 video */ 47 M4DA_StreamTypeAudioAmrNarrowBand = 2, /**< Amr narrow band audio */ 48 M4DA_StreamTypeAudioAmrWideBand = 3, /**< Amr wide band audio */ 49 M4DA_StreamTypeAudioAac = 4, /**< AAC audio */ 50 M4DA_StreamTypeAudioMp3 = 5, /**< MP3 audio */ 51 M4DA_StreamTypeVideoMJpeg = 6, /**< MJPEG video */ 52 M4DA_StreamTypeAudioPcm = 7, /**< Wav audio */ 53 M4DA_StreamTypeAudioMidi = 8, /**< Midi audio */ 54 M4DA_StreamTypeVideoMpeg4Avc = 9, /**< MPEG-4 AVC video (h264) */ 55 M4DA_StreamTypeAudioAacADTS = 10, /**< AAC ADTS audio */ 56 M4DA_StreamTypeAudioAacADIF = 11, /**< AAC ADIF audio */ 57 M4DA_StreamTypeAudioWma = 12, /**< WMA audio */ 58 M4DA_StreamTypeVideoWmv = 13, /**< WMV video */ 59 M4DA_StreamTypeAudioReal = 14, /**< REAL audio */ 60 M4DA_StreamTypeVideoReal = 15, /**< REAL video */ 61 M4DA_StreamTypeAudioEvrc = 16, /**< Evrc audio */ 62 M4DA_StreamTypeTimedText = 20, /**< Timed Text */ 63 M4DA_StreamTypeAudioBba = 21, /**< Beat Brew audio fomat */ 64 M4DA_StreamTypeAudioSmaf = 22, /**< SMAF audio */ 65 M4DA_StreamTypeAudioImelody = 23, /**< IMELODY audio*/ 66 M4DA_StreamTypeAudioXmf = 24, /**< XMF audio */ 67 M4DA_StreamTypeAudioBpc = 25, /**< BPC audio */ 68 69 /* ADPCM */ 70 M4DA_StreamTypeAudioADPcm = 26 /**< ADPCM */ 71 72} M4_StreamType; 73 74/** 75 ************************************************************************ 76 * structure M4_StreamHandler 77 * @brief Base structure to describe a stream. 78 ************************************************************************ 79*/ 80typedef struct 81{ 82 M4_StreamType m_streamType; /**< Stream type */ 83 M4OSA_UInt32 m_streamId; /**< Stream Id (unique number definning 84 the stream) */ 85 M4OSA_Int32 m_duration; /**< Duration of the stream in milli 86 seconds */ 87 M4OSA_UInt32 m_averageBitRate; /**< Average bitrate in kb/s */ 88 M4OSA_UInt32 m_maxAUSize; /**< Maximum size of an Access Unit */ 89 M4OSA_UInt8* m_pDecoderSpecificInfo; /**< Pointer on specific information required 90 to create a decoder */ 91 M4OSA_UInt32 m_decoderSpecificInfoSize; /**< Size of the specific information 92 pointer above */ 93 void* m_pUserData; /**< Pointer on User Data 94 (initialized by the user) */ 95 M4OSA_UInt32 m_structSize; /**< Size of the structure in bytes */ 96 M4OSA_Bool m_bStreamIsOK; /**< Flag to know if stream has no errors after 97 parsing is finished */ 98 M4OSA_UInt8* m_pH264DecoderSpecificInfo; /**< Pointer on specific information 99 required to create a decoder */ 100 M4OSA_UInt32 m_H264decoderSpecificInfoSize; /**< Size of the specific 101 information pointer above */ 102 // MPEG4 & AAC decoders require ESDS info 103 M4OSA_UInt8* m_pESDSInfo; /**< Pointer on MPEG4 or AAC ESDS box */ 104 M4OSA_UInt32 m_ESDSInfoSize; /**< Size of the MPEG4 or AAC ESDS box */ 105} M4_StreamHandler; 106 107/** 108 ************************************************************************ 109 * structure M4_VideoStreamHandler 110 * @brief Extended structure to describe a video stream. 111 ************************************************************************ 112*/ 113typedef struct 114{ 115 M4_StreamHandler m_basicProperties; /**< Audio-Video stream common parameters */ 116 M4OSA_UInt32 m_videoWidth; /**< Width of the video in the stream */ 117 M4OSA_UInt32 m_videoHeight; /**< Height of the video in the stream */ 118 M4OSA_Float m_averageFrameRate; /**< Average frame rate of the video 119 in the stream */ 120 M4OSA_UInt32 m_structSize; /**< Size of the structure in bytes */ 121} M4_VideoStreamHandler; 122 123/** 124 ************************************************************************ 125 * structure M4_AudioStreamHandler 126 * @brief Extended structure to describe an audio stream. 127 ************************************************************************ 128*/ 129typedef struct 130{ 131 M4_StreamHandler m_basicProperties; /**< Audio-Video stream common parameters */ 132 M4OSA_UInt32 m_nbChannels; /**< Number of channels in the audio stream 133 (1-mono, 2-stereo) */ 134 M4OSA_UInt32 m_byteFrameLength; /**< Size of frame samples in bytes */ 135 M4OSA_UInt32 m_byteSampleSize; /**< Number of bytes per sample */ 136 M4OSA_UInt32 m_samplingFrequency; /**< Sample frequency in kHz */ 137 M4OSA_UInt32 m_structSize; /**< Size of the structure in bytes */ 138} M4_AudioStreamHandler; 139 140#ifdef M4VPS_SUPPORT_TTEXT 141 142/** 143 ************************************************************************ 144 * structure M4_TextStreamHandler 145 * @brief Extended structure to describe a text stream. 146 ************************************************************************ 147*/ 148typedef struct 149{ 150 M4_StreamHandler m_basicProperties; /**< Audio-Video stream common parameters */ 151 M4OSA_UInt32 m_trackWidth; /**< Width of the video in the stream */ 152 M4OSA_UInt32 m_trackHeight; /**< Height of the video in the stream */ 153 M4OSA_UInt32 m_trackXpos; /**< X position of the text track in video area */ 154 M4OSA_UInt32 m_trackYpos; /**< Y position of the text track in video area */ 155 M4OSA_UInt8 back_col_rgba[4]; /**< the background color in RGBA */ 156 M4OSA_UInt16 uiLenght; /**< the string lenght in bytes */ 157 M4OSA_UInt32 disp_flag; /**< the way text will be displayed */ 158 M4OSA_UInt8 horiz_justif; /**< the horizontal justification of the text */ 159 M4OSA_UInt8 verti_justif; /**< the vertical justification of the text */ 160 /* style */ 161 M4OSA_UInt16 styl_start_char; /**< the first character impacted by style */ 162 M4OSA_UInt16 styl_end_char; /**< the last character impacted by style */ 163 M4OSA_UInt16 fontID; /**< ID of the font */ 164 M4OSA_UInt8 face_style; /**< the text face-style: bold, italic, 165 underlined, plain(default) */ 166 M4OSA_UInt8 font_size; /**< size in pixel of font */ 167 M4OSA_UInt8 text_col_rgba[4]; /**< the text color in RGBA */ 168 /* box */ 169 M4OSA_UInt16 box_top; /**< the top position of text box in the track area */ 170 M4OSA_UInt16 box_left; /**< the left position of text box in the track area */ 171 M4OSA_UInt16 box_bottom; /**< the bottom position of text box in the track area */ 172 M4OSA_UInt16 box_right; /**< the right position of text box in the track area */ 173 M4OSA_UInt32 m_structSize; /**< Size of the structure in bytes */ 174} M4_TextStreamHandler; 175 176#endif /*M4VPS_SUPPORT_TTEXT*/ 177 178/** 179 ************************************************************************ 180 * structure M4_AccessUnit 181 * @brief Structure to describe an access unit. 182 ************************************************************************ 183*/ 184typedef struct 185{ 186 M4OSA_UInt32 m_streamID; /**< Id of the stream to get an AU from */ 187 M4OSA_MemAddr8 m_dataAddress; /**< Pointer to a memory area with the encoded data */ 188 M4OSA_UInt32 m_size; /**< Size of the dataAdress area */ 189 M4OSA_Double m_CTS; /**< Composition Time Stamp for the Access Unit */ 190 M4OSA_Double m_DTS ; /**< Decoded Time Stamp for the Access Unit */ 191 M4OSA_UInt8 m_attribute; /**< RAP information & AU corrupted */ 192 M4OSA_UInt32 m_maxsize; /**< Maximum size of the AU */ 193 M4OSA_UInt32 m_structSize; /**< Structure size */ 194} M4_AccessUnit; 195 196#ifdef __cplusplus 197} 198#endif /*__cplusplus*/ 199 200#endif /* __M4DA_TYPES_H__ */ 201 202