2 * Copyright 2011, Gabriel Hartmann, gabriel.hartmann@gmail.com.
3 * Copyright 2011, Jérôme Duval, korli@users.berlios.de.
4 * Copyright 2009, Ithamar Adema, <ithamar.adema@team-embedded.nl>.
5 * Distributed under the terms of the MIT License.
7 #ifndef _UVC_CAM_DEVICE_H
8 #define _UVC_CAM_DEVICE_H
11 #include "CamDevice.h"
12 #include "USB_video.h"
15 class UVCCamDevice
: public CamDevice
{
17 UVCCamDevice(CamDeviceAddon
&_addon
,
19 virtual ~UVCCamDevice();
21 virtual bool SupportsIsochronous();
22 virtual status_t
StartTransfer();
23 virtual status_t
StopTransfer();
24 virtual status_t
SuggestVideoFrame(uint32
&width
,
26 virtual status_t
AcceptVideoFrame(uint32
&width
,
28 virtual void AddParameters(BParameterGroup
*group
,
30 virtual status_t
GetParameterValue(int32 id
,
31 bigtime_t
*last_change
, void *value
,
33 virtual status_t
SetParameterValue(int32 id
, bigtime_t when
,
34 const void *value
, size_t size
);
35 virtual status_t
FillFrameBuffer(BBuffer
*buffer
,
36 bigtime_t
*stamp
= NULL
);
39 void _ParseVideoControl(
40 const usbvc_class_descriptor
* descriptor
,
42 void _ParseVideoStreaming(
43 const usbvc_class_descriptor
* descriptor
,
45 status_t
_ProbeCommitFormat();
46 status_t
_SelectBestAlternate();
47 status_t
_SelectIdleAlternate();
48 void _DecodeColor(unsigned char *dst
,
49 unsigned char *src
, int32 width
,
52 void _AddProcessingParameter(BParameterGroup
* group
,
54 const usbvc_processing_unit_descriptor
*
56 float _AddParameter(BParameterGroup
* group
,
57 BParameterGroup
** subgroup
, int32 index
,
58 uint16 wValue
, const char* name
);
59 uint8
_AddAutoParameter(BParameterGroup
* subgroup
,
60 int32 index
, uint16 wValue
);
61 status_t
_SetParameterValue(uint16 wValue
,
63 status_t
_SetParameterValue(uint16 wValue
,
67 usbvc_interface_header_descriptor
*fHeaderDescriptor
;
69 const BUSBEndpoint
* fInterruptIn
;
71 uint16 fControlRequestIndex
;
72 uint32 fStreamingIndex
;
73 uint32 fUncompressedFormatIndex
;
74 uint32 fUncompressedFrameIndex
;
75 uint32 fMJPEGFormatIndex
;
76 uint32 fMJPEGFrameIndex
;
77 uint32 fMaxVideoFrameSize
;
78 uint32 fMaxPayloadTransferSize
;
80 BList fUncompressedFrames
;
91 float fBacklightCompensation
;
94 bool fBinaryBacklightCompensation
;
99 int fBacklightCompensationBinary
;
100 int fPowerlineFrequency
;
106 class UVCCamDeviceAddon
: public CamDeviceAddon
{
108 UVCCamDeviceAddon(WebCamMediaAddOn
* webcam
);
109 virtual ~UVCCamDeviceAddon();
111 virtual const char* BrandName();
112 virtual UVCCamDevice
* Instantiate(CamRoster
&roster
,
116 #endif /* _UVC_CAM_DEVICE_H */