baseport/syborg/webcamera/webcamera_ldd.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
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    18
#include <kern_priv.h>
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_ldd.h"
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    20
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    21
#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
    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
_LIT(KDriver1PanicCategory,"WebcameraDevice");
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
/**
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
    26
Create Logic device.
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
    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
DECLARE_STANDARD_LDD()
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
	{
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
	DP("DECLARE_STANDARD_LDD()");
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
	return new DWebcameraLogicalDevice;
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
    32
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    33
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
/**
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
    35
Constructor
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
    36
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    37
DWebcameraLogicalDevice::DWebcameraLogicalDevice()
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    38
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    39
	DP("DWebcameraLogicalDevice()");
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
    40
	// Set version number for this device
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
    41
	iVersion = RWebcameraDevice::VersionRequired();
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
	// Indicate that we work with a 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
    43
	iParseMask = KDeviceAllowPhysicalDevice;
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
    44
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    45
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    46
/**
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
    47
Destructor
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
    48
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    49
DWebcameraLogicalDevice::~DWebcameraLogicalDevice()
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    50
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    51
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    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
    53
/**
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
    54
Second stage constructor for DDriver1Factory.
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
    55
This must at least set a name for the driver object.
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
    56
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
@return KErrNone if successful, otherwise one of the other system wide error codes.
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
    58
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    59
TInt DWebcameraLogicalDevice::Install()
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    60
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    61
	DP("DWebcameraLogicalDevice::Install()");
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    62
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    63
	return SetName(&RWebcameraDevice::Name());
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    64
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    65
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    66
/**
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
    67
Return the drivers capabilities.
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
Called in the response to an RDevice::GetCaps() request.
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
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
    70
@param aDes User-side descriptor to write capabilities information into
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
    71
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    72
void DWebcameraLogicalDevice::GetCaps(TDes8& aDes) const
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    73
	{
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
    74
	// Create a capabilities object
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
    75
	RWebcameraDevice::TCaps caps;
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
    76
	caps.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
    77
	// Write it back to user memory
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
	Kern::InfoCopy(aDes, (TUint8*)&caps, sizeof(caps));
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
    79
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    80
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
/**
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
    82
Called by the kernel's device driver framework to create a Logical Channel.
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
    83
This is called in the context of the user thread (client) which requested the creation of a Logical Channel
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
    84
(E.g. through a call to RBusLogicalChannel::DoCreate)
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
    85
The thread is in a critical section.
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
    86
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
    87
@param aChannel Set to point to the created Logical Channel
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
    88
@return KErrNone if successful, otherwise one of the other system wide error codes.
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
    89
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    90
TInt DWebcameraLogicalDevice::Create(DLogicalChannelBase*& aChannel)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    91
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
    92
	DP("DWebcameraLogicalDevice::Create() 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
    93
	aChannel = new DWebcameraLogicalChannel;
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
    94
	if (!aChannel)
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
    95
		{
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
    96
		return KErrNoMemory;
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("DWebcameraLogicalDevice::Create() end");
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
    99
	return KErrNone;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   100
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   101
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   102
/**
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
   103
Constructor
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
   104
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   105
DWebcameraLogicalChannel::DWebcameraLogicalChannel()
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
   106
	: iReceiveDataDfc(GetFlameDfc, this, 1)
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
	, iCaptureDfc(CaptureDfc, this, 1)
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
   108
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   109
	DP("DWebcameraLogicalChannel::DWebcameraLogicalChannel() 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
   110
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
   111
	// Get pointer to client threads DThread object
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
	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
   113
	// Open a reference on client thread so it's control block can't dissapear until
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
	// this driver has finished with it.
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
   115
	((DObject*)iClient)->Open();
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
   116
	iWebCameraState = RWebcameraDevice::EPowerOff;
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
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
   118
	DP("DWebcameraLogicalChannel::DWebcameraLogicalChannel() 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
   119
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   120
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   121
/**
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
   122
Destructor
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
   123
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   124
DWebcameraLogicalChannel::~DWebcameraLogicalChannel()
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
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   126
	DP("DWebcameraLogicalChannel::~DWebcameraLogicalChannel() start");
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
   127
	// Cancel all processing that we may be doing
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
	DoCancel(RWebcameraDevice::EAllRequests);
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
	// Close sharedchunks
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
	CloseSharedChunks();
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
	// Close our reference on the client 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
   132
	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
   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
	delete iConvert;
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
	// Buffer Free.
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
	Kern::Free(iHeaderPtr);
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
	Kern::Free(iDataPtr);
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
	Kern::Free(iBmpBuf);
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
   140
	DP("DWebcameraLogicalChannel::~DWebcameraLogicalChannel() 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
   141
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   142
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   143
/**
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
   144
Called when a user thread requests a handle to this channel.
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
   145
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   146
TInt DWebcameraLogicalChannel::RequestUserHandle(DThread* aThread, TOwnerType aType)
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
   147
	{
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
	// Make sure that only our client can get a handle
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
	if (aType != EOwnerThread || aThread != iClient)
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
		{
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
		return KErrAccessDenied;
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
		}
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
	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
   154
	}
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
   155
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   156
/**
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
   157
Second stage constructor called by the kernel's device driver framework.
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
This is called in the context of the user thread (client) which requested the creation of a Logical Channel
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
   159
(E.g. through a call to RBusLogicalChannel::DoCreate)
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
   160
The thread is in a critical section.
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
   161
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
   162
@param aUnit The unit argument supplied by the client
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
@param aInfo The info argument supplied by the client
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
@param aVer The version argument supplied by the client
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
   165
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
   166
@return KErrNone if successful, otherwise one of the other system wide error codes.
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
   167
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   168
TInt DWebcameraLogicalChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& aVer)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   169
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   170
	DP("DWebcameraLogicalChannel::DoCreate() start");
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
   171
	if (!Kern::CurrentThreadHasCapability(ECapability_None, __PLATSEC_DIAGNOSTIC_STRING("Checked by Webcamera")))
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
   172
		{
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
		return KErrPermissionDenied;
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
		}
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
	// Check version
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
   176
	if (!Kern::QueryVersionSupported(RWebcameraDevice::VersionRequired(), aVer))
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
   177
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   178
		return KErrNotSupported;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   179
		}
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
   180
	// Setup LDD for receiving client messages
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
   181
	SetDfcQ(Kern::DfcQue0());
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   182
	iMsgQ.Receive();
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
   183
	//Associate DFCs with the same queue we set above to receive client messages on
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
   184
	iReceiveDataDfc.SetDfcQ(iDfcQ);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   185
	iCaptureDfc.SetDfcQ(iDfcQ);
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
   186
	//Give PDD a pointer to this channel
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
	Pdd()->iLdd = 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
   188
	// Create shared chunk.
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
	TInt rtn = CreatSharedChunks();
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
	if (rtn)
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
   191
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   192
		return rtn;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   193
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   194
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   195
	DP("DWebcameraLogicalChannel::DoCreate() 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
   196
	return KErrNone;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   197
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   198
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   199
/**
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
   200
Process a message for this logical channel.
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
This function is called in the context of a DFC thread.
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
   202
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
   203
@param aMessage	The message to process.
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
				The iValue member of this distinguishes the message type:
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
				iValue==ECloseMsg, channel close message
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
				iValue==KMaxTInt, a 'DoCancel' message
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
				iValue>=0, a 'DoControl' message with function number equal to iValue
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
				iValue<0, a 'DoRequest' message with function number equal to ~iValue
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
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   210
void DWebcameraLogicalChannel::HandleMsg(TMessageBase* aMsg)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   211
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   212
	DP("DWebcameraLogicalChannel::HandleMsg() start");
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
   213
	TThreadMessage& m = *(TThreadMessage*)aMsg;
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
   214
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
   215
	// Get message type
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
	TInt id = m.iValue;
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
	DP("id=%d",id);
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
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
	// Decode the message type and dispatch it to the relevent handler function...
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
	if (id == (TInt)ECloseMsg)
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
   221
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   222
		DoCancel(RWebcameraDevice::EAllRequests);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   223
		m.Complete(KErrNone, EFalse);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   224
		return;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   225
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   226
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
   227
	if (m.Client() != iClient)
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
   228
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   229
		Kern::ThreadKill(m.Client(),
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   230
						 EExitPanic,
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   231
						 ERequestFromWrongThread,
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   232
						 KDriver1PanicCategory);
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
   233
		m.Complete(KErrNone, 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
   234
		return;
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
		}
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
	if (id == KMaxTInt)
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
		{
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
		DoCancel(m.Int0());
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
		m.Complete(KErrNone, ETrue);
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
   241
		return;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   242
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   243
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
   244
	if (id < 0)
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
   245
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   246
		// DoRequest
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
   247
		TRequestStatus* pS = (TRequestStatus*)m.Ptr0();
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
		TInt rtn = DoRequest(~id, pS, m.Ptr1(), aMsg);
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
   249
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   250
		if (rtn != KErrNone)
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
   251
			{
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
   252
			Kern::RequestComplete(iClient, pS, rtn);
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
		m.Complete(KErrNone, ETrue);
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
   255
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   256
	else
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   257
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   258
		// DoControl
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
   259
		TInt rtn = DoControl(id, m.Ptr0(), aMsg);
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
   260
		m.Complete(rtn, ETrue);
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
   261
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   262
	DP("DWebcameraLogicalChannel::HandleMsg() 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
   263
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   264
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   265
/**
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
   266
Process synchronous 'control' requests
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
   267
*/
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
   268
TInt DWebcameraLogicalChannel::DoControl(TInt aFunction, TAny* a1, TAny* /*a2*/)
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
   269
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   270
	DP("DWebcameraLogicalChannel::DoControl() 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
   271
	TInt rtn;
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
   272
	rtn = KErrNone;
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
   273
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   274
	switch (aFunction)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   275
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   276
		case RWebcameraDevice::EGetConfig:
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   277
//			rtn = GetConfig((TDes8*)a1);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   278
			rtn = KErrNone;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   279
			break;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   280
        case RWebcameraDevice::ESetConfig:
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
   281
//			rtn = SetConfig((const TDesC8*)a1);
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
   282
			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
   283
		case RWebcameraDevice::EOpenSharedChunck:
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
   284
			rtn=OpenSharedChunks((RWebcameraDevice::TChunkInfo*)a1);
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
   285
			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
   286
		case RWebcameraDevice::EInitViewFinder:
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
   287
			rtn = Pdd()->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
   288
			iDataPtr = Kern::Alloc(BUFSIZE);
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
   289
			iBmpBuf = (TUint8*)Kern::Alloc(BITMAPBUFSIZE);
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
   290
			break;
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
   291
		default:
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   292
			rtn = KErrNotSupported;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   293
			break;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   294
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   295
	DP("DWebcameraLogicalChannel::DoControl() 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
   296
	return rtn;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   297
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   298
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   299
/**
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
   300
Process asynchronous requests.
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
   301
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   302
TInt DWebcameraLogicalChannel::DoRequest(TInt aReqNo,
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   303
											TRequestStatus* aStatus,
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   304
											TAny* a1,
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
   305
											TAny* /*a2*/)
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
   306
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   307
	TInt rtn;
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
   308
	iRequesting = 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
   309
	rtn = KErrNone;
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
   310
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
   311
	switch (aReqNo)
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
   312
		{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   313
		case RWebcameraDevice::EStart:
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   314
			iReceiveDataStatus = aStatus;
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
   315
			iReceiving = 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
   316
			iWebCameraState = RWebcameraDevice::EStart;
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
   317
			iReceiveDataDfc.Add();
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
   318
			// Example Platform Security capability check which tests the
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
   319
			// client for ECapability_None (which always passes)...
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
   320
			if (iRequesting == EFalse)
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
   321
				{
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
   322
				iReceiving = EFalse;
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
   323
				Kern::RequestComplete(iClient,
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
   324
									  iReceiveDataStatus,
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
   325
									  iReceiveDataResult);
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
   326
				}
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
   327
			else
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
   328
				{
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
   329
				iReceiveDataDescriptor = (TInt*)a1;
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
   330
				}
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
   331
			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
   332
		case RWebcameraDevice::ECapture:
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
   333
			iCaptureStatus = aStatus;
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
   334
			iWebCameraState = RWebcameraDevice::ECapture;
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
   335
			iCaptureDfc.Add();
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
   336
			if (iRequesting == EFalse)
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
   337
				{
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
   338
				Kern::RequestComplete(iClient, iCaptureStatus, iCaptureResult);
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
   339
				}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   340
			else
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   341
				{
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
   342
		        iCaptureDescriptor=(TInt*)a1;
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
   343
				}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   344
			break;
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
   345
		case RWebcameraDevice::EPowerOn:
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
   346
			if (iPowerOn == EFalse)
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
   347
				{
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
   348
				iPowerOn = 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
   349
				iWebCameraState = RWebcameraDevice::EPowerOn;
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
   350
				iHeaderPtr = Kern::Alloc(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
   351
				rtn = Pdd()->PowerOn(iHeaderPtr);
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
   352
				Kern::RequestComplete(iClient, aStatus, rtn);
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
   353
				}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   354
			else
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   355
				{
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
   356
				Kern::RequestComplete(iClient, aStatus, KErrAlreadyExists);
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
   357
				}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   358
			break;
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
   359
		case RWebcameraDevice::EPowerOff:
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
   360
			Pdd()->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
   361
			iPowerOn = EFalse;
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
   362
			iReceiving = EFalse;
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
   363
			iReceiveDataDfc.Cancel();
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
   364
			iCaptureDfc.Cancel();
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
   365
			iWebCameraState = RWebcameraDevice::EPowerOff;
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
   366
			Kern::RequestComplete(iClient, aStatus, rtn);
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
   367
			break;
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
   368
		default:
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
   369
			rtn = KErrNotSupported;
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
   370
			Kern::RequestComplete(iClient, aStatus, rtn);
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
   371
			break;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   372
		}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   373
	iRequesting = EFalse;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   374
	return rtn;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   375
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   376
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   377
/**
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
   378
Process cancelling of asynchronous requests.
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
   379
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   380
void DWebcameraLogicalChannel::DoCancel(TUint aMask)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   381
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   382
	DP("DWebcameraLogicalChannel::DoCancel() 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
   383
	DP("aMask=%d",aMask);
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
   384
	if (aMask & (1 << RWebcameraDevice::EStart))
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
   385
		{
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
   386
		DP("RWebcameraDevice::EStart=%d",RWebcameraDevice::EStart);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   387
		if (iReceiveDataStatus)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   388
			{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   389
			DP("iReceiveDataStatus=%d",iReceiveDataStatus);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   390
			Pdd()->Stop(DWebcameraDriverBase::USB_cancel);
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
   391
			iReceiving = EFalse;
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
   392
			iReceiveDataDfc.Cancel();
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
   393
			Kern::RequestComplete(iClient, iReceiveDataStatus, KErrCancel);
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
   394
			}
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
   395
		}
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
   396
	if (aMask&(1<<RWebcameraDevice::ECapture))
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
   397
		{
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
   398
		DP("RWebcameraDevice::ECapture=%d",RWebcameraDevice::ECapture);
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   399
		if (iCaptureStatus)
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   400
			{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   401
			iCaptureDfc.Cancel();
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
   402
			Kern::RequestComplete(iClient, iCaptureStatus, KErrCancel);
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
   403
			}
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
   404
		}
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
   405
	DP("DWebcameraLogicalChannel::DoCancel() 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
   406
	}
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   407
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   408
/**
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
   409
Called by PDD from ISR to indicate that a ReceiveData operation has completed.
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
   410
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   411
void DWebcameraLogicalChannel::GetOneFlameComplete(TInt aDataSize)
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
   412
	{
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
   413
	iSaveSize = iSize - aDataSize;
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
   414
	// Queue DFC
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
   415
	iWebCameraState = RWebcameraDevice::ETransferData;
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
   416
	iReceiveDataDfc.Add();
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
   417
	//set size of received data
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
   418
	if (iSaveSize > 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
   419
		{
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
   420
		iReceiveDataResult = 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
   421
		}
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
   422
	else
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
   423
		{
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
   424
		iReceiveDataResult = KErrUnknown; //TODO:define of 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
   425
		}
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
   426
	}
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
   427
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
   428
void DWebcameraLogicalChannel::DoStartViewFinder()
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
   429
	{
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
   430
	TInt rtn = Pdd()->StartViewerFinder(iDataPtr, BUFSIZE);
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
   431
	if (rtn != 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
   432
		{
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
   433
		DP("rtn=%d",rtn);
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
   434
		iReceiving = EFalse;
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
   435
		Kern::RequestComplete(iClient, iReceiveDataStatus, rtn);
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
   436
		}
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
   437
	}
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
   438
/**
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
   439
DFC Callback which gets triggered after the PDD has signalled that getting oneflame completed.
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
   440
This just casts aPtr and calls DoGetOneFlameComplete().
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
   441
*/
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
   442
void DWebcameraLogicalChannel::GetFlameDfc(TAny* aPtr)
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
   443
	{
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
   444
	switch (((DWebcameraLogicalChannel*)aPtr)->iWebCameraState)
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
   445
		{
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
   446
	case RWebcameraDevice::EStart:
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
   447
		((DWebcameraLogicalChannel*)aPtr)->DoStartViewFinder();
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
   448
		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
   449
	case RWebcameraDevice::ETransferData:
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
   450
		((DWebcameraLogicalChannel*)aPtr)->DoGetOneFlameComplete();
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
   451
		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
   452
	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
   453
		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
   454
		}
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
   455
	}
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
   456
/**
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
   457
DFC Callback
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
   458
gets Capture image completed.
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
   459
This just casts aPtr and calls DoCaptureComplete().
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
   460
*/
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
   461
void DWebcameraLogicalChannel::CaptureDfc(TAny* aPtr)
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
   462
	{
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
   463
	DP("DWebcameraLogicalChannel::CaptureDfc() 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
   464
	((DWebcameraLogicalChannel*)aPtr)->DoCaptureComplete();
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
   465
	DP("DWebcameraLogicalChannel::CaptureDfc() 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
   466
	}
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
   467
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   468
/**
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
   469
Called from a DFC after the PDD has signalled that getting oneflame completed.
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
   470
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   471
void DWebcameraLogicalChannel::DoGetOneFlameComplete()
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
   472
	{
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
   473
	if (!iConvert)
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
   474
		{
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
   475
		iConvert = new DWebCameraConvert((TWebcameraUVC*)iHeaderPtr);
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
   476
		}
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
   477
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
   478
	iConvert->ConvertData((TUint8*)iDataPtr, iBmpBuf);
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
   479
	kumemget((TAny*)(iChunkLinAddr), iBmpBuf, iSaveSize);
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
   480
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
   481
	TInt result = Kern::ThreadRawWrite(iClient, iReceiveDataDescriptor, &iSaveSize,sizeof(TInt), 0);
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
   482
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
   483
	// Finished with client descriptor, so NULL it to help detect coding errors
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
   484
	iReceiveDataDescriptor = 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
   485
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
   486
	// Use result code from PDD if it was an 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
   487
	if(iReceiveDataResult != 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
   488
		{
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
   489
		result = iReceiveDataResult;
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
   490
		}
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
   491
	// Complete clients request
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
   492
	Kern::RequestComplete(iClient, iReceiveDataStatus, 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
   493
	}
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
   494
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   495
/**
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
   496
Called from a DFC after the PDD has signalled that getting Capture image completed.
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
   497
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   498
void DWebcameraLogicalChannel::DoCaptureComplete()
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
   499
	{
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
   500
	DP("DWebcameraLogicalChannel::DoCaptureComplete() start");
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
   501
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
   502
	TInt result = Kern::ThreadRawWrite(iClient, iCaptureDescriptor, &iSaveSize, sizeof(TInt), 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
   503
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
   504
	// Finished with client descriptor, so NULL it to help detect coding errors
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
   505
	iCaptureDescriptor = 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
   506
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
   507
	// Use result code from PDD if it was an 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
   508
	if(iCaptureResult != 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
   509
		{
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
   510
		result = iCaptureResult;
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
   511
		}
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
   512
	// Complete clients request
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
   513
	Kern::RequestComplete(iClient, iCaptureStatus, result);
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
   514
	DP("DWebcameraLogicalChannel::DoCaptureComplete() end");
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
   515
	}
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
   516
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   517
/**
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
   518
Process a GetConfig control message. This writes the current driver configuration to a
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
   519
RWebcameraDevice::TConfigBuf supplied by the client.
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
   520
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   521
TInt DWebcameraLogicalChannel::GetConfig(TDes8* aConfigBuf)
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
   522
	{
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
   523
	//unsupported
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
   524
	return KErrNotSupported;
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
   525
	}
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
   526
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   527
/**
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
   528
Process a SetConfig control message. This sets the driver configuration using a
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
   529
RWebcameraDevice::TConfigBuf supplied by the client.
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
   530
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   531
TInt DWebcameraLogicalChannel::SetConfig(const TDesC8* aConfigBuf)
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
   532
	{
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
   533
	//unsupported
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
   534
	return KErrNotSupported;
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
   535
	}
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
   536
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   537
/**
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
   538
Fill a TConfig with the drivers current configuration.
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
   539
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   540
/*void DWebcameraLogicalChannel::CurrentConfig(RWebcameraDevice::TConfig& aConfig)
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
   541
	{
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
   542
	//unsupported
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
   543
	}
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
   544
*/
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   545
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
   546
TInt DWebcameraLogicalChannel::CreatSharedChunks()
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
   547
	{
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
   548
	DP("DWebcameraLogicalChannel::CreatSharedChunks() 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
   549
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
   550
	iChunk=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
   551
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
   552
	NKern::ThreadEnterCS();
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
   553
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
   554
	iSize = Kern::RoundToPageSize(BITMAPBUFSIZE);
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
   555
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
   556
	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
   557
	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
   558
	info.iMaxSize		= iSize;
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
   559
	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
   560
	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
   561
	info.iDestroyedDfc	= 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
   562
	TInt r = Kern::ChunkCreate(info, iChunk, iChunkLinAddr, iChunkMappingAttr);
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
   563
	if (r != 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
   564
		{
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
   565
		NKern::ThreadLeaveCS();
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
   566
		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
   567
		}
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
   568
	iPhysAddr = 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
   569
	r = Kern::ChunkCommitContiguous(iChunk, 0, iSize, iPhysAddr);
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
   570
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
   571
	if (r != 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
   572
		{
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
   573
		Kern::ChunkClose(iChunk);
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
   574
		NKern::ThreadLeaveCS();
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
   575
		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
   576
		}
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
   577
	NKern::ThreadLeaveCS();
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
   578
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
   579
	DP("DWebcameraLogicalChannel::CreatSharedChunks() 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
   580
	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
   581
	}
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
   582
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
   583
TInt DWebcameraLogicalChannel::OpenSharedChunks(RWebcameraDevice::TChunkInfo* aChunkInfo)
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
   584
	{
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
   585
	DP("DWebcameraLogicalChannel::OpenSharedChunks() 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
   586
	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
   587
	NKern::ThreadEnterCS();
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
   588
	// 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
   589
	TInt r = Kern::MakeHandleAndOpen(iClient, iChunk);
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
   590
	if (r >= 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
   591
		{
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
   592
		chunkInfo.iChunkHandle = 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
   593
		r = 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
   594
		}
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
   595
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
   596
	NKern::ThreadLeaveCS();
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
   597
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
   598
	if (r != 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
   599
		{
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
   600
		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
   601
		}
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
   602
	TInt result = Kern::ThreadRawWrite(iClient, aChunkInfo, &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
   603
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
   604
	DP("DWebcameraLogicalChannel::OpenSharedChunks() 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
   605
	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
   606
	}
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
   607
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
   608
void DWebcameraLogicalChannel::ChunkDestroyed()
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
   609
	{
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
   610
	DP("DWebcameraLogicalChannel::ChunkDestroyed() 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
   611
	//unsupported
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
   612
	DP("DWebcameraLogicalChannel::ChunkDestroyed() 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
   613
	}
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
   614
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
   615
void DWebcameraLogicalChannel::CloseSharedChunks()
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
   616
	{
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
   617
	DP("DWebcameraLogicalChannel::CloseSharedChunks() 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
   618
	if (iChunk)
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
   619
		{
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
   620
		Kern::ChunkClose(iChunk);
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
   621
		}
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
   622
	DP("DWebcameraLogicalChannel::CloseSharedChunks() 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
   623
	}
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
   624
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
   625
/**
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
   626
Get the point to Physical channel.
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
   627
 */
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   628
DWebcameraDriverBase* DWebcameraLogicalChannel::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
   629
	{
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   630
	DP("DWebcameraLogicalChannel::Pdd() 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
   631
	return (DWebcameraDriverBase*)iPdd;
0dfaca43d90e Added web camera drivers and QEMU plug-in for obtaining and transferring dummy data.
Masaki Hosaka <hosaka@isb.co.jp>
parents:
diff changeset
   632
	}