|
1 // Copyright (c) 2010 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 |
|
18 /** |
|
19 * @file |
|
20 * @internalTechnology |
|
21 */ |
|
22 |
|
23 #include "omxilimagefilesourceopb0port.h" |
|
24 #include "omxilfilesourceprocessingfunction.h" |
|
25 #include <uri8.h> |
|
26 |
|
27 COmxILImageFileSourceOPB0Port* COmxILImageFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, |
|
28 const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats, |
|
29 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats, |
|
30 const COmxILFileSourceProcessingFunction& aFileSourcePF) |
|
31 { |
|
32 COmxILImageFileSourceOPB0Port* self = new (ELeave) COmxILImageFileSourceOPB0Port(aCommonPortData, |
|
33 aSupportedImageFormats, |
|
34 aSupportedColorFormats, |
|
35 aFileSourcePF); |
|
36 CleanupStack::PushL(self); |
|
37 self->ConstructL(); |
|
38 CleanupStack::Pop(self); |
|
39 return self; |
|
40 } |
|
41 |
|
42 void COmxILImageFileSourceOPB0Port::ConstructL() |
|
43 { |
|
44 iParamPortDefinition.eDomain = OMX_PortDomainImage; |
|
45 } |
|
46 |
|
47 COmxILImageFileSourceOPB0Port::COmxILImageFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, |
|
48 const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats, |
|
49 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats, |
|
50 const COmxILFileSourceProcessingFunction& aFileSourcePF) |
|
51 : COmxILImagePort(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats), |
|
52 iFileSourcePF(aFileSourcePF) |
|
53 { |
|
54 } |
|
55 |
|
56 COmxILImageFileSourceOPB0Port::~COmxILImageFileSourceOPB0Port() |
|
57 { |
|
58 CleanUpPort(); |
|
59 } |
|
60 |
|
61 OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const |
|
62 { |
|
63 return COmxILImagePort::GetLocalOmxParamIndexes(aIndexArray); |
|
64 } |
|
65 |
|
66 OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const |
|
67 { |
|
68 return COmxILImagePort::GetLocalOmxConfigIndexes(aIndexArray); |
|
69 } |
|
70 |
|
71 OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, |
|
72 TAny* apComponentParameterStructure) const |
|
73 { |
|
74 return COmxILImagePort::GetParameter(aParamIndex, apComponentParameterStructure); |
|
75 } |
|
76 |
|
77 OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, |
|
78 const TAny* apComponentParameterStructure, |
|
79 TBool& aUpdateProcessingFunction) |
|
80 { |
|
81 return COmxILImagePort::SetParameter(aParamIndex, |
|
82 apComponentParameterStructure, |
|
83 aUpdateProcessingFunction); |
|
84 } |
|
85 |
|
86 OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, |
|
87 TBool& /*aUpdateProcessingFunction*/) |
|
88 { |
|
89 iParamPortDefinition.format.image = aPortDefinition.format.image; |
|
90 return OMX_ErrorNone; |
|
91 } |
|
92 |
|
93 TBool COmxILImageFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const |
|
94 { |
|
95 if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) |
|
96 { |
|
97 return EFalse; |
|
98 } |
|
99 |
|
100 if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingMax) |
|
101 { |
|
102 return EFalse; |
|
103 } |
|
104 return ETrue; |
|
105 } |