baseport/syborg/webcamera/webcamera_pdd.cpp
author Shimizu Satoshi <s_shimizu@isb.co.jp>
Mon, 18 Oct 2010 19:39:25 +0900
changeset 124 606eafc6d6a8
parent 52 0dfaca43d90e
permissions -rw-r--r--
Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     1
/*
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     2
* Copyright (c) 2010 ISB.
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     3
* All rights reserved.
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     8
*
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
     9
* Initial Contributors:
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    10
* ISB - initial contribution.
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    11
*
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    12
* Contributors:
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    13
*
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    14
* Description: USB driver for test
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    15
*
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    16
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    17
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    18
#ifndef __devicePDD_H__
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    19
#include "webcamera_pdd.h"
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    20
#endif
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    21
//#include <webcamera_driver.h>
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    22
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    23
#define DP(format...) Kern::Printf(format)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    24
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    25
//Name for PDD
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    26
_LIT(KWebcameraPddName,"WebcameraDevice.pdd");
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    27
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    28
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    29
DWebcameraPddFactory::DWebcameraPddFactory()
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    30
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    31
	DP("DWebcameraPddFactory::DWebcameraPddFactory()");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    32
	iVersion = TVersion(KCommsMajorVersionNumber, KCommsMinorVersionNumber, KCommsBuildVersionNumber);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    33
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    34
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    35
TInt DWebcameraPddFactory::Install()
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    36
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    37
	DP("DWebcameraPddFactory::Install");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    38
	return SetName(&KWebcameraPddName);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    39
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    40
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    41
void DWebcameraPddFactory::GetCaps(TDes8 &aDes) const
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    42
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    43
	DP("DWebcameraPddFactory::GetCaps start");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    44
	RWebcameraDevice::TCaps capsBuf;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    45
	capsBuf.iVersion = iVersion;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    46
	aDes.FillZ(aDes.MaxLength());
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    47
	TInt size = sizeof(capsBuf);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    48
	if (size>aDes.MaxLength())
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    49
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    50
		size=aDes.MaxLength();
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    51
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    52
	aDes.Copy((TUint8*)&capsBuf, size);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    53
	DP("DWebcameraPddFactory::GetCaps end");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    54
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    55
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    56
TInt DWebcameraPddFactory::Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion& aVer)
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    57
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    58
	DP("DWebcameraPddFactory::Create start");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    59
	DWebcameraDriver* pD = new DWebcameraDriver;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    60
	aChannel = pD;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    61
	TInt r = KErrNoMemory;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    62
	if (pD)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    63
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    64
		r = pD->DoCreate(aUnit,anInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    65
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    66
	DP("DWebcameraPddFactory::Create end");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    67
	return r;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    68
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    69
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    70
TInt DWebcameraPddFactory::Validate(TInt aUnit, const TDesC8* /*anInfo*/, const TVersion& aVer)
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    71
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    72
	DP("DWebcameraPddFactory::Validate start");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    73
	if ((!Kern::QueryVersionSupported(iVersion,aVer)) ||
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    74
		(!Kern::QueryVersionSupported(aVer, TVersion(KMinimumLddMajorVersion, KMinimumLddMinorVersion, KMinimumLddBuild))))
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    75
		{
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    76
		return KErrNotSupported;
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    77
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    78
	DP("DWebcameraPddFactory::Validate end");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    79
	return KErrNone;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    80
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    81
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    82
DWebcameraDriver::DWebcameraDriver()
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    83
{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    84
	DP("DWebcameraDriver::DWebcameraDriver start");
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    85
	DP("DWebcameraDriver::DWebcameraDriver end");
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    86
}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    87
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    88
DWebcameraDriver::~DWebcameraDriver()
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    89
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    90
	DP("DWebcameraDriver::~DWebcameraDriver start");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    91
	CloseChunk(EWEBCAMERAINDEXADATABUF);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    92
	Interrupt::Unbind(iIrq);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    93
	DP("DWebcameraDriver::~DWebcameraDriver end");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    94
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    95
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    96
TInt DWebcameraDriver::DoCreate(TInt aUnit, const TDesC8* anInfo)
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    97
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    98
	DP("DWebcameraDriver::DoCreate start");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
    99
	iPortAddr = KHwSVPWebcameraDevice;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   100
	iIrq = EIrqWebamera;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   101
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   102
	Interrupt::Bind(iIrq, Isr, this);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   103
	DP("DWebcameraDriver::DoCreate end");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   104
	return KErrNone;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   105
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   106
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   107
TInt DWebcameraDriver::PowerOn(TAny* aHeaderPtr)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   108
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   109
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   110
	iClient = &Kern::CurrentThread();
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   111
	((DObject*)iClient)->Open();
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   112
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   113
	TInt ret = CreateChunk(sizeof(iDataInfo), EWEBCAMERAINDEXHAHEADERBUF);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   114
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_INFO, iPhysAddr[EWEBCAMERAINDEXHAHEADERBUF]);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   115
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_INFOSIZE, sizeof(iDataInfo));
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   116
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_CONNECT,0x0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   117
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   118
	kumemget(&iDataInfo, iChunk[EWEBCAMERAINDEXHAHEADERBUF]->Base(), sizeof(TWebcameraDataInfo));
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   119
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   120
	//Process(Transaction) that parse iDataInfo.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   121
	DWebCameraDescribe* bDescribe;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   122
	bDescribe = new DWebCameraDescribe;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   123
	iUvcData = bDescribe->ParseDataInfo(iDataInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   124
	delete bDescribe;
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   125
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   126
	//Store bUVC in TAny* aHeaderPtr.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   127
	kumemget(aHeaderPtr, &iUvcData, sizeof(TWebcameraUVC));
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   128
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   129
	CloseChunk(EWEBCAMERAINDEXHAHEADERBUF);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   130
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   131
	return ret;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   132
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   133
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   134
TInt DWebcameraDriver::InitViewFinder()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   135
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   136
	TInt ret = KErrNone;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   137
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   138
	iClient = &Kern::CurrentThread();
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   139
	((DObject*)iClient)->Open();
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   140
	ret = CreateChunk(BUFSIZE, EWEBCAMERAINDEXADATABUF);
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   141
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   142
	return ret;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   143
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   144
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   145
TInt DWebcameraDriver::StartViewerFinder(TAny* aDataPtr, TInt aSize)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   146
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   147
	iType = 0;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   148
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   149
	WriteReg(iPortAddr, WEBCAMERA_REG_DATA_TYPE, 0x0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   150
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_ADDR, iPhysAddr[EWEBCAMERAINDEXADATABUF]);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   151
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_SIZE, aSize);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   152
	WriteReg(iPortAddr, WEBCAMERA_REG_INT_ENABLE, 0x1);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   153
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   154
	kumemget(aDataPtr, iChunk[EWEBCAMERAINDEXADATABUF]->Base(), aSize);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   155
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   156
	Interrupt::Enable(iIrq);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   157
	return KErrNone;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   158
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   159
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   160
void DWebcameraDriver::Stop(TUSBStopMode aMode)
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   161
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   162
	WriteReg(iPortAddr, WEBCAMERA_REG_INT_ENABLE, 0x0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   163
	Interrupt::Disable(iIrq);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   164
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   165
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   166
void DWebcameraDriver::Disconnect()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   167
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   168
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_DISCONNECT, 0x0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   169
	Interrupt::Disable(iIrq);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   170
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   171
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   172
void DWebcameraDriver::Isr(TAny* aPtr)
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   173
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   174
	((DWebcameraDriver*)aPtr)->receivedatacallback();
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   175
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   176
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   177
void DWebcameraDriver::receivedatacallback()
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   178
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   179
	TInt datasize = ReadReg(iPortAddr, WEBCAMERA_REG_DMA_SIZE);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   180
	switch (iType)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   181
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   182
		case 0:
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   183
			iLdd->GetOneFlameComplete(datasize);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   184
			break;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   185
		default:
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   186
			DP("receivedatacallback error");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   187
			break;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   188
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   189
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_ADDR, 0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   190
	WriteReg(iPortAddr, WEBCAMERA_REG_DMA_SIZE, 0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   191
	WriteReg(iPortAddr, WEBCAMERA_REG_INT_ENABLE, 0x0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   192
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   193
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   194
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   195
Chunk that used between PDD and USB.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   196
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   197
TInt DWebcameraDriver::CreateChunk(TInt aSize, TWebcameraIndex aIndex)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   198
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   199
	TLinAddr wChunkLinAddr;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   200
	TUint32 wChunkMappingAttr;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   201
	RWebcameraDevice::TChunkInfo chunkInfo;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   202
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   203
	TChunkCreateInfo info;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   204
	info.iType			= TChunkCreateInfo::ESharedKernelMultiple;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   205
	info.iMaxSize		= aSize;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   206
	info.iMapAttr		= EMapAttrFullyBlocking;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   207
	info.iOwnsMemory	= ETrue;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   208
	info.iDestroyedDfc	= NULL;
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   209
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   210
//Chunk Create
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   211
	iChunk[aIndex] = NULL;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   212
	iPhysAddr[aIndex] = 0x0;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   213
	TInt ret = Kern::ChunkCreate(info, iChunk[aIndex], wChunkLinAddr, wChunkMappingAttr);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   214
	if (ret != KErrNone)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   215
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   216
		DP("Kern::ChunkCreate Err = %d",ret);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   217
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   218
	ret = Kern::ChunkCommitContiguous(iChunk[aIndex], 0, aSize, iPhysAddr[aIndex]);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   219
	if (ret != KErrNone)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   220
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   221
		DP("Kern::ChunkCommitContiguous Err = %d",ret);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   222
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   223
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   224
//Chunk Open
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   225
	// Make handle to chunifo for current thread
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   226
	ret = Kern::MakeHandleAndOpen(iClient, iChunk[aIndex]);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   227
	if (ret >= 0) 
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   228
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   229
		chunkInfo.iChunkHandle = ret;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   230
		ret = KErrNone;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   231
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   232
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   233
	if (ret != KErrNone)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   234
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   235
		memclr(&chunkInfo, sizeof(chunkInfo));
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   236
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   237
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   238
	TInt result = Kern::ThreadRawWrite(iClient, &info, &chunkInfo, sizeof(chunkInfo), 0);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   239
	if (result != KErrNone)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   240
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   241
		DP("Kern::ChunkCommitContiguous Err = %d",result);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   242
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   243
	return KErrNone;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   244
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   245
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   246
void DWebcameraDriver::CloseChunk(TWebcameraIndex aIndex)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   247
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   248
	Kern::ChunkClose(iChunk[aIndex]);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   249
	Kern::SafeClose((DObject*&)iClient, NULL);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   250
	}
52
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   251
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   252
DECLARE_STANDARD_PDD()
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   253
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   254
	DP("DECLARE_STANDARD_PDD()");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   255
	return new DWebcameraPddFactory;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 52
diff changeset
   256
	}