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: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef MBUFFERSINK_H sl@0: #define MBUFFERSINK_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CMMFBuffer; sl@0: class MMMFAudioDataConsumer; sl@0: sl@0: /** sl@0: * Buffer sink is used for receiving the audio data in buffers outside the audio process. sl@0: * sl@0: * The type of the actual 'physical' sink can be for example a file or a socket or the sl@0: * data could also be simple analysed and then discarded. Nevertheless, the client sl@0: * (the MAudioDataConsumer) is responsible for writing the data to its final sink sl@0: * while reading it from the buffers received as a parameter with the callbacks in sl@0: * the MAudioDataConsumer interface. sl@0: */ sl@0: class MMMFBufferSink sl@0: { sl@0: public: sl@0: /** sl@0: * Initializes the sink for using aConsumer as a data consumer. sl@0: * sl@0: * The sink must be initialized before it is attahced to a stream. sl@0: * sl@0: * @param aConsumer a reference to the data consumer which will be responsible sl@0: * for reading the audio data from the buffers provided by this sink. sl@0: * @return an error code. KErrNone if successful, otherwise one of the system wide error codes. sl@0: */ sl@0: virtual TInt SetDataConsumer(MMMFAudioDataConsumer& aConsumer)=0; sl@0: sl@0: /** sl@0: * Indicates that the audio data has been read from a buffer received from this buffer sink. sl@0: * sl@0: * @param aBuffer the buffer that has been consumed. sl@0: * @return an error code. KErrNone if successful, otherwise one of the system wide error codes. sl@0: */ sl@0: virtual TInt BufferEmptied(CMMFBuffer* aBuffer)=0; sl@0: sl@0: /** sl@0: * Called by the client to acknowledgement the processing of DiscardBuffers() to indicate that sl@0: * control of any buffer previously passed to the client. sl@0: * (by BufferToBeEmptied()) returns 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: #endif // MBUFFERSINK_H