omxil/xmltestharness/xmlclient/src/omxthreadrequest.h
author Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
Fri, 07 May 2010 16:25:23 +0100
branchOpenMAX-IL_SHAI
changeset 16 eedf2dcd43c6
permissions -rw-r--r--
Implementation of OpenMAX-IL with SHAI
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     1
/*
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     8
*
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    11
*
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    12
* Contributors:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    13
*
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    14
* Description:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    15
*
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    16
*/
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    17
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    18
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    19
/**
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    20
@file
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    21
@internalComponent
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    22
*/
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    23
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    24
#include <e32base.h>
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    25
#include <openmax/il/khronos/v1_x/OMX_Core.h>
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    26
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    27
#ifndef OMXTHREADREQUEST_H
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    28
#define OMXTHREADREQUEST_H
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    29
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    30
_LIT(KXMLClientOMXThreadName, "XMLClientOMXThread");
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    31
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    32
NONSHARABLE_CLASS(COmxThreadRequest) : public CBase
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    33
    {
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    34
public:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    35
    static COmxThreadRequest * NewL();
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    36
    ~COmxThreadRequest();
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    37
 
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    38
    OMX_ERRORTYPE GetHandle(
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    39
        OMX_OUT OMX_HANDLETYPE* pHandle, 
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    40
        OMX_IN  OMX_STRING cComponentName,
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    41
        OMX_IN  OMX_PTR pAppData,
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    42
        OMX_IN  OMX_CALLBACKTYPE* pCallBacks);
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    43
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    44
    OMX_ERRORTYPE FreeHandle(OMX_IN  OMX_HANDLETYPE hComponent);
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    45
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    46
private:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    47
        enum TOMXCoreFunctionCode
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    48
            {
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    49
            EOMXFunctionCodeNone,
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    50
            EOMXFunctionCodeGetHandle,
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    51
            EOMXFunctionCodeFreeHandle,
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    52
            EOMXFunctionCodeTerminate
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    53
            
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    54
            // ... more to be added when required
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    55
            };
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    56
private:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    57
    COmxThreadRequest();
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    58
    void ConstructL();
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    59
    void Terminate();
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    60
    void DoRequest();
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    61
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    62
    static TInt ThreadCreateFunction(TAny* aPtr);
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    63
    static void ThreadTrapFunctionL(TAny* aPtr);
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    64
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    65
private:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    66
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    67
    TOMXCoreFunctionCode iFunction;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    68
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    69
    RThread iRequestThread;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    70
    TRequestStatus iRequestThreadStatus;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    71
    //TThreadId iRequestThreadId;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    72
    TBool iThreadCreated;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    73
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    74
    TRequestStatus* iCallingStatus; // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    75
    TThreadId iCallingThreadId;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    76
    
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    77
    OMX_ERRORTYPE iErrorType;  // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    78
    OMX_HANDLETYPE* ipHandle;  // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    79
    OMX_STRING icComponentName;  // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    80
    OMX_PTR ipAppData;   // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    81
    OMX_CALLBACKTYPE* ipCallBacks;  // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    82
    OMX_HANDLETYPE ihComponent;   // not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    83
    };
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    84
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    85
/** Internal class for passing parameter to OMX thread */
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    86
class TThreadParam
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    87
    {
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    88
public:
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    89
    TThreadId iMainThreadId;
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    90
    TRequestStatus* iSetupComplete; //Not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    91
    COmxThreadRequest* iThreadRequestObj; //Not owned
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    92
    };  
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    93
eedf2dcd43c6 Implementation of OpenMAX-IL with SHAI
Jeremy Murray-Wakefield <jeremy.murray-wakefield@nokia.com>
parents:
diff changeset
    94
#endif //OMXTHREADREQUEST_H