2 * Copyright 2004-2008, François Revol, <revol@free.fr>.
3 * Distributed under the terms of the MIT License.
10 CamSensor::CamSensor(CamDevice
*_camera
)
11 : fInitStatus(B_NO_INIT
),
13 fTransferEnabled(false),
15 fLastParameterChanges(0),
22 CamSensor::~CamSensor()
31 // default is to match by USB IDs
37 CamSensor::InitCheck()
58 CamSensor::StartTransfer()
60 fTransferEnabled
= true;
66 CamSensor::StopTransfer()
68 fTransferEnabled
= false;
74 CamSensor::AcceptVideoFrame(uint32
&width
, uint32
&height
)
81 if (width
> MaxWidth())
83 if (height
> MaxHeight())
90 CamSensor::SetVideoFrame(BRect rect
)
97 CamSensor::SetVideoParams(float brightness
, float contrast
, float hue
, float red
, float green
, float blue
)
104 CamSensor::AddParameters(BParameterGroup
*group
, int32
&index
)
106 fFirstParameterID
= index
;
110 CamSensor::GetParameterValue(int32 id
, bigtime_t
*last_change
, void *value
, size_t *size
)
116 CamSensor::SetParameterValue(int32 id
, bigtime_t when
, const void *value
, size_t size
)
130 CamSensor::ProbeByIICSignature(const uint8
*regList
, const uint8
*matchList
,
133 for (int i
= 0; i
< count
; i
++) {
136 len
= Device()->ReadIIC8(regList
[i
], &value
);
137 PRINT((CH
": ReadIIC8 = %d val = %d" CT
, len
, value
));
140 if (value
!= matchList
[i
])