os/mm/mmhais/refacladapt/src/audiosink/buffersink.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 BUFFERSINK_H
    20 #define BUFFERSINK_H
    21 
    22 #include <e32base.h>
    23 #include <f32file.h>
    24 
    25 #include "minputport.h"
    26 
    27 #include <a3f/mbuffersink.h>
    28 #include <a3f/a3f_trace_utils.h>
    29 
    30 
    31 /////
    32 //  This is the implementation of CAudioSink API.
    33 //
    34 //  @see CAudioComponent
    35 ///
    36 NONSHARABLE_CLASS(CBufferSink) : public CBase,
    37 								 public MInputPort,
    38 								 public MMMFBufferSink
    39 	{
    40 public:
    41 
    42 	/////
    43 	// Create a new instance.
    44 	//
    45 	// @return CBufferSink* a pointer to the created instance.
    46 	///
    47 	IMPORT_C static CBufferSink* NewL();
    48 
    49 	/////
    50 	// Destructor.
    51 	//
    52 	// Deletes all objects and releases all resource owned by this instance.
    53 	///
    54 	virtual ~CBufferSink();
    55 
    56 	// from class MInputPort
    57 	TInt GetInputPort(MInputPort*& aInputPort);
    58 	virtual TInt EmptyBuffer(CMMFBuffer* aBuffer, MOutputPort* aSupplier);
    59 	virtual TInt BufferFilled(CMMFBuffer* aBuffer);
    60 	virtual TInt SetOutput(MOutputPort* aOutput);
    61 	virtual TInt RemoveOutput(MOutputPort* aOutput);
    62 
    63 	// from class MMFBufferSink
    64 	virtual TInt SetDataConsumer(MMMFAudioDataConsumer& aConsumer);
    65 	virtual TInt BufferEmptied(CMMFBuffer* aBuffer);
    66 	virtual TInt BuffersDiscarded();
    67 
    68 private:
    69 
    70 	void ConstructL();
    71 
    72 	CBufferSink();
    73 
    74 	MMMFAudioDataConsumer*	iConsumer;
    75 
    76 	MOutputPort*			iOutput;
    77 
    78 	CMMFBuffer*				iBuffer;
    79 	};
    80 
    81 #endif // BUFFERSINK_H