baseport/syborg/webcamera/webcamera_uvc.cpp
author Shimizu Satoshi <s_shimizu@isb.co.jp>
Mon, 18 Oct 2010 19:39:25 +0900
changeset 124 606eafc6d6a8
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:
124
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     1
/*
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     2
* Copyright (c) 2010 ISB.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     3
* All rights reserved.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     8
*
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
     9
* Initial Contributors:
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    10
* ISB - initial contribution.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    11
*
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    12
* Contributors:
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    13
*
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    14
* Description: USB driver for test
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    15
*
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    16
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    17
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    18
#ifndef WEBCAMERA_UVC_H_
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    19
#include "webcamera_uvc.h"
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    20
#endif
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    21
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    22
#define DP(format...) Kern::Printf(format)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    23
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    24
//Describe UVC base.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    25
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    26
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    27
Constructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    28
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    29
DWebCameraUVCDescriptor::DWebCameraUVCDescriptor()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    30
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    31
	DP("DWebcameraUVCDescriptor::DWebcameraUVCDescriptor construct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    32
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    33
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    34
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    35
Destructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    36
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    37
DWebCameraUVCDescriptor::~DWebCameraUVCDescriptor()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    38
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    39
	DP("DWebcameraUVCDescriptor::DWebcameraUVCDescriptor destruct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    40
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    41
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    42
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    43
Describe UVC Descriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    44
@param		aDataInfo		[in]				DataInfo from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    45
@return		bDescriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    46
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    47
TWebcameraUVCDescriptor DWebCameraUVCDescriptor::DescribeDescriptor(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    48
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    49
	TWebcameraUVCDescriptor bDescriptor;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    50
	return bDescriptor;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    51
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    52
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    53
//Describe UVC descriptor YUY2 class.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    54
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    55
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    56
Constructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    57
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    58
DWebCameraUVCDescribeDescriptorYUY2::DWebCameraUVCDescribeDescriptorYUY2()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    59
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    60
	DP("DWebCameraUVCDescribeDescriptorYUY2::DWebCameraUVCDescribeDescriptorYUY2 construct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    61
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    62
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    63
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    64
Destructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    65
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    66
DWebCameraUVCDescribeDescriptorYUY2::~DWebCameraUVCDescribeDescriptorYUY2()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    67
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    68
	DP("DWebCameraUVCDescribeDescriptorYUY2::DWebCameraUVCDescribeDescriptorYUY2 destruct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    69
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    70
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    71
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    72
Describe UVC Descriptor of YUY2 Format.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    73
@param		aDataInfo		[in]					DataInfo from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    74
@return 	bDescriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    75
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    76
TWebcameraUVCDescriptor DWebCameraUVCDescribeDescriptorYUY2::DescribeDescriptor(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    77
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    78
	DP("DWebcameraUVCDescribeDescriptorYUY2::DescribeDescriptor Start");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    79
	//Describe FormatDescriptor Part.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    80
	TWebcameraUVCDescriptor bDescriptor;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    81
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    82
	bDescriptor.iFormatDescriptor.iLength = 27;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    83
	bDescriptor.iFormatDescriptor.iDescriptorType = KWebcameraSCVideoStreaming;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    84
	bDescriptor.iFormatDescriptor.iDescriptorSubType = KWebcameraVSFormatUnconmpressed;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    85
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    86
	//bFormatIndex : First and only format descriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    87
	//This field is set by the host.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    88
	bDescriptor.iFormatDescriptor.iFormatIndex = 0x01;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    89
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    90
	bDescriptor.iFormatDescriptor.iNumFrameDescriptor = KWebcameraVSFrameUncompressed;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    91
	bDescriptor.iFormatDescriptor.iGuid = aDataInfo.iDataFortmat.iSubFormat;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    92
	bDescriptor.iFormatDescriptor.iBitsPerPixel = aDataInfo.iVideoInfoHeader.iBmiHeader.iBitCount;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    93
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    94
	//bDefaultFrameIndex : Default frame index is 1.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    95
	bDescriptor.iFormatDescriptor.iDefaultFrameIndex = 0x01;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    96
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    97
	bDescriptor.iFormatDescriptor.iAspectRatioX = 4;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    98
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
    99
	bDescriptor.iFormatDescriptor.iAspectRatioY = 3;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   100
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   101
	//InterlaceFlags.		//VideoInfoHeader2 dwInterlaceFlags.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   102
	//No interlaced stream.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   103
	bDescriptor.iFormatDescriptor.iInterlaceFlags = 0x00;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   104
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   105
	//0: No restrictions.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   106
	bDescriptor.iFormatDescriptor.iCopyProtect = 0x00;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   107
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   108
	//Describe FrameDescriptor Part.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   109
	bDescriptor.iFrameDescriptor.iDescriptorType = KWebcameraSCVideoStreaming;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   110
	bDescriptor.iFrameDescriptor.iDescriptorSubType = KWebcameraVSFrameUncompressed;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   111
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   112
	//First and only frame descriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   113
	bDescriptor.iFrameDescriptor.iFrameIndex = 0x01;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   114
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   115
	//Still images using capture method 0 are supported at this frame setting.D1: Fixed frame-rate.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   116
	//D2~D7 reserved.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   117
	bDescriptor.iFrameDescriptor.iCapabilities = 0x02;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   118
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   119
	bDescriptor.iFrameDescriptor.iWidth = (TUint16)aDataInfo.iVideoInfoHeader.iBmiHeader.iWidth;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   120
	bDescriptor.iFrameDescriptor.iHeight = (TUint16)aDataInfo.iVideoInfoHeader.iBmiHeader.iHeight;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   121
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   122
	//iDwBitRate = 147456000 = 640 * 480 * 16 * 30(FPS).
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   123
	//bDescriptor.iFrameDescriptor.iMaxBitRate.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   124
	bDescriptor.iFrameDescriptor.iMaxBitRate = aDataInfo.iVideoInfoHeader.iDwBitRate;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   125
	//bDescriptor.iFrameDescriptor.iMinBitRate.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   126
	bDescriptor.iFrameDescriptor.iMinBitRate = aDataInfo.iVideoInfoHeader.iDwBitRate;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   127
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   128
	//bDescriptor.iFrameDescriptor.iMaxVideoFrameBufferSize.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   129
	//max frame size is 640 * 480 * 2 = 614400.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   130
	bDescriptor.iFrameDescriptor.iMaxVideoFrameBufferSize = aDataInfo.iVideoInfoHeader.iBmiHeader.iSizeImage;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   131
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   132
	//bDescriptor.iFrameDescriptor.iDefaultFrameInterval.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   133
	//147456000 / 640 / 480 / 16 = 30(FPS) -> 33.3ms -> 33,333.3ƒÊs -> 333333.3 * 100ns = 333333 = iAvgTimePerFrame.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   134
	bDescriptor.iFrameDescriptor.iDefaultFrameInterval = (TUint32)aDataInfo.iVideoInfoHeader.iAvgTimePerFrame;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   136
	//0: Continuous frame interval.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   137
	bDescriptor.iFrameDescriptor.iFrameIntervalType = 0x00;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   138
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   139
	//bDescriptor.iFrameDescriptor.iLength.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   140
	if (bDescriptor.iFrameDescriptor.iFrameIntervalType == 0)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   141
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   142
		bDescriptor.iFrameDescriptor.iFrameInterval.iFrameInterval1 = (TUint32)aDataInfo.iVideoInfoHeader.iAvgTimePerFrame;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   143
		//highest frame rate.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   144
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   145
		bDescriptor.iFrameDescriptor.iFrameInterval.iFrameInterval2 = (TUint32)aDataInfo.iVideoInfoHeader.iAvgTimePerFrame;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   146
		//lowest frame rate.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   148
		bDescriptor.iFrameDescriptor.iFrameInterval.iFrameInterval3 = (TUint32)aDataInfo.iVideoInfoHeader.iAvgTimePerFrame;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   149
		//Indicates granularity of frame interval range.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   151
		bDescriptor.iFrameDescriptor.iLength = 38;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   152
		//iFrameIntervalType = 0 : 38, > 0 : 26+(4*n).
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   153
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   154
	return bDescriptor;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   155
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   156
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   157
//UVC heder class.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   158
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   159
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   160
Constructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   161
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   162
DWebCameraUVCHeader::DWebCameraUVCHeader()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   163
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   164
	DP("DWebCameraUVCHeader::DWebCameraUVCHeader construct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   165
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   166
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   167
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   168
Destructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   169
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   170
DWebCameraUVCHeader::~DWebCameraUVCHeader()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   171
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   172
	DP("DWebCameraUVCHeader::DWebCameraUVCHeader destruct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   173
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   175
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   176
Describe UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   177
@param	aDataInfo	[in]				Information of data from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   178
@return	bHeader							UVC Header descibed.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   179
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   180
TWebcameraUVCHeaderFormat DWebCameraUVCHeader::DescribeHeader(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   181
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   182
	TWebcameraDataInfo bDataInfo = aDataInfo;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   183
	TWebcameraUVCHeaderFormat bHeader;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   184
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   185
	//Describe HeaderInfo to be included UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   186
	bHeader.iHeaderInfo = DescribeHeaderInfo(bDataInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   187
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   188
	//Describe HeaderLength to be included UVC Header if PTS was set.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   189
	bHeader.iHeaderLength = DescribeHeaderLength(bDataInfo, bHeader.iHeaderInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   190
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   191
	//Describe PresentationTime to be included UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   192
	if ((bHeader.iHeaderInfo & KWebcameraPts) > 0)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   193
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   194
		bHeader.iPresentationTime = DescribePresentationTime(bDataInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   195
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   196
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   197
	//Describe SourceClockReference to be included UVC Header if SCR was set.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   198
	if ((bHeader.iHeaderInfo & KWebcameraScr) > 0)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   199
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   200
		bHeader.iSourceClockReference = DescribeSourceClockReference(bDataInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   201
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   202
	return bHeader;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   203
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   204
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   205
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   206
Describe HeaderInfo of UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   207
@param	aDataInfo					[in]	DataInfo get from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   208
@return	bHeaderInfo.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   209
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   210
TUint8 DWebCameraUVCHeader::DescribeHeaderInfo(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   211
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   212
	TUint8 bHeaderInfo = 0x00;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   213
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   214
//	bHeaderInfo |= KWebcameraEoh;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   215
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   216
//	bHeaderInfo |= KWebcameraErr;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   217
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   218
//	bHeaderInfo |= KWebcameraSti;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   219
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   220
//	bHeaderInfo |= KWebcameraScr;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   221
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   222
	//Case: Set PTS infomation.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   223
	if (aDataInfo.iVideoInfoHeader.iAvgTimePerFrame != 0)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   224
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   225
		bHeaderInfo |= KWebcameraPts;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   226
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   227
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   228
//	bHeaderInfo |= KWebcameraEof;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   229
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   230
	//Reversing FID.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   231
	iFID = ~iFID;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   232
	iFID &= KWebcameraFid;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   233
	bHeaderInfo |= iFID;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   234
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   235
	return bHeaderInfo;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   237
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   239
Describe HeaderLength to be included UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   240
@param	aDataInfo		[in]								Information of data from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   241
		aHeaderInfo		[in]								HeaderInfo to be included UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   242
@return	bHeaderLength.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   243
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   244
TUint8 DWebCameraUVCHeader::DescribeHeaderLength(const TWebcameraDataInfo aDataInfo, TUint8 aHeaderInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   245
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   246
	TUint8 bHeaderLength;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   247
	bHeaderLength = 2;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   248
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   249
	//Get information of PTS .
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   250
	if ((aHeaderInfo & KWebcameraPts) > 0)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   252
		bHeaderLength += 4;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   254
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   255
	//Get information of SCR.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   256
	if ((aHeaderInfo & KWebcameraScr) > 0)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   257
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   258
		bHeaderLength += 6;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   259
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   260
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   261
	return bHeaderLength;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   262
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   263
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   264
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   265
Describe PresentationTime to be included UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   266
@param	@param	aDataInfo						[in]	Information of Data from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   267
@return	bPresentationTime.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   268
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   269
TUint32 DWebCameraUVCHeader::DescribePresentationTime(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   270
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   271
	TUint32 bPresentationTime;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   272
	//Substitution information of AvgTimePerFrame for PresentationTime.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   273
	bPresentationTime = (TUint32)aDataInfo.iVideoInfoHeader.iAvgTimePerFrame;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   274
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   275
	return bPresentationTime;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   276
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   277
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   278
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   279
Describe SourceClockReference to be included UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   280
@param	aDataInfo					[in]	Information of data from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   281
@return	bSourceClockReference.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   282
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   283
TWebcameraUVCSourceClockReference DWebCameraUVCHeader::DescribeSourceClockReference(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   284
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   285
	TWebcameraUVCSourceClockReference bSourceClockReference;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   286
	//Substitute information of TokenCounter for iTokenCounter.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   287
	bSourceClockReference.iTokenCounter = 0x0000;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   288
	bSourceClockReference.iTokenCounter &= KWebcameraTokenCounter;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   289
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   290
	//Substitute information of SourceTimeClock for iSourceTimeClock.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   291
//	bSourceClockReference.iSourceTimeClock = (TUint32) aSourceTimeClock;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   292
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   293
	return bSourceClockReference;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   294
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   295
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   296
//Describe class.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   297
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   298
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   299
Constructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   300
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   301
DWebCameraDescribe::DWebCameraDescribe()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   302
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   303
	DP("DWebCameraDescribe::DWebCameraDescribe construct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   304
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   305
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   306
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   307
Destructor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   308
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   309
DWebCameraDescribe::~DWebCameraDescribe()
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   310
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   311
	delete iDescribe;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   312
	DP("DWebCameraDescribe::DWebCameraDescribe destruct");
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   313
	}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   314
	
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   315
/**
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   316
Parse iDataInfo from lower layer and describe UVC Header and Descriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   317
@param	aDataInfo					[in]	Information of data from lower layer.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   318
@return	bUVC.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   319
*/
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   320
TWebcameraUVC DWebCameraDescribe::ParseDataInfo(const TWebcameraDataInfo aDataInfo)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   321
	{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   322
	TWebcameraDataInfo bDataInfo = aDataInfo;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   323
	TWebcameraUVC bUvc;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   324
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   325
	//Describe UVC Header.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   326
	DWebCameraUVCHeader* bHeader;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   327
	bHeader = new DWebCameraUVCHeader;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   328
	bUvc.iUVCHeader = bHeader->DescribeHeader(bDataInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   329
	delete bHeader;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
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:
diff changeset
   331
	//If MajorFormat equal KWebcameraVideoStream, this format is VideoStream.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   332
	if (bDataInfo.iDataFortmat.iMajorFormat.iData1 == KWebcameraVideoStream)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   333
		{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   334
		//Discriminate by SubFormat.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   335
		switch (bDataInfo.iDataFortmat.iSubFormat.iData1)
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   336
			{
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   337
			//Case of YUY2 Format.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   338
			case KWebcameraYuy2:
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   339
				iDescribe = new DWebCameraUVCDescribeDescriptorYUY2;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   340
				break;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   341
			
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   342
			//Case of default.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   343
			default:
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   344
				//No format that discriminated.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   345
				break;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   346
			}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   347
		//Describe UVC Descriptor.
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   348
		bUvc.iUVCDescriptor = iDescribe->DescribeDescriptor(bDataInfo);
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   349
		}
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   350
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   351
	return bUvc;
606eafc6d6a8 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents:
diff changeset
   352
	}