sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "omxcomponentbody.h" sl@0: #include "omxinputportbody.h" sl@0: sl@0: _LIT(KOmxInputPort, "OmxInputPort"); sl@0: sl@0: /** sl@0: Constructor. sl@0: */ sl@0: EXPORT_C COmxInputPort::COmxInputPort() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: EXPORT_C COmxInputPort::~COmxInputPort() sl@0: { sl@0: delete iBody; sl@0: } sl@0: sl@0: /** sl@0: Class constructor. sl@0: */ sl@0: EXPORT_C void COmxInputPort::ConstructL(TInt aIndex, COmxProcessingUnit* aComponent) sl@0: { sl@0: __ASSERT_ALWAYS(!iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: iBody = CBody::NewL(aIndex, aComponent, this); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to configure the OpenMAX Input Port. sl@0: @param aConfiguration sl@0: Holds the configuration parameters for the OpenMAX Input Port. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: nother of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipConfigure(const TPuConfig& aConfig) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipConfigure(aConfig); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous method which gets a configuration structure for the OpenMAX Input Port sl@0: @param aConfig sl@0: The reference to the structure that is to contain the configuration information. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipGetConfig(TPuConfig& aConfig) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipGetConfig(aConfig); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to initialise the OpenMAX Input Port. sl@0: */ sl@0: EXPORT_C void COmxInputPort::MipInitialize() sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: iBody->MipInitialize(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to instruct the OpenMAX Input Port to create a buffer. sl@0: @param aBufferSize sl@0: The size of the buffer to be created. sl@0: @return A pointer to the new created buffer. sl@0: */ sl@0: EXPORT_C CMMFBuffer* COmxInputPort::MipCreateBuffer(TInt aBufferSize) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipCreateBuffer(aBufferSize); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to instruct the OpenMAX Input Port to use the buffer sl@0: passed in the function's argument. sl@0: @param aBuffer sl@0: The buffer to be used by the Input Port. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipUseBuffer(CMMFBuffer& aBuffer) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipUseBuffer(aBuffer); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to instruct the OpenMAX Input Port to free the buffer given sl@0: passed in the function's argument. sl@0: @param aBuffer sl@0: The buffer to be freed sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipFreeBuffer(CMMFBuffer* aBuffer) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipFreeBuffer(aBuffer); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to request the set up of a tunnel between this OpenMAX Input Port sl@0: and an OpenMAX Output Port. sl@0: @param aOutputPortToBeConnectedTo sl@0: Reference to the Output Port to be connected to. sl@0: @param aTunnelFlags sl@0: Control flags for tunneling sl@0: @param aSupplierType sl@0: Specifies the supplier of the buffers for the tunnel. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo, sl@0: TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipTunnelRequest(aOutputPortToBeConnectedTo, aTunnelFlags, aSupplierType); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Asynchronous function used to write data to the OpenMAX Input Port. sl@0: @param aBuffer sl@0: Reference to the buffer containing data. sl@0: */ sl@0: EXPORT_C void COmxInputPort::MipWriteData(CMMFBuffer& aInputBuffer) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: iBody->MipWriteData(aInputBuffer); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing. sl@0: */ sl@0: EXPORT_C void COmxInputPort::MipDisconnectTunnel() sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: iBody->MipDisconnectTunnel(); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function used to restart the data processing of a tunnelled port. sl@0: */ sl@0: EXPORT_C void COmxInputPort::MipRestartTunnel() sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: iBody->MipRestartTunnel(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to find out if an OpenMAX Input Port is tunnelled or not. sl@0: @return ETrue if the Input Port is tunnelled, EFalse otherwise. sl@0: */ sl@0: EXPORT_C TBool COmxInputPort::MipIsTunnelled() const sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipIsTunnelled(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to get the OpenMAX Input Port index sl@0: @return The OpenMAX Input Port index. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipIndex() const sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->MipIndex(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to get the size of the buffer(s) used by the OpenMAX Input Port. sl@0: @param The OpenMAX Input Port's buffer size. sl@0: */ sl@0: EXPORT_C TUint32 COmxInputPort::MipBufferSize() const sl@0: { sl@0: return iBody->MipBufferSize(); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to set the observer for the OpenMAX Input Port. sl@0: @param aOutputPortObserver sl@0: The observer of the OpenMAX Input Port. sl@0: */ sl@0: EXPORT_C void COmxInputPort::MipSetObserver(const MMdfInputPortObserver& aOutputPortObserver) sl@0: { sl@0: iBody->MipSetObserver(aOutputPortObserver); sl@0: } sl@0: sl@0: /** sl@0: Request extension feature. This is intended to provide additional features. sl@0: @param aUid sl@0: Used to indicate which interface is required. sl@0: @return Standard error code. KErrNotSupported is used to indicate that the particular sl@0: plugin is not used. sl@0: */ sl@0: EXPORT_C TInt COmxInputPort::MipCreateCustomInterface(TUid aUid) sl@0: { sl@0: return iBody->MipCreateCustomInterface(aUid); sl@0: } sl@0: sl@0: /** sl@0: Return previously created extension. sl@0: This returns a custom interface. This should only be used if CreateCustomInterface() has already sl@0: been called for the same UID value. This means that any construction for that interface sl@0: has already been called, and thus this call cannot fail. sl@0: @param aUid sl@0: Used to indicate which interface is required. sl@0: @return The requested interface, or NULL if not known. sl@0: @see MipCreateCustomInterface() sl@0: */ sl@0: EXPORT_C TAny* COmxInputPort::MipCustomInterface(TUid aUid) sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return MipCustomInterface(aUid); sl@0: } sl@0: sl@0: /** sl@0: Synchronous function used to return the observer for the OpenMAx Input Port. sl@0: @return Pointer to this class obsever sl@0: */ sl@0: EXPORT_C MMdfInputPortObserver* COmxInputPort::Observer() const sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->Observer(); sl@0: } sl@0: sl@0: /** sl@0: Synchronous function used to return the OpenMAX Processing Unit this Input Port sl@0: belongs to. sl@0: @return Pointer to the OpenMAX Processing Unit this Input Port belongs to. sl@0: */ sl@0: EXPORT_C COmxProcessingUnit* COmxInputPort::Component() const sl@0: { sl@0: __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated)); sl@0: return iBody->Component(); sl@0: }