|
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 "omxilaudiofilesinkopb0port.h" |
|
24 #include "omxilfilesinkprocessingfunction.h" |
|
25 #include <uri8.h> |
|
26 |
|
27 COmxILAudioFileSinkOPB0Port* COmxILAudioFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, |
|
28 const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats, |
|
29 const COmxILFileSinkProcessingFunction& aFileSinkPF) |
|
30 { |
|
31 COmxILAudioFileSinkOPB0Port* self = new (ELeave) COmxILAudioFileSinkOPB0Port(aCommonPortData, aFileSinkPF); |
|
32 CleanupStack::PushL(self); |
|
33 self->ConstructL(aSupportedAudioFormats); |
|
34 CleanupStack::Pop(self); |
|
35 return self; |
|
36 } |
|
37 |
|
38 void COmxILAudioFileSinkOPB0Port::ConstructL(const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats) |
|
39 { |
|
40 iParamPortDefinition.eDomain = OMX_PortDomainAudio; |
|
41 |
|
42 // base |
|
43 COmxILAudioPort::ConstructL(aSupportedAudioFormats); |
|
44 } |
|
45 |
|
46 COmxILAudioFileSinkOPB0Port::COmxILAudioFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, |
|
47 const COmxILFileSinkProcessingFunction& aFileSinkPF) |
|
48 : COmxILAudioPort(aCommonPortData), |
|
49 iFileSinkPF(aFileSinkPF) |
|
50 { |
|
51 } |
|
52 |
|
53 COmxILAudioFileSinkOPB0Port::~COmxILAudioFileSinkOPB0Port() |
|
54 { |
|
55 CleanUpPort(); |
|
56 } |
|
57 |
|
58 OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const |
|
59 { |
|
60 return COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); |
|
61 } |
|
62 |
|
63 OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const |
|
64 { |
|
65 return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); |
|
66 } |
|
67 |
|
68 OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, |
|
69 TAny* apComponentParameterStructure) const |
|
70 { |
|
71 return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure); |
|
72 } |
|
73 |
|
74 OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, |
|
75 const TAny* apComponentParameterStructure, |
|
76 TBool& aUpdateProcessingFunction) |
|
77 { |
|
78 return COmxILAudioPort::SetParameter(aParamIndex, |
|
79 apComponentParameterStructure, |
|
80 aUpdateProcessingFunction); |
|
81 } |
|
82 |
|
83 OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, |
|
84 TBool& /*aUpdateProcessingFunction*/) |
|
85 { |
|
86 iParamPortDefinition.format.audio = aPortDefinition.format.audio; |
|
87 return OMX_ErrorNone; |
|
88 } |
|
89 |
|
90 TBool COmxILAudioFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const |
|
91 { |
|
92 if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) |
|
93 { |
|
94 return EFalse; |
|
95 } |
|
96 |
|
97 if (aPortDefinition.format.audio.eEncoding == OMX_AUDIO_CodingMax) |
|
98 { |
|
99 return EFalse; |
|
100 } |
|
101 return ETrue; |
|
102 } |