os/mm/mmhais/refacladapt/src/audiosource/buffersource.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 #ifndef BUFFERSOURCE_H
    20 #define BUFFERSOURCE_H
    21 
    22 #include <e32base.h>
    23 #include <f32file.h>
    24 #include <a3f/mbuffersource.h>
    25 
    26 #include "moutputport.h"
    27 #include "mstreambuffercontrol.h"
    28 
    29 #include <a3f/a3f_trace_utils.h>
    30 
    31 
    32 /////
    33  // This is the implementation of CAudioSource API.
    34  //
    35  // @see CAudioComponent.
    36  ///
    37 NONSHARABLE_CLASS(CBufferSource) : 	public CActive,
    38 									public MMMFBufferSource,		// A3F interface
    39 									public MOutputPort			// Adaptation interface
    40 
    41 	{
    42 public:
    43 
    44 	IMPORT_C static CBufferSource* NewL();
    45 	/////
    46 	// Destructor.
    47 	//
    48 	// Deletes all objects and releases all resource owned by this instance.
    49 	///
    50 	virtual ~CBufferSource();
    51 
    52 	// from MMMFBufferSource
    53 	TInt SetDataSupplier(MMMFAudioDataSupplier& aSupplier);
    54 	TInt BufferFilled(CMMFBuffer* aBuffer);
    55 	TInt BuffersDiscarded();
    56 
    57 	// from class MOutputPort
    58 	TInt GetOutputPort(MOutputPort*& aOutputPort);
    59 	TInt FillBuffer(CMMFBuffer* aBuffer, MInputPort* aConsumer);
    60 	TInt BufferEmptied(CMMFBuffer* aBuffer);
    61 	TInt SetInput(MInputPort* aInput);
    62 	TInt RemoveInput(MInputPort* aInput);
    63 	TInt FlushBuffer(MFlushHandlerObserver* aFlushObserver);
    64 private:
    65 
    66 	void ConstructL();
    67 
    68 	CBufferSource();
    69 
    70 	void DoCancel();
    71 
    72 	void RunL();
    73 
    74 private:
    75 	MFlushHandlerObserver* iObserver;
    76 
    77 	MMMFAudioDataSupplier* iSupplier;
    78 
    79 	MInputPort* iInput;
    80 
    81 	CMMFBuffer* iBuffer;
    82 	};
    83 
    84 #endif // BUFFERSOURCE_H