tsrc/xmltestharness/xmlclient/src/omxthreadrequest.h
changeset 0 0e4a32b9112d
equal deleted inserted replaced
-1:000000000000 0:0e4a32b9112d
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20 @file
       
    21 @internalComponent
       
    22 */
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <openmax/il/khronos/v1_x/OMX_Core.h>
       
    26 
       
    27 #ifndef OMXTHREADREQUEST_H
       
    28 #define OMXTHREADREQUEST_H
       
    29 
       
    30 _LIT(KXMLClientOMXThreadName, "XMLClientOMXThread");
       
    31 
       
    32 NONSHARABLE_CLASS(COmxThreadRequest) : public CBase
       
    33     {
       
    34 public:
       
    35     static COmxThreadRequest * NewL();
       
    36     ~COmxThreadRequest();
       
    37  
       
    38     OMX_ERRORTYPE GetHandle(
       
    39         OMX_OUT OMX_HANDLETYPE* pHandle, 
       
    40         OMX_IN  OMX_STRING cComponentName,
       
    41         OMX_IN  OMX_PTR pAppData,
       
    42         OMX_IN  OMX_CALLBACKTYPE* pCallBacks);
       
    43 
       
    44     OMX_ERRORTYPE FreeHandle(OMX_IN  OMX_HANDLETYPE hComponent);
       
    45     
       
    46 private:
       
    47         enum TOMXCoreFunctionCode
       
    48             {
       
    49             EOMXFunctionCodeNone,
       
    50             EOMXFunctionCodeGetHandle,
       
    51             EOMXFunctionCodeFreeHandle,
       
    52             EOMXFunctionCodeTerminate
       
    53             
       
    54             // ... more to be added when required
       
    55             };
       
    56 private:
       
    57     COmxThreadRequest();
       
    58     void ConstructL();
       
    59     void Terminate();
       
    60     void DoRequest();
       
    61     
       
    62     static TInt ThreadCreateFunction(TAny* aPtr);
       
    63     static void ThreadTrapFunctionL(TAny* aPtr);
       
    64     
       
    65 private:
       
    66     
       
    67     TOMXCoreFunctionCode iFunction;
       
    68     
       
    69     RThread iRequestThread;
       
    70     TRequestStatus iRequestThreadStatus;
       
    71     //TThreadId iRequestThreadId;
       
    72     TBool iThreadCreated;
       
    73     
       
    74     TRequestStatus* iCallingStatus; // not owned
       
    75     TThreadId iCallingThreadId;
       
    76     
       
    77     OMX_ERRORTYPE iErrorType;  // not owned
       
    78     OMX_HANDLETYPE* ipHandle;  // not owned
       
    79     OMX_STRING icComponentName;  // not owned
       
    80     OMX_PTR ipAppData;   // not owned
       
    81     OMX_CALLBACKTYPE* ipCallBacks;  // not owned
       
    82     OMX_HANDLETYPE ihComponent;   // not owned
       
    83     };
       
    84 
       
    85 /** Internal class for passing parameter to OMX thread */
       
    86 class TThreadParam
       
    87     {
       
    88 public:
       
    89     TThreadId iMainThreadId;
       
    90     TRequestStatus* iSetupComplete; //Not owned
       
    91     COmxThreadRequest* iThreadRequestObj; //Not owned
       
    92     };  
       
    93 
       
    94 #endif //OMXTHREADREQUEST_H