0
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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 |
/**
|
|
20 |
@file
|
|
21 |
@internalComponent
|
|
22 |
*/
|
|
23 |
|
|
24 |
#include "comxil3gpmuxeraudioinputport.h"
|
|
25 |
#include "log.h"
|
|
26 |
|
|
27 |
// TODO: Possibly add other mime types, for now only AAC handled
|
|
28 |
_LIT8(KMimeTypeAudioAac, "audio/aac");
|
|
29 |
|
|
30 |
COmxIL3GPMuxerAudioInputPort* COmxIL3GPMuxerAudioInputPort::NewL(const TOmxILCommonPortData& aCommonPortData)
|
|
31 |
{
|
|
32 |
DEBUG_PRINTF(_L8("COmxIL3GPMuxerAudioInputPort::NewL"));
|
|
33 |
|
|
34 |
COmxIL3GPMuxerAudioInputPort* self = new(ELeave) COmxIL3GPMuxerAudioInputPort();
|
|
35 |
CleanupStack::PushL(self);
|
|
36 |
self->ConstructL(aCommonPortData);
|
|
37 |
CleanupStack::Pop(self);
|
|
38 |
return self;
|
|
39 |
}
|
|
40 |
|
|
41 |
void COmxIL3GPMuxerAudioInputPort::ConstructL(const TOmxILCommonPortData& aCommonPortData)
|
|
42 |
{
|
|
43 |
RArray<OMX_AUDIO_CODINGTYPE> supportedCodings;
|
|
44 |
CleanupClosePushL(supportedCodings);
|
|
45 |
supportedCodings.AppendL(OMX_AUDIO_CodingAAC);
|
|
46 |
COmxILAudioPort::ConstructL(aCommonPortData, supportedCodings);
|
|
47 |
CleanupStack::PopAndDestroy(&supportedCodings);
|
|
48 |
|
|
49 |
// We have to finish with iParamPortDefinition
|
|
50 |
GetParamPortDefinition().eDomain = OMX_PortDomainAudio;
|
|
51 |
GetParamPortDefinition().format.audio.pNativeRender = 0;
|
|
52 |
|
|
53 |
// TODO: Possible add in the future other mime types that can be handled by
|
|
54 |
// this audio port... for now only AAC Check
|
|
55 |
// COmxILAudioPort::iParamAudioPortFormat.nIndex and use
|
|
56 |
// COmxILAudioPort::iSupportedAudioFormats[iParamAudioPortFormat.nIndex]
|
|
57 |
|
|
58 |
iMimeTypeBuf.CreateL(KMimeTypeAudioAac(), KMimeTypeAudioAac().Length() + 1);
|
|
59 |
|
|
60 |
TUint8* pTUint = const_cast<TUint8*>(iMimeTypeBuf.PtrZ());
|
|
61 |
GetParamPortDefinition().format.audio.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint);
|
|
62 |
|
|
63 |
GetParamPortDefinition().format.audio.bFlagErrorConcealment = OMX_FALSE;
|
|
64 |
GetParamPortDefinition().format.audio.eEncoding = OMX_AUDIO_CodingAAC;
|
|
65 |
}
|
|
66 |
|
|
67 |
COmxIL3GPMuxerAudioInputPort::COmxIL3GPMuxerAudioInputPort()
|
|
68 |
{
|
|
69 |
}
|
|
70 |
|
|
71 |
COmxIL3GPMuxerAudioInputPort::~COmxIL3GPMuxerAudioInputPort()
|
|
72 |
{
|
|
73 |
DEBUG_PRINTF(_L8("COmxIL3GPMuxerAudioInputPort::~COmxIL3GPMuxerAudioInputPort"));
|
|
74 |
iMimeTypeBuf.Close();
|
|
75 |
}
|
|
76 |
|
|
77 |
OMX_U32 COmxIL3GPMuxerAudioInputPort::GetAudioFrameRate() const
|
|
78 |
{
|
|
79 |
// TODO return nSamplingRate
|
|
80 |
return 0;
|
|
81 |
}
|
|
82 |
|
|
83 |
OMX_ERRORTYPE COmxIL3GPMuxerAudioInputPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
|
|
84 |
{
|
|
85 |
return COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray);
|
|
86 |
}
|
|
87 |
|
|
88 |
OMX_ERRORTYPE COmxIL3GPMuxerAudioInputPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
|
|
89 |
{
|
|
90 |
return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray);
|
|
91 |
}
|
|
92 |
|
|
93 |
OMX_ERRORTYPE COmxIL3GPMuxerAudioInputPort::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const
|
|
94 |
{
|
|
95 |
DEBUG_PRINTF2(_L8("COmxIL3GPMuxerAudioInputPort::GetParameter : aParamIndex[%u]"), aParamIndex);
|
|
96 |
return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure);
|
|
97 |
}
|
|
98 |
|
|
99 |
OMX_ERRORTYPE COmxIL3GPMuxerAudioInputPort::SetParameter(OMX_INDEXTYPE aParamIndex,
|
|
100 |
const TAny* apComponentParameterStructure,
|
|
101 |
TBool& aUpdateProcessingFunction)
|
|
102 |
{
|
|
103 |
DEBUG_PRINTF2(_L8("COmxIL3GPMuxerAudioInputPort::SetParameter : aParamIndex[%u]"), aParamIndex);
|
|
104 |
return COmxILAudioPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
|
|
105 |
}
|
|
106 |
|
|
107 |
OMX_ERRORTYPE COmxIL3GPMuxerAudioInputPort::SetFormatInPortDefinition(
|
|
108 |
const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
|
|
109 |
TBool& /*aUpdateProcessingFunction*/)
|
|
110 |
{
|
|
111 |
if (aPortDefinition.nBufferCountActual > KMaxAudioBuffers)
|
|
112 |
{
|
|
113 |
return OMX_ErrorBadParameter;
|
|
114 |
}
|
|
115 |
|
|
116 |
GetParamPortDefinition().format.audio = aPortDefinition.format.audio;
|
|
117 |
|
|
118 |
return OMX_ErrorNone;
|
|
119 |
}
|
|
120 |
|
|
121 |
TBool COmxIL3GPMuxerAudioInputPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const
|
|
122 |
{
|
|
123 |
// TODO (The base class should do this checking)
|
|
124 |
return ETrue;
|
|
125 |
}
|