|
1 /* |
|
2 * Copyright (c) 2008-2009 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 "comxilvideoscheduleroutputport.h" |
|
25 |
|
26 |
|
27 COmxILVideoSchedulerOutputPort* COmxILVideoSchedulerOutputPort::NewL(const TOmxILCommonPortData& aCommonPortData) |
|
28 { |
|
29 // TODO these arrays must left empty, to be removed from the video port constructor |
|
30 RArray<OMX_VIDEO_CODINGTYPE> supportedCodings; |
|
31 RArray<OMX_COLOR_FORMATTYPE> supportedColorFormats; |
|
32 CleanupClosePushL(supportedCodings); |
|
33 CleanupClosePushL(supportedColorFormats); |
|
34 |
|
35 COmxILVideoSchedulerOutputPort* self = new(ELeave) COmxILVideoSchedulerOutputPort(aCommonPortData, supportedCodings, supportedColorFormats); |
|
36 CleanupStack::PushL(self); |
|
37 self->ConstructL(); |
|
38 CleanupStack::Pop(self); |
|
39 |
|
40 CleanupStack::PopAndDestroy(2, &supportedCodings); |
|
41 |
|
42 return self; |
|
43 } |
|
44 |
|
45 COmxILVideoSchedulerOutputPort::COmxILVideoSchedulerOutputPort(const TOmxILCommonPortData& aCommonPortData, |
|
46 const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings, |
|
47 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats) |
|
48 : COmxILVideoPort(aCommonPortData, aSupportedCodings, aSupportedColourFormats) |
|
49 { |
|
50 } |
|
51 |
|
52 COmxILVideoSchedulerOutputPort::~COmxILVideoSchedulerOutputPort() |
|
53 { |
|
54 iMimeTypeBuf.Close(); |
|
55 } |
|
56 |
|
57 void COmxILVideoSchedulerOutputPort::ConstructL() |
|
58 { |
|
59 // Port definition mime type. Mime type is not relevant for uncompressed video frames |
|
60 iMimeTypeBuf.CreateL(KNullDesC8(), KNullDesC8().Length() + 1); |
|
61 TUint8* pTUint = const_cast<TUint8*>(iMimeTypeBuf.PtrZ()); |
|
62 iParamPortDefinition.format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint); |
|
63 |
|
64 iSupportedVideoFormats.AppendL(OMX_VIDEO_CodingUnused); |
|
65 iSupportedColorFormats.AppendL(OMX_COLOR_FormatUnused); |
|
66 } |
|
67 |
|
68 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const |
|
69 { |
|
70 return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray); |
|
71 } |
|
72 |
|
73 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const |
|
74 { |
|
75 return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray); |
|
76 } |
|
77 |
|
78 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetParameter(OMX_INDEXTYPE aParamIndex, |
|
79 TAny* apComponentParameterStructure) const |
|
80 { |
|
81 return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure); |
|
82 } |
|
83 |
|
84 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::SetParameter(OMX_INDEXTYPE aParamIndex, |
|
85 const TAny* apComponentParameterStructure, |
|
86 TBool& aUpdateProcessingFunction) |
|
87 { |
|
88 return COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); |
|
89 } |
|
90 |
|
91 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, |
|
92 TBool& /*aUpdateProcessingFunction*/) |
|
93 { |
|
94 iParamPortDefinition.format.video = aPortDefinition.format.video; |
|
95 TUint8* pTUint = const_cast<TUint8*>(iMimeTypeBuf.PtrZ()); |
|
96 iParamPortDefinition.format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint); |
|
97 iParamPortDefinition.format.video.nSliceHeight = iParamPortDefinition.format.video.nFrameHeight; |
|
98 iParamPortDefinition.nBufferSize = iParamPortDefinition.format.video.nStride * iParamPortDefinition.format.video.nSliceHeight; |
|
99 return OMX_ErrorNone; |
|
100 } |
|
101 |
|
102 TBool COmxILVideoSchedulerOutputPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const |
|
103 { |
|
104 return ETrue; |
|
105 } |
|
106 |
|
107 /** Returns the number of buffers configured on this port. */ |
|
108 TUint32 COmxILVideoSchedulerOutputPort::BufferCount() const |
|
109 { |
|
110 return iParamPortDefinition.nBufferCountActual; |
|
111 } |