|
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 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #include <openmax/il/common/omxilcomponent.h> |
|
22 #include "omxilcomponentimpl.h" |
|
23 #include "log.h" |
|
24 |
|
25 EXPORT_C |
|
26 COmxILComponent::COmxILComponent() |
|
27 { |
|
28 DEBUG_PRINTF(_L8("COmxILComponent::COmxILComponent")); |
|
29 } |
|
30 |
|
31 EXPORT_C |
|
32 COmxILComponent::~COmxILComponent() |
|
33 { |
|
34 DEBUG_PRINTF(_L8("COmxILComponent::~COmxILComponent")); |
|
35 delete ipImpl; |
|
36 } |
|
37 |
|
38 EXPORT_C void |
|
39 COmxILComponent::ConstructL(OMX_HANDLETYPE aComponent) |
|
40 { |
|
41 DEBUG_PRINTF(_L8("COmxILComponent::ConstructL")); |
|
42 ipImpl = COmxILComponentImpl::NewL(this, aComponent); |
|
43 } |
|
44 |
|
45 EXPORT_C void |
|
46 COmxILComponent::InitComponentL() |
|
47 { |
|
48 DEBUG_PRINTF(_L8("COmxILComponent::InitComponent")); |
|
49 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
50 ipImpl->InitComponentL(); |
|
51 } |
|
52 |
|
53 EXPORT_C |
|
54 OMX_ERRORTYPE COmxILComponent::SymbianErrorToGetHandleError(TInt aSymbianError) |
|
55 { |
|
56 switch(aSymbianError) |
|
57 { |
|
58 case KErrNone: |
|
59 return OMX_ErrorNone; |
|
60 case KErrNoMemory: |
|
61 return OMX_ErrorInsufficientResources; |
|
62 case KErrArgument: |
|
63 return OMX_ErrorBadParameter; |
|
64 }; |
|
65 return OMX_ErrorUndefined; |
|
66 } |
|
67 |
|
68 EXPORT_C |
|
69 MOmxILCallbackNotificationIf* COmxILComponent::CreateCallbackManagerL(TCallbackManagerType aCallbackManagerType) |
|
70 { |
|
71 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
72 return ipImpl->CreateCallbackManagerL(aCallbackManagerType); |
|
73 } |
|
74 |
|
75 EXPORT_C |
|
76 TInt COmxILComponent::AddPort(const COmxILPort* aPort, OMX_DIRTYPE aDirection) |
|
77 { |
|
78 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
79 return ipImpl->AddPort(aPort, aDirection); |
|
80 } |
|
81 |
|
82 EXPORT_C |
|
83 void COmxILComponent::CreatePortManagerL(TPortManagerType aType, |
|
84 const OMX_VERSIONTYPE& aOmxVersion, |
|
85 OMX_U32 aNumberOfAudioPorts, |
|
86 OMX_U32 aStartAudioPortNumber, |
|
87 OMX_U32 aNumberOfImagePorts, |
|
88 OMX_U32 aStartImagePortNumber, |
|
89 OMX_U32 aNumberOfVideoPorts, |
|
90 OMX_U32 aStartVideoPortNumber, |
|
91 OMX_U32 aNumberOfOtherPorts, |
|
92 OMX_U32 aStartOtherPortNumber, |
|
93 OMX_BOOL aImmediateReturnTimeBuffer) |
|
94 { |
|
95 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
96 ipImpl->CreatePortManagerL(aType, |
|
97 aOmxVersion, |
|
98 aNumberOfAudioPorts, |
|
99 aStartAudioPortNumber, |
|
100 aNumberOfImagePorts, |
|
101 aStartImagePortNumber, |
|
102 aNumberOfVideoPorts, |
|
103 aStartVideoPortNumber, |
|
104 aNumberOfOtherPorts, |
|
105 aStartOtherPortNumber, |
|
106 aImmediateReturnTimeBuffer); |
|
107 } |
|
108 |
|
109 EXPORT_C |
|
110 void COmxILComponent::RegisterProcessingFunction(const COmxILProcessingFunction* apProcessingFunction) |
|
111 { |
|
112 __ASSERT_ALWAYS(ipImpl && apProcessingFunction, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
113 ipImpl->RegisterProcessingFunction(apProcessingFunction); |
|
114 } |
|
115 |
|
116 EXPORT_C |
|
117 void COmxILComponent::RegisterConfigurationManager(const COmxILConfigManager* apConfigManager) |
|
118 { |
|
119 __ASSERT_ALWAYS(ipImpl && apConfigManager, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
120 ipImpl->RegisterConfigurationManager(apConfigManager); |
|
121 } |
|
122 |
|
123 |
|
124 EXPORT_C |
|
125 OMX_COMPONENTTYPE* COmxILComponent::GetHandle() const |
|
126 { |
|
127 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
128 return ipImpl->GetHandle(); |
|
129 } |
|
130 |
|
131 EXPORT_C |
|
132 OMX_PTR COmxILComponent::GetAppData() const |
|
133 { |
|
134 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
135 return ipImpl->GetAppData(); |
|
136 } |
|
137 |
|
138 EXPORT_C |
|
139 OMX_CALLBACKTYPE* COmxILComponent::GetCallbacks() const |
|
140 { |
|
141 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
142 return ipImpl->GetCallbacks(); |
|
143 } |
|
144 |
|
145 EXPORT_C |
|
146 COmxILConfigManager* COmxILComponent::GetConfigManager() const |
|
147 { |
|
148 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
149 return ipImpl->GetConfigManager(); |
|
150 } |
|
151 |
|
152 EXPORT_C |
|
153 COmxILProcessingFunction* COmxILComponent::GetProcessingFunction() const |
|
154 { |
|
155 __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1)); |
|
156 return ipImpl->GetProcessingFunction(); |
|
157 } |
|
158 |
|
159 EXPORT_C |
|
160 TInt COmxILComponent::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1) |
|
161 { |
|
162 return CBase::Extension_(aExtensionId, a0, a1); |
|
163 } |
|
164 |
|
165 |