sl@0: /* sl@0: * Copyright (c) 2006-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: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef MBUFFERSOURCE_H sl@0: #define MBUFFERSOURCE_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CMMFBuffer; sl@0: sl@0: /** sl@0: * Buffer source is used for providing audio data from outside the audio process. sl@0: * sl@0: * The type of the actual 'physical' source can be for example a file or a socket or the sl@0: * data could also be generated. Nevertheless, the client (the MAudioDataSupplier) is responsible sl@0: * for reading the data and providing it to the audio process by filling the buffers received sl@0: * as a parameter with the callbacks in the MAudioDataSupplier interface. sl@0: */ sl@0: class MMMFBufferSource sl@0: { sl@0: public: sl@0: /** sl@0: * Initializes the source for using aSupplier as a data supplier. sl@0: * sl@0: * The source must be initialized before it is attached to a stream. sl@0: * sl@0: * @param aSupplier a reference to the data supplier which will provide the audio data by sl@0: * filling the buffers received with the callbacks. sl@0: * @return an error code. KErrNone if successful, otherwise one of the system wide error codes. sl@0: */ sl@0: virtual TInt SetDataSupplier(MMMFAudioDataSupplier& aSupplier)=0; sl@0: sl@0: /** sl@0: * Indicates that a buffer received from this buffer source has sl@0: * been filled with audio data. sl@0: * sl@0: * @param aBuffer the buffer that has been filled. sl@0: * @return an error code. KErrNone if successful, otherwise one of the system wide error codes. sl@0: */ sl@0: virtual TInt BufferFilled(CMMFBuffer* aBuffer)=0; sl@0: sl@0: /** sl@0: * Acknowledges the call to MMMFAudioDataSupplier::DiscardBuffers(). sl@0: * sl@0: * A DiscardBuffers() callback will be issued to MMMFAudioDataSupplier to request that any requested buffers have been discarded. sl@0: * This call acknowledges that the data supplier has stopped using the buffers, and returns their control to the framework proper sl@0: * sl@0: * @return an error code. KErrNone on success, otherwise one of the system wide error codes. sl@0: */ sl@0: virtual TInt BuffersDiscarded()=0; sl@0: sl@0: }; sl@0: sl@0: #endif // MBUFFERSOURCE_H