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