videoeditorengine/mp3aacManipLib/inc/defines.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description:
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**************************************************************************
       
    21   defines.h - Global data prototypes, compile switches etc.
       
    22 
       
    23   Author(s): Juha Ojanpera
       
    24   Copyright (c) 1999-2003 by Nokia Research Center, Speech and Audio Systems.
       
    25   *************************************************************************/
       
    26 
       
    27 #ifndef DEFINES_H_
       
    28 #define DEFINES_H_
       
    29 
       
    30 #ifdef NOT_SYMBIAN_OS
       
    31 
       
    32 /*-- Header files to be included. --*/
       
    33 #include <assert.h>
       
    34 #include <stdio.h>
       
    35 #include <stdlib.h>
       
    36 #include <string.h>
       
    37 
       
    38 /*-- Data types. --*/
       
    39 typedef short int16;
       
    40 typedef unsigned short uint16;
       
    41 typedef float FLOAT;
       
    42 #ifdef NATIVE64
       
    43 typedef unsigned int uint32;
       
    44 typedef int int32;
       
    45 #else
       
    46 typedef unsigned long uint32;
       
    47 typedef long int32;
       
    48 #endif
       
    49 typedef int BOOL;
       
    50 typedef unsigned char uint8;
       
    51 
       
    52 #ifdef HAS_INLINE
       
    53 #define INLINE inline
       
    54 #else
       
    55 #ifdef HAS_C_INLINE
       
    56 #define INLINE __inline
       
    57 #else
       
    58 #define INLINE
       
    59 #endif
       
    60 #endif
       
    61 
       
    62 #define GET_CHUNK(x) (memset(malloc(x), 0, x))
       
    63 #define SWAP_INT16(x) ((((uint32)x >> 8) & 0xFF) | ((uint32)x << 8))
       
    64 #define SAFE_DELETE(x) if(x) free(x); x = NULL
       
    65 #define IS_ERROR(x) if(x == NULL) goto error_exit;
       
    66 #define ZERO_MEMORY(x, y)    memset(x, 0, y)
       
    67 #define COPY_MEMORY(x, y, z) memcpy(x, y, z)
       
    68 #define SET_MEMORY(x, y, z)  memset(x, z, y)
       
    69 
       
    70 #else
       
    71 
       
    72 /*-- System Headers. --*/
       
    73 #include <e32def.h>
       
    74 #include <e32std.h>
       
    75 #include <e32base.h>
       
    76 
       
    77 //#include <stdlib.h>
       
    78 //#include <stdio.h>
       
    79 
       
    80 #ifndef M_PI
       
    81 #define M_PI 3.14159265358979323846
       
    82 #endif
       
    83 
       
    84 /*-- Data types. --*/
       
    85 typedef TInt8             int8;
       
    86 typedef TUint8            uint8;
       
    87 typedef TInt16            int16;
       
    88 typedef TUint16           uint16;
       
    89 typedef TInt              int32;
       
    90 typedef TUint             uint32;
       
    91 typedef TUint8            BOOL;
       
    92 typedef TReal           FLOAT;
       
    93 
       
    94 #define INLINE inline
       
    95 
       
    96 #define GET_CHUNK(x)         User::LeaveIfNull(User::Alloc(x))
       
    97 #define GET_SYMBIAN_CHUNK(x)    x::NewL()
       
    98 
       
    99 #define IS_ERROR(x)
       
   100 #define SAFE_DELETE(x)       if(x) User::Free(x); x = NULL
       
   101 #define SAFE_SYMBIAN_DELETE(x)    if(x != 0) delete x; x = 0
       
   102 
       
   103 #define ZERO_MEMORY(x, y)    Mem::FillZ(x, y)
       
   104 #define COPY_MEMORY(x, y, z) Mem::Copy(x, y, z)
       
   105 #define SET_MEMORY(x, y, z)  Mem::Fill(x, y, TChar((TUint) z))
       
   106 
       
   107 
       
   108 /*-- AAC definitions. --*/
       
   109 #define LTP_PROFILE
       
   110 #define MONO_VERSION
       
   111 #define STEREO_VERSION
       
   112 #define AAC_ADIF_FORMAT
       
   113 #define AAC_ADTS_FORMAT
       
   114 #define AAC_INDEX_TABLES
       
   115 
       
   116 #define FAST_MIX
       
   117 
       
   118 
       
   119 #endif /*-- NOT_SYMBIAN_OS --*/
       
   120 
       
   121 #ifndef TRUE
       
   122 #define TRUE  (1)
       
   123 #endif
       
   124 #ifndef FALSE
       
   125 #define FALSE (0)
       
   126 #endif
       
   127 
       
   128 /*-- Some Useful Macros. --*/
       
   129 #ifdef MIN
       
   130 #undef MIN
       
   131 #endif
       
   132 #define MIN(A, B)            ((A) < (B) ? (A) : (B))
       
   133 
       
   134 #ifdef MAX
       
   135 #undef MAX
       
   136 #endif
       
   137 #define MAX(A, B)            ((A) > (B) ? (A) : (B))
       
   138 
       
   139 #endif /*-- DEFINES_H_ --*/