~ubuntu-branches/ubuntu/trusty/libavg/trusty-proposed

« back to all changes in this revision

Viewing changes to src/test/camcfgs.py

  • Committer: Package Import Robot
  • Author(s): OXullo Intersecans
  • Date: 2011-12-06 22:44:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111206224456-qc7250z3ya1vi8s9
Tags: 1.7.0-0ubuntu1
* New upstream release (LP: #899183)
* Remove patches 0002-libav-0.7.patch, 0003-fglrx-segfault-on-startup.patch
  now merged to upstream
* Remove unnecessary .la files
* Update debian/watch file
* Fix debian/copyright dep-5 compliancy
* Update standards to version 3.9.2
* Add man pages for avg_checktouch, avg_checkvsync, avg_showsvg
* Minor debian/rules enhancement
* Add librsvg2-dev, libgdk-pixbuf2.0-dev to Build-Depends
* Proper transition to dh_python2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# -*- coding: utf-8 -*-
 
3
# libavg - Media Playback Engine.
 
4
# Copyright (C) 2003-2011 Ulrich von Zadow
 
5
#
 
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.
 
10
#
 
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.
 
15
#
 
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
 
19
#
 
20
# Current versions can be found at www.libavg.de
 
21
#
 
22
 
 
23
class CameraTestCfg:
 
24
    def __init__(self, driver, device, unit, fw800, formats, illegalFormat, paramTests, 
 
25
            defaultParams):
 
26
        self.driver = driver
 
27
        self.device = device
 
28
        self.unit = unit
 
29
        self.fw800 = fw800
 
30
 
 
31
        self.formats = formats
 
32
        self.illegalFormat = illegalFormat
 
33
        self.paramTests = paramTests
 
34
        self.defaultParams = defaultParams
 
35
 
 
36
class CameraFormatCfg:
 
37
    def __init__(self, size, pixelformat, framerate):
 
38
        self.size = size
 
39
        self.pixelformat = pixelformat
 
40
        self.framerate = framerate
 
41
 
 
42
class ParamTestCfg:
 
43
    def __init__(self, name, testValues, minMedDiff, medMaxDiff):
 
44
        self.name = name
 
45
        self.testValues = testValues
 
46
        self.minMedDiff = minMedDiff
 
47
        self.medMaxDiff = medMaxDiff
 
48
 
 
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]}
 
60
    )
 
61
 
 
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}
 
74
    )
 
75
 
 
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]}
 
88
    )
 
89
 
 
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]}
 
102
    )
 
103
 
 
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)],
 
111
    {'brightness':-1}
 
112
    )
 
113
 
 
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)],
 
121
    {'brightness': 60}
 
122
    )
 
123
 
 
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)],
 
131
    {'brightness': 60}
 
132
    )
 
133