1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/a3facf/inc/mbuffersink.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +
1.21 +/**
1.22 + @file
1.23 + @publishedPartner
1.24 + @released
1.25 +*/
1.26 +
1.27 +#ifndef MBUFFERSINK_H
1.28 +#define MBUFFERSINK_H
1.29 +
1.30 +#include <a3f/a3fbase.h>
1.31 +#include <a3f/maudiodataconsumer.h>
1.32 +
1.33 +class CMMFBuffer;
1.34 +class MMMFAudioDataConsumer;
1.35 +
1.36 +/**
1.37 + * Buffer sink is used for receiving the audio data in buffers outside the audio process.
1.38 + *
1.39 + * The type of the actual 'physical' sink can be for example a file or a socket or the
1.40 + * data could also be simple analysed and then discarded. Nevertheless, the client
1.41 + * (the MAudioDataConsumer) is responsible for writing the data to its final sink
1.42 + * while reading it from the buffers received as a parameter with the callbacks in
1.43 + * the MAudioDataConsumer interface.
1.44 + */
1.45 +class MMMFBufferSink
1.46 + {
1.47 +public:
1.48 + /**
1.49 + * Initializes the sink for using aConsumer as a data consumer.
1.50 + *
1.51 + * The sink must be initialized before it is attahced to a stream.
1.52 + *
1.53 + * @param aConsumer a reference to the data consumer which will be responsible
1.54 + * for reading the audio data from the buffers provided by this sink.
1.55 + * @return an error code. KErrNone if successful, otherwise one of the system wide error codes.
1.56 + */
1.57 + virtual TInt SetDataConsumer(MMMFAudioDataConsumer& aConsumer)=0;
1.58 +
1.59 + /**
1.60 + * Indicates that the audio data has been read from a buffer received from this buffer sink.
1.61 + *
1.62 + * @param aBuffer the buffer that has been consumed.
1.63 + * @return an error code. KErrNone if successful, otherwise one of the system wide error codes.
1.64 + */
1.65 + virtual TInt BufferEmptied(CMMFBuffer* aBuffer)=0;
1.66 +
1.67 + /**
1.68 + * Called by the client to acknowledgement the processing of DiscardBuffers() to indicate that
1.69 + * control of any buffer previously passed to the client.
1.70 + * (by BufferToBeEmptied()) returns to the framework proper.
1.71 + *
1.72 + * @return an error code. KErrNone on success, otherwise one of the system wide error codes.
1.73 + */
1.74 + virtual TInt BuffersDiscarded()=0;
1.75 + };
1.76 +
1.77 +#endif // MBUFFERSINK_H