khronosfws/openmax_al/src/common/xathreadsafety.h
changeset 25 6f7ceef7b1d1
parent 12 5a06f39ad45b
child 33 5e8b14bae8c3
equal deleted inserted replaced
21:2ed61feeead6 25:6f7ceef7b1d1
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description: 
    14  * Description: Thread Safety Header
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 #ifndef XATHREADSAFETY_H_
    18 #ifndef XATHREADSAFETY_H_
    19 #define XATHREADSAFETY_H_
    19 #define XATHREADSAFETY_H_
    20 
    20 
    21 #include "openmaxalwrapper.h"
    21 #include "openmaxalwrapper.h"
    24 
    24 
    25 #ifdef _DEBUG
    25 #ifdef _DEBUG
    26 /*parse media object names for debug prints*/
    26 /*parse media object names for debug prints*/
    27 
    27 
    28 static const char* mediaobjectnames[9] =
    28 static const char* mediaobjectnames[9] =
    29 {
    29     {
    30     "XATSMediaPlayer",
    30             "XATSMediaPlayer",
    31     "XATSMediaRecorder",
    31             "XATSMediaRecorder",
    32     "XATSEngine",
    32             "XATSEngine",
    33     "XATSRadio",
    33             "XATSRadio",
    34     "XATSCamera",
    34             "XATSCamera",
    35     "XATSOutputMix",
    35             "XATSOutputMix",
    36     "XATSVibra",
    36             "XATSVibra",
    37     "XATSLEDArray",
    37             "XATSLEDArray",
    38     "XATSMetaDataExtractor"
    38             "XATSMetaDataExtractor"
    39 };
    39     };
    40 #define MEDIAOBJECTNAME(i) ((i<XATSCount)?mediaobjectnames[i]:"INVALID")
    40 #define MEDIAOBJECTNAME(i) ((i<XATSCount)?mediaobjectnames[i]:"INVALID")
    41 #endif /*_DEBUG*/
    41 #endif /*_DEBUG*/
    42 
    42 
    43 /* MACROS */
    43 /* MACROS */
    44 /*
    44 /*
   137     }                                                                                   \
   137     }                                                                                   \
   138 }                                                                                       \
   138 }                                                                                       \
   139 /* ENUMERATIONS */
   139 /* ENUMERATIONS */
   140 
   140 
   141 typedef enum
   141 typedef enum
   142 {
   142     {
   143     XATSMediaPlayer = 0,
   143     XATSMediaPlayer = 0,
   144     XATSMediaRecorder,
   144     XATSMediaRecorder,
   145     XATSEngine,
   145     XATSEngine,
   146     XATSRadio,
   146     XATSRadio,
   147     XATSCamera,
   147     XATSCamera,
   148     XATSOutputMix,
   148     XATSOutputMix,
   149     XATSVibra,
   149     XATSVibra,
   150     XATSLEDArray,
   150     XATSLEDArray,
   151     XATSMetaDataExtractor,
   151     XATSMetaDataExtractor,
   152     XATSCount
   152     XATSCount
   153 }XAThreadSafetyMediaObjects;
   153     } XAThreadSafetyMediaObjects;
   154 
   154 
   155 /* FUNCTIONS */
   155 /* FUNCTIONS */
   156 XAresult XAThreadSafety_Init( XAboolean tsEnable);
   156 XAresult XAThreadSafety_Init(XAboolean tsEnable);
   157 XAresult XAThreadSafety_Destroy(void);
   157 XAresult XAThreadSafety_Destroy(void);
   158 XAresult XAThreadSafety_Unlock( XAThreadSafetyMediaObjects mediaObject );
   158 XAresult XAThreadSafety_Unlock(XAThreadSafetyMediaObjects mediaObject);
   159 XAresult XAThreadSafety_TryLock( XAThreadSafetyMediaObjects mediaObject );
   159 XAresult XAThreadSafety_TryLock(XAThreadSafetyMediaObjects mediaObject);
   160 
   160 
   161 #endif /* XATHREADSAFETY_H_ */
   161 #endif /* XATHREADSAFETY_H_ */