os/kernelhwsrv/kerneltest/e32test/multimedia/d_mmcsc.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32test\multimedia\d_mmcsc.h
sl@0
    15
// The interface to a device driver which creates a shared chunk - for use with the sound driver tests.
sl@0
    16
// This driver uses only generic kernel APIs and so need not be built from each variant.
sl@0
    17
// 
sl@0
    18
//
sl@0
    19
sl@0
    20
/**
sl@0
    21
 @file
sl@0
    22
 @internalComponent
sl@0
    23
 @test
sl@0
    24
*/
sl@0
    25
sl@0
    26
#if !defined(__D_MMCSC_H__)
sl@0
    27
#define __D_MMCSC_H__
sl@0
    28
sl@0
    29
#include <e32cmn.h>
sl@0
    30
#ifndef __KERNEL_MODE__
sl@0
    31
#include <e32std.h>
sl@0
    32
#endif
sl@0
    33
sl@0
    34
_LIT(KDevMmCScName,"MmCSc");
sl@0
    35
sl@0
    36
const TInt KMmCScBufSize=153600;	// 150K
sl@0
    37
const TInt KMmCScNumBuffers=8;
sl@0
    38
sl@0
    39
struct SBufSpecList
sl@0
    40
	{
sl@0
    41
	/** The first entry of the buffer offset list. This list holds the offset from the start of the chunk
sl@0
    42
	for each buffer. This list is only valid if the flag KScFlagBufOffsetListInUse is set in
sl@0
    43
	TSharedChunkBufConfigBase::iFlags. */
sl@0
    44
	TInt iBufferOffset;
sl@0
    45
	TInt iBufferId;
sl@0
    46
	};
sl@0
    47
sl@0
    48
class TMmSharedChunkBufConfig : public TSharedChunkBufConfigBase
sl@0
    49
	{
sl@0
    50
public:
sl@0
    51
	/** The buffer offset list. This holds the offset from the start of the chunk for each buffer. This list is
sl@0
    52
	only valid if the flag KScFlagBufOffsetListInUse is set in TSharedChunkBufConfigBase::iFlags. */
sl@0
    53
	struct SBufSpecList iSpec[KMmCScNumBuffers];
sl@0
    54
	};
sl@0
    55
sl@0
    56
class TCapsMmCScV01
sl@0
    57
	{
sl@0
    58
public:
sl@0
    59
	TVersion iVersion;
sl@0
    60
	};
sl@0
    61
sl@0
    62
class RMmCreateSc : public RBusLogicalChannel
sl@0
    63
	{
sl@0
    64
public:
sl@0
    65
	enum TControl
sl@0
    66
		{ EGetChunkHandle,EGetBufInfo };
sl@0
    67
#ifndef __KERNEL_MODE__
sl@0
    68
public:
sl@0
    69
	inline TInt Open()
sl@0
    70
		{ return DoCreate(KDevMmCScName,TVersion(0,1,1),KNullUnit,NULL,NULL,EOwnerThread);}
sl@0
    71
	inline TInt GetChunkHandle(RChunk& aChunk)
sl@0
    72
		{ return(aChunk.SetReturnedHandle(DoControl(EGetChunkHandle)));}
sl@0
    73
	inline TInt GetBufInfo(TDes8& aBufInfo)
sl@0
    74
		{ return(DoControl(EGetBufInfo,(TAny*)&aBufInfo));}
sl@0
    75
#endif
sl@0
    76
	};
sl@0
    77
sl@0
    78
#endif // __D_MMCSC_H__