File: videodevice_h-source.html

package info (click to toggle)
camstream 0.26.3%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,464 kB
  • ctags: 2,076
  • sloc: cpp: 7,483; asm: 440; ansic: 427; makefile: 336; sh: 169
file content (163 lines) | stat: -rw-r--r-- 13,717 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<html>
<head>
<title>Camstream: CamStream API documentation</title>
<link rel="stylesheet" href="../../tech.css" type="text/css">
</head>
<body>

<!-- Generated by Doxygen 1.2.6 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>VideoDevice.h</h1><a href="videodevice_h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="preprocessor">#ifndef VIDEO_DEVICE_HPP</font>
00002 <font class="preprocessor"></font><font class="preprocessor">#define VIDEO_DEVICE_HPP</font>
00003 <font class="preprocessor"></font>
00004 <font class="preprocessor">#ifdef HAVE_CONFIG_H</font>
00005 <font class="preprocessor"></font><font class="preprocessor">#include &lt;config.h&gt;</font>
00006 <font class="preprocessor">#endif</font>
00007 <font class="preprocessor"></font>
00008 <font class="preprocessor">#include &lt;sys/types.h&gt;</font>
00009 <font class="preprocessor">#include &lt;linux/videodev.h&gt;</font>
00010 
00011 <font class="preprocessor">#include &lt;qarray.h&gt;</font>
00012 <font class="preprocessor">#include &lt;qcolor.h&gt;</font>
00013 <font class="preprocessor">#include &lt;qimage.h&gt;</font>
00014 <font class="preprocessor">#include &lt;qobject.h&gt;</font>
00015 <font class="preprocessor">#include &lt;qsocketnotifier.h&gt;</font>
00016 <font class="preprocessor">#include &lt;qtimer.h&gt;</font>
00017 <font class="preprocessor">#include &lt;qvector.h&gt;</font>
00018 
00019 <font class="preprocessor">#include "<a class="code" href="videodeviceinput_h.html">VideoDeviceInput.h</a>"</font>
00020 <font class="preprocessor">#include "<a class="code" href="videoaudioinput_h.html">VideoAudioInput.h</a>"</font>
00021 
00022 <font class="keyword">class </font><a class="code" href="class_cvideodevice.html">CVideoDevice</a>: <font class="keyword">public</font> <a class="code" href="class_qobject.html">QObject</a>
00023 {
<a name="l00024"></a><a class="code" href="class_cvideodevice.html#l0">00024</a> <font class="keyword">friend</font> <font class="keyword">class </font><a class="code" href="class_cvideodeviceinput.html">CVideoDeviceInput</a>;
<a name="l00025"></a><a class="code" href="class_cvideodevice.html#l1">00025</a> <font class="keyword">friend</font> <font class="keyword">class </font><a class="code" href="class_cvideodevicetuner.html">CVideoDeviceTuner</a>;
<a name="l00026"></a><a class="code" href="class_cvideodevice.html#l2">00026</a> <font class="keyword">friend</font> <font class="keyword">class </font><a class="code" href="class_cvideoaudioinput.html">CVideoAudioInput</a>;
00027    Q_OBJECT
00028 <font class="keyword">private</font>:
00029    <font class="keywordtype">bool</font> validated;
00030    QString NodeName, IntfName;
00031    <font class="keywordtype">int</font> CamFD, Opened;
00032    <font class="keywordtype">bool</font> UseSelect, HasFramerate;
00033    <font class="keywordtype">int</font> Capturing;
00034    <font class="keywordtype">int</font> Palette, FrameRate;
00035    <font class="keywordtype">int</font> PalRGB, PalYUV;
00036    <font class="keyword">struct </font>video_picture VPic;
00037    <font class="keyword">struct </font>video_mbuf VMBuf;
00038    <font class="keywordtype">int</font> Buffers, CurBuffer;
00039 
00040    QVector &lt;CVideoDeviceInput&gt;VideoInputs;
00041    <font class="keywordtype">int</font> CurrentVideoInput;
00042    QVector &lt;CVideoAudioInput&gt;AudioInputs;
00043    <font class="keywordtype">int</font> CurrentAudioInput;
00044 
00045    QVector&lt;QImage&gt; RGB;
00046    QVector&lt;QImage&gt; Y, U, V;
00047    QImage *pNullImage;
00048    QRgb GrayScale[256];
00049 
00050    <font class="keywordtype">int</font> image_w, image_h;
00051    <font class="keywordtype">int</font> max_w, max_h;
00052    <font class="keywordtype">int</font> min_w, min_h;
00053    uchar *vid_io_buffer;                <font class="comment">// The buffer used for I/O; this can be mmap()ed or malloc()ed</font>
00054    uchar *rgb_vid_buffer;               <font class="comment">// The buffer for rgb images; may point to vid_io_buffer</font>
00055    uchar *yuv_vid_buffer;               <font class="comment">// The buffer for yuv images; may point to vid_io_buffer</font>
00056    QArray&lt;int&gt; vid_io_offsets, rgb_vid_offsets, yuv_vid_offsets;
00057    <font class="keywordtype">int</font> vid_io_buffer_size, vid_io_image_size;
00058 
00059    QSocketNotifier *pImageSocket;
00060    QTimer *pImageTimer;
00061 
00062    <font class="keywordtype">void</font> Init();
00063    <font class="keywordtype">void</font> CleanUp();
00064 
00065    <font class="keywordtype">bool</font> TryPalette(<font class="keywordtype">int</font> pal, <font class="keywordtype">int</font> depth);
00066    <font class="keywordtype">void</font> SetPalette();
00067    <font class="keywordtype">void</font> CalcVidIoSize();
00068    
00069    <font class="keywordtype">int</font> MCapture(<font class="keywordtype">int</font> buf);
00070    <font class="keywordtype">int</font> MSync();
00071 
00072    <font class="keywordtype">void</font> CreateImagesRGB();
00073    <font class="keywordtype">void</font> ResetImagesRGB();
00074    <font class="keywordtype">void</font> CreateImagesYUV();
00075    <font class="keywordtype">void</font> ResetImagesYUV();
00076    
00077    <font class="keywordtype">void</font> StartCapture();
00078    <font class="keywordtype">void</font> StopCapture();
00079 
00080 <font class="keyword">private</font> slots:
00081    <font class="keywordtype">void</font> LoadImage();
00082 
00083 <font class="keyword">public</font>:
00084    <a class="code" href="class_cvideodevice.html#a0">CVideoDevice</a>(<font class="keyword">const</font> QString &amp;node_name);
00085    <a class="code" href="class_cvideodevice.html#a1">~CVideoDevice</a>();
00086 
00087    <font class="keywordtype">bool</font> <a class="code" href="class_cvideodevice.html#a2">IsValid</a>();
00088 
00089    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a3">Open</a>(<font class="keywordtype">int</font> buffers = 1);
00090    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#a4">Close</a>();
00091    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a5">GetDescriptor</a>() <font class="keyword">const</font>;
00092    
00093    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#a6">EnableRGB</a>(<font class="keywordtype">bool</font> isOn);
00094    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#a7">EnableYUV</a>(<font class="keywordtype">bool</font> isOn);
00095 
00096    QString <a class="code" href="class_cvideodevice.html#a8">GetNodeName</a>() <font class="keyword">const</font>;
00097    QString <a class="code" href="class_cvideodevice.html#a9">GetIntfName</a>() <font class="keyword">const</font>;
00098    
00099    QSize <a class="code" href="class_cvideodevice.html#a10">GetMinSize</a>() <font class="keyword">const</font>;
00100    QSize <a class="code" href="class_cvideodevice.html#a11">GetSize</a>();
00101    QSize <a class="code" href="class_cvideodevice.html#a12">GetMaxSize</a>() <font class="keyword">const</font>;
00102    <font class="keywordtype">bool</font>  <a class="code" href="class_cvideodevice.html#a13">SetSize</a>(<font class="keywordtype">int</font> width, <font class="keywordtype">int</font> height);
00103    <font class="keywordtype">bool</font>  <a class="code" href="class_cvideodevice.html#a13">SetSize</a>(<font class="keyword">const</font> QSize &amp;new_size);
00104    <font class="keywordtype">int</font>   <a class="code" href="class_cvideodevice.html#a15">GetFramerate</a>() <font class="keyword">const</font>;
00105    <font class="keywordtype">bool</font>  <a class="code" href="class_cvideodevice.html#a16">SetFramerate</a>(<font class="keywordtype">int</font> fps);
00106    <font class="keywordtype">int</font>   <a class="code" href="class_cvideodevice.html#a17">GetMBuffers</a>() <font class="keyword">const</font>;
00107    <font class="keywordtype">int</font>   <a class="code" href="class_cvideodevice.html#a18">GetBuffers</a>() <font class="keyword">const</font>;
00108 
00109    <font class="keywordtype">int</font>   <a class="code" href="class_cvideodevice.html#a19">GetVideoInputs</a>() <font class="keyword">const</font>;
00110    <font class="keywordtype">int</font>   <a class="code" href="class_cvideodevice.html#a20">GetCurrentVideoInput</a>() <font class="keyword">const</font>;
00111    <a class="code" href="class_cvideodeviceinput.html">CVideoDeviceInput</a> *<a class="code" href="class_cvideodevice.html#a21">GetVideoInput</a>(<font class="keywordtype">int</font> number = -1) <font class="keyword">const</font>;
00112    <font class="keywordtype">bool</font>  <a class="code" href="class_cvideodevice.html#a22">SelectVideoInput</a>(<font class="keywordtype">int</font> number);
00113    
00114    <font class="keywordtype">int</font>   <a class="code" href="class_cvideodevice.html#a23">GetAudioInputs</a>() <font class="keyword">const</font>;
00115    <a class="code" href="class_cvideoaudioinput.html">CVideoAudioInput</a> *<a class="code" href="class_cvideodevice.html#a24">GetAudioInput</a>(<font class="keywordtype">int</font> number = -1) <font class="keyword">const</font>;
00116    <font class="keywordtype">bool</font>  <a class="code" href="class_cvideodevice.html#a25">SelectAudioInput</a>(<font class="keywordtype">int</font> number);
00117    
00118    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a26">GetBrightness</a>() <font class="keyword">const</font>;
00119    <font class="keywordtype">bool</font> <a class="code" href="class_cvideodevice.html#a27">SetBrightness</a>(<font class="keywordtype">int</font> val);
00120    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a28">GetContrast</a>() <font class="keyword">const</font>;
00121    <font class="keywordtype">bool</font> <a class="code" href="class_cvideodevice.html#a29">SetContrast</a>(<font class="keywordtype">int</font> val);
00122    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a30">GetHue</a>() <font class="keyword">const</font>;
00123    <font class="keywordtype">bool</font> <a class="code" href="class_cvideodevice.html#a31">SetHue</a>(<font class="keywordtype">int</font> val);
00124    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a32">GetColour</a>() <font class="keyword">const</font>;
00125    <font class="keywordtype">bool</font> <a class="code" href="class_cvideodevice.html#a33">SetColour</a>(<font class="keywordtype">int</font> val);
00126    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a34">GetWhiteness</a>() <font class="keyword">const</font>;
00127    <font class="keywordtype">bool</font> <a class="code" href="class_cvideodevice.html#a35">SetWhiteness</a>(<font class="keywordtype">int</font> val);
00128    
00129    <font class="keywordtype">int</font> <a class="code" href="class_cvideodevice.html#a36">ReadImage</a>();
00130 
00131    QImage *<a class="code" href="class_cvideodevice.html#a37">GetRGB</a>(<font class="keywordtype">int</font> offset = 0) <font class="keyword">const</font>;
00132    QImage *<a class="code" href="class_cvideodevice.html#a38">GetY</a>(<font class="keywordtype">int</font> offset = 0) <font class="keyword">const</font>;
00133    QImage *<a class="code" href="class_cvideodevice.html#a39">GetU</a>(<font class="keywordtype">int</font> offset = 0) <font class="keyword">const</font>;
00134    QImage *<a class="code" href="class_cvideodevice.html#a40">GetV</a>(<font class="keywordtype">int</font> offset = 0) <font class="keyword">const</font>;
00135 
00136 signals:   
00138    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j0">Notify</a>();
00140    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j1">Closed</a>();
00142    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j2">Resized</a>(<font class="keyword">const</font> QSize &amp;new_size);
00144    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j3">FramerateChanged</a>(<font class="keywordtype">int</font>);
00146    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j4">ChangedVideoInput</a>(<font class="keywordtype">int</font> input);
00148    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j5">ChangedTunerNorm</a>(<font class="keywordtype">int</font> tuner, <font class="keywordtype">int</font> norm);
00150    <font class="keywordtype">void</font> <a class="code" href="class_cvideodevice.html#j6">Error</a>(<font class="keywordtype">int</font> err_num);
00151 };
00152 
00153 <font class="preprocessor">#endif</font>
</font></pre></div><hr><address><small>Generated at Sat May 18 02:56:55 2002 for Camstream by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.6 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>