2
# -*- coding: utf-8 -*-
3
# libavg - Media Playback Engine.
4
# Copyright (C) 2003-2011 Ulrich von Zadow
6
# This library is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU Lesser General Public
8
# License as published by the Free Software Foundation; either
9
# version 2 of the License, or (at your option) any later version.
11
# This library is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# Lesser General Public License for more details.
16
# You should have received a copy of the GNU Lesser General Public
17
# License along with this library; if not, write to the Free Software
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
# Current versions can be found at www.libavg.de
24
def __init__(self, driver, device, unit, fw800, formats, illegalFormat, paramTests,
31
self.formats = formats
32
self.illegalFormat = illegalFormat
33
self.paramTests = paramTests
34
self.defaultParams = defaultParams
36
class CameraFormatCfg:
37
def __init__(self, size, pixelformat, framerate):
39
self.pixelformat = pixelformat
40
self.framerate = framerate
43
def __init__(self, name, testValues, minMedDiff, medMaxDiff):
45
self.testValues = testValues
46
self.minMedDiff = minMedDiff
47
self.medMaxDiff = medMaxDiff
49
DFx31BF03Cfg = CameraTestCfg('firewire', '', -1, False,
50
[CameraFormatCfg((1024,768), 'BAYER8', 30),
51
CameraFormatCfg((1024,768), 'I8', 30),
52
CameraFormatCfg((1024,768), 'YUV422', 15),
53
CameraFormatCfg((1024,768), 'YUV422', 7.5)],
54
CameraFormatCfg((320,240), 'BAYER8', 30),
55
[ParamTestCfg('gain', (180, 800, 1023), 6, 6),
56
ParamTestCfg('camgamma', (10, 16, 22), 15, 15),
57
ParamTestCfg('brightness', (0, 127, 254), 8, 8)],
58
{'gain':300, 'shutter':220, 'saturation':1200, 'camgamma':16,
59
'brightness':120, 'setWhitebalance':[450, 450]}
62
FireflyMV = CameraTestCfg('firewire', '', -1, False,
63
[CameraFormatCfg((640, 480), 'I8', 7.5),
64
CameraFormatCfg((640, 480), 'I8', 15),
65
CameraFormatCfg((640, 480), 'I8', 60),
66
CameraFormatCfg((640, 480), 'I16', 7.5),
67
CameraFormatCfg((640, 480), 'I16', 15),
68
CameraFormatCfg((640, 480), 'I16', 30)],
69
CameraFormatCfg((640, 480), 'I8', 30),
70
[ParamTestCfg('gain', (16, 30, 64), 15, 15),
71
ParamTestCfg('shutter', (1, 150, 531), 50, 20),
72
ParamTestCfg('brightness', (1, 130, 255), 10, 10)],
73
{'gain':16, 'shutter':100, 'brightness':130}
76
Dragonfly2 = CameraTestCfg('firewire', '', -1, False,
77
[CameraFormatCfg((640,480), 'RGB', 30),
78
CameraFormatCfg((1024,768), 'I8', 15),
79
CameraFormatCfg((1024,768), 'I16', 15),
80
CameraFormatCfg((1024,768), 'BAYER8', 30),
81
CameraFormatCfg((1024,768), 'YUV422', 7.5)],
82
CameraFormatCfg((123,456), 'RGB', 30),
83
[ParamTestCfg('gain', (0, 346, 683), 10, 30),
84
ParamTestCfg('camgamma', (0, 1278, 4095), 30, 50),
85
ParamTestCfg('brightness', (0, 127, 254), 8, 8)],
86
{'gain':300, 'shutter':220, 'saturation':1200, 'camgamma':1200,
87
'brightness':120, 'setWhitebalance':[450, 450]}
90
Firei = CameraTestCfg('firewire', '', -1, False,
91
[CameraFormatCfg((640,480), 'YUV411', 30),
92
CameraFormatCfg((640,480), 'RGB', 15),
93
CameraFormatCfg((640,480), 'YUV422', 15),
94
CameraFormatCfg((640,480), 'I8', 30),
95
CameraFormatCfg((320,240), 'YUV422', 7.5)],
96
CameraFormatCfg((123,456), 'RGB', 30),
97
#To check: there is something strange with shutter and gain in this camera.
98
[ParamTestCfg('gain', (1, 100, 255), 10, 30),
99
ParamTestCfg('brightness', (128, 255, 383), 8, 8),
100
ParamTestCfg('shutter', (4, 4, 4), 8, 8)],
101
{'gain':87, 'shutter':6, 'brightness':304, 'setWhitebalance':[95, 87]}
104
QuickCamProLinux = CameraTestCfg('video4linux', '', -1, False,
105
[CameraFormatCfg((352,288), 'YUYV422', 30),
106
CameraFormatCfg((320,240), 'YUYV422', 15),
107
CameraFormatCfg((176,144), 'YUYV422', 30),
108
CameraFormatCfg((640,480), 'YUYV422', 30)],
109
CameraFormatCfg((123,456), 'I16', 30),
110
[ParamTestCfg('brightness', (0, 127, 254), 40, 50)],
114
QuickCamPro9Win = CameraTestCfg('directshow', '', -1, False,
115
[CameraFormatCfg((352,288), 'YUYV422', 30),
116
CameraFormatCfg((320,240), 'YUYV422', 15),
117
CameraFormatCfg((640,480), 'YUYV422', 30),
118
CameraFormatCfg((176,144), 'YUYV422', 30)],
119
CameraFormatCfg((123,456), 'RGB', 30),
120
[ParamTestCfg('brightness', (0, 127, 254), 40, 50)],
124
QuickCamProBGRWin = CameraTestCfg('directshow', '', -1, False,
125
[CameraFormatCfg((352,288), 'BGR', 30),
126
CameraFormatCfg((320,240), 'BGR', 15),
127
CameraFormatCfg((640,480), 'BGR', 30),
128
CameraFormatCfg((176,144), 'BGR', 30)],
129
CameraFormatCfg((123,456), 'YUYV422', 30),
130
[ParamTestCfg('brightness', (0, 127, 254), 40, 50)],