|
1 /* |
|
2 * Copyright (c) 2008-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 #ifndef NONTUNNELEDHANDLER_H |
|
20 #define NONTUNNELEDHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <openmax/il/khronos/v1_x/OMX_Component.h> |
|
24 |
|
25 NONSHARABLE_CLASS(CNonTunneledHandler) : public CBase |
|
26 { |
|
27 public: |
|
28 CNonTunneledHandler(); |
|
29 ~CNonTunneledHandler(); |
|
30 |
|
31 void AddLinkL(OMX_COMPONENTTYPE* aSourceComp, TInt aSourcePort, |
|
32 OMX_COMPONENTTYPE* aSinkComp, TInt aSinkPort, |
|
33 OMX_BUFFERSUPPLIERTYPE aSupplier, TInt aNumBufs, TInt aBufSize); |
|
34 void AllocateBuffersL(OMX_COMPONENTTYPE* aComp); |
|
35 void FillBuffers(OMX_COMPONENTTYPE* aComp); |
|
36 void BufferDone(OMX_COMPONENTTYPE* aComp, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource); |
|
37 void HoldBuffers(OMX_COMPONENTTYPE* aComp); |
|
38 void FreeBuffers(OMX_COMPONENTTYPE* aComp); |
|
39 |
|
40 private: |
|
41 NONSHARABLE_CLASS(CPortInfo) : public CBase |
|
42 { |
|
43 public: |
|
44 CPortInfo(OMX_COMPONENTTYPE* aComp, TInt aPortNum, TBool aSource, TInt aNumBufs, TInt aBufSize, OMX_BUFFERSUPPLIERTYPE aSupplier); |
|
45 ~CPortInfo(); |
|
46 void SetPeer(CPortInfo* aPeer); |
|
47 void AllocateBuffersL(); |
|
48 void FillBuffers(); |
|
49 void SendAllocatedBufferToPeerL(OMX_U8* aBuffer); |
|
50 void ReceiveAllocatedBufferFromPeerL(OMX_U8* aBuffer); |
|
51 void BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr); |
|
52 void SendBufferToPeer(TInt aBufHdrOffset, OMX_BUFFERHEADERTYPE* aPeerBufHdr); |
|
53 void ReceiveBufferFromPeer(TInt aBufHdrOffset, OMX_BUFFERHEADERTYPE* aPeerBufHdr); |
|
54 void HoldBuffers(); |
|
55 void FreeBuffers(); |
|
56 void DeleteAllBuffers(); |
|
57 static TBool ComparePortNum(const TInt* aPortNum, const CPortInfo& aPortInfo); |
|
58 |
|
59 private: |
|
60 OMX_COMPONENTTYPE* iComp; |
|
61 TInt iPortNum; |
|
62 TBool iSource; |
|
63 TInt iNumBufs; |
|
64 TInt iBufSize; |
|
65 OMX_BUFFERSUPPLIERTYPE iSupplier; |
|
66 RPointerArray<OMX_U8> iBuffers; |
|
67 RPointerArray<OMX_BUFFERHEADERTYPE> iBufferHeaders; |
|
68 CPortInfo* iPeer; |
|
69 TBool iWaitingForBuffers; |
|
70 TBool iHoldingBuffers; |
|
71 TBool iEosSignalledtoInput; |
|
72 }; |
|
73 |
|
74 NONSHARABLE_CLASS(CComponentInfo) : public CBase |
|
75 { |
|
76 public: |
|
77 CComponentInfo(OMX_COMPONENTTYPE* aComp); |
|
78 ~CComponentInfo(); |
|
79 CPortInfo* AddPortL(TInt aPortNum, TBool aSource, TInt aNumBufs, TInt aBufSize, OMX_BUFFERSUPPLIERTYPE aSupplier); |
|
80 void AllocateBuffersL(); |
|
81 void FillBuffers(); |
|
82 void BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource); |
|
83 void HoldBuffers(); |
|
84 void FreeBuffers(); |
|
85 static TBool CompareComp(const OMX_COMPONENTTYPE* aSource, const CComponentInfo& aComponentInfo); |
|
86 |
|
87 private: |
|
88 OMX_COMPONENTTYPE* iComp; |
|
89 RPointerArray<CPortInfo> iPorts; |
|
90 }; |
|
91 |
|
92 RPointerArray<CComponentInfo> iComponents; |
|
93 }; |
|
94 |
|
95 #endif // NONTUNNELEDHANDLER_H |