1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef OMXILGENERICILIF_H |
|
17 #define OMXILGENERICILIF_H |
|
18 |
|
19 |
|
20 #include "milcomponentif.h" |
|
21 #include "momxilcomponentifobserver.h" |
|
22 #include <e32base.h> |
|
23 #include <openmax/il/khronos/v1_x/OMX_Component.h> |
|
24 |
|
25 /** |
|
26 Implementation of the MILComponentIf specific to OpenMAX specification. |
|
27 This is the base class implementing the generic parts of the interface and it should be |
|
28 further extended by derivation with the settings of the specific implementation |
|
29 */ |
|
30 class COmxILGenericILIF : public CBase, |
|
31 public MILComponentIf, |
|
32 public MOmxILComponentIfObserver |
|
33 { |
|
34 friend class COmxILGenericPortILIF; |
|
35 |
|
36 public: |
|
37 // from MILComponentIf |
|
38 IMPORT_C void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); |
|
39 IMPORT_C void CreateComponentL(const TUid& aUid, MILIfObserver& ComponentIfObserver); |
|
40 IMPORT_C void ReleaseComponent(); |
|
41 IMPORT_C TInt GetComponentInputPorts(RPointerArray<MILComponentPortIf>& aComponentPorts) const; |
|
42 IMPORT_C TInt GetComponentOutputPorts(RPointerArray<MILComponentPortIf>& aComponentPorts) const; |
|
43 IMPORT_C virtual TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; |
|
44 IMPORT_C virtual TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; |
|
45 IMPORT_C TInt Initialize(); |
|
46 IMPORT_C TInt Execute(); |
|
47 IMPORT_C TInt Pause(); |
|
48 IMPORT_C TInt Stop(); |
|
49 IMPORT_C TInt UnInitialize(); |
|
50 IMPORT_C TInt GetState(TILComponentState& aState) const; |
|
51 IMPORT_C TInt SendCommand(const TILCommand& aCommand); |
|
52 IMPORT_C TInt FlushAllPorts(); |
|
53 IMPORT_C TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; |
|
54 IMPORT_C TInt GetComponentVersion(TILComponentVersion& aVersion) const; |
|
55 IMPORT_C TInt SetComponentIfRole(const TUid& aComponentRole); |
|
56 IMPORT_C TInt SetComponentIfRole(const TDesC8& aComponentRole); |
|
57 IMPORT_C TInt GetComponentIfRole(TUid& aComponentRole) const; |
|
58 IMPORT_C TInt GetComponentIfRole(TDes8& aComponentRole) const; |
|
59 IMPORT_C virtual TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; |
|
60 IMPORT_C virtual TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; |
|
61 IMPORT_C TAny* CustomInterface(TUid aUid); |
|
62 |
|
63 // from MOmxILComponentIfObserver |
|
64 IMPORT_C TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); |
|
65 IMPORT_C TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); |
|
66 IMPORT_C TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); |
|
67 |
|
68 IMPORT_C ~COmxILGenericILIF(); |
|
69 |
|
70 protected: |
|
71 IMPORT_C COmxILGenericILIF(); |
|
72 |
|
73 IMPORT_C TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure) const; |
|
74 IMPORT_C TInt OmxSetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); |
|
75 IMPORT_C TInt OmxGetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue) const; |
|
76 IMPORT_C TInt OmxSetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue); |
|
77 IMPORT_C TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType) const; |
|
78 |
|
79 private: |
|
80 // Internal implementation. Only meant to be used by the component's port interface. |
|
81 TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); |
|
82 TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); |
|
83 TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); |
|
84 TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); |
|
85 CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); |
|
86 TInt OmxFreeBuffer(CMMFBuffer* aBuffer); |
|
87 TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); |
|
88 TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); |
|
89 OMX_COMPONENTTYPE* OmxHandle() const; |
|
90 |
|
91 private: |
|
92 class CBody; |
|
93 |
|
94 CBody* iBody; |
|
95 }; |
|
96 |
|
97 #endif // OMXILGENERICILIF_H |
|
98 |
|