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
|
<html>
<head>
<title>Camstream: CamStream API documentation</title>
<link rel="stylesheet" href="../../tech.css" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>old-vdev.h</h1><a href="old-vdev_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="preprocessor">#ifndef VIDEO_DEVICE_HPP</span>
00002 <span class="preprocessor"></span><span class="preprocessor">#define VIDEO_DEVICE_HPP</span>
00003 <span class="preprocessor"></span>
00004 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
00005 <span class="preprocessor"></span><span class="preprocessor">#include <<a class="code" href="config_8h.html">config.h</a>></span>
00006 <span class="preprocessor">#endif</span>
00007 <span class="preprocessor"></span>
00008 <span class="preprocessor">#include <sys/types.h></span>
00009 <span class="preprocessor">#include <<a class="code" href="videodev_8h.html">linux/videodev.h</a>></span>
00010
00011 <span class="preprocessor">#include <qarray.h></span>
00012 <span class="preprocessor">#include <qcolor.h></span>
00013 <span class="preprocessor">#include <qimage.h></span>
00014 <span class="preprocessor">#include <qobject.h></span>
00015 <span class="preprocessor">#include <qsocketnotifier.h></span>
00016 <span class="preprocessor">#include <qtimer.h></span>
00017 <span class="preprocessor">#include <qvector.h></span>
00018
00019 <span class="preprocessor">#include "<a class="code" href="_video_device_input_8h.html">VideoDeviceInput.h</a>"</span>
00020 <span class="preprocessor">#include "<a class="code" href="_video_audio_input_8h.html">VideoAudioInput.h</a>"</span>
00021
00022 <span class="keyword">class </span><a class="code" href="class_c_video_device.html">CVideoDevice</a>: <span class="keyword">public</span> QObject
00023 {
00024 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_video_device_input.html">CVideoDeviceInput</a>;
00025 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_video_device_tuner.html">CVideoDeviceTuner</a>;
00026 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_video_audio_input.html">CVideoAudioInput</a>;
00027 Q_OBJECT
00028 <span class="keyword">private</span>:
00029 <span class="keywordtype">bool</span> validated;
00030 QString NodeName, IntfName;
00031 <span class="keywordtype">int</span> CamFD, Opened;
00032 <span class="keywordtype">bool</span> UseSelect, HasFramerate;
00033 <span class="keywordtype">int</span> Capturing;
00034 <span class="keywordtype">int</span> Palette, FrameRate;
00035 <span class="keywordtype">int</span> PalRGB, PalYUV;
00036 <span class="keyword">struct </span><a class="code" href="structvideo__picture.html">video_picture</a> VPic;
00037 <span class="keywordtype">int</span> Buffers, CurBuffer;
00038 <span class="keywordtype">bool</span> m_IsMutable;
00039
00040 QVector <CVideoDeviceInput>VideoInputs;
00041 <span class="keywordtype">int</span> CurrentVideoInput;
00042 QVector <CVideoAudioInput>AudioInputs;
00043 <span class="keywordtype">int</span> CurrentAudioInput;
00044
00045 QVector<QImage> RGB;
00046 QVector<QImage> Y, U, V;
00047 QImage *pNullImage;
00048 QRgb GrayScale[256];
00049
00050 <span class="keywordtype">int</span> image_w, image_h;
00051 <span class="keywordtype">int</span> max_w, max_h;
00052 <span class="keywordtype">int</span> min_w, min_h;
00053 uchar *vid_io_buffer; <span class="comment">// The buffer used for I/O; this can be mmap()ed or malloc()ed</span>
00054 uchar *rgb_vid_buffer; <span class="comment">// The buffer for rgb images; may point to vid_io_buffer</span>
00055 uchar *yuv_vid_buffer; <span class="comment">// The buffer for yuv images; may point to vid_io_buffer</span>
00056 QArray<int> vid_io_offsets, rgb_vid_offsets, yuv_vid_offsets;
00057 <span class="keywordtype">int</span> vid_io_buffer_size, vid_io_image_size;
00058
00059 QSocketNotifier *pImageSocket;
00060 QTimer *pImageTimer;
00061
00062 <span class="keywordtype">void</span> <a class="code" href="class_c_video_device.html#b1">Init</a>();
00063 <span class="keywordtype">void</span> CleanUp();
00064
00065 <span class="keywordtype">bool</span> TryPalette(<span class="keywordtype">int</span> pal, <span class="keywordtype">int</span> depth);
00066 <span class="keywordtype">void</span> SetPalette();
00067 <span class="keywordtype">void</span> CalcVidIoSize();
00068
00069 <span class="keywordtype">int</span> MCapture(<span class="keywordtype">int</span> buf);
00070 <span class="keywordtype">int</span> MSync();
00071
00072 <span class="keywordtype">void</span> <a class="code" href="class_c_video_device.html#b3">CreateImagesRGB</a>();
00073 <span class="keywordtype">void</span> ResetImagesRGB();
00074 <span class="keywordtype">void</span> <a class="code" href="class_c_video_device.html#b5">CreateImagesYUV</a>();
00075 <span class="keywordtype">void</span> ResetImagesYUV();
00076
00077 <span class="keywordtype">void</span> <a class="code" href="class_c_video_device.html#b11">StartCapture</a>();
00078 <span class="keywordtype">void</span> <a class="code" href="class_c_video_device.html#b12">StopCapture</a>();
00079
00080 <span class="keyword">private</span> slots:
00081 <span class="keywordtype">void</span> LoadImage();
00082
00083 <span class="keyword">public</span>:
00084 <a class="code" href="class_c_video_device.html#a0">CVideoDevice</a>(<span class="keyword">const</span> QString &node_name);
00085 <a class="code" href="class_c_video_device.html#a1">~CVideoDevice</a>();
00086
00087 <span class="keywordtype">bool</span> <a class="code" href="class_c_video_device.html#a5">IsValid</a>();
00088
00089 <span class="keywordtype">int</span> <a class="code" href="class_c_video_device.html#a6">Open</a>(<span class="keywordtype">int</span> buffers = 1);
00090 <span class="keywordtype">void</span> <a class="code" href="class_c_video_device.html#a7">Close</a>();
00091 <span class="keywordtype">int</span> <a class="code" href="class_c_video_device.html#a21">GetDescriptor</a>() const;
00092
00093 <span class="keywordtype">void</span> EnableRGB(<span class="keywordtype">bool</span> isOn);
00094 <span class="keywordtype">void</span> EnableYUV(<span class="keywordtype">bool</span> isOn);
00095
00096 QString GetNodeName() const;
00097 QString GetIntfName() const;
00098
00099 QSize GetMinSize() const;
00100 QSize GetSize();
00101 QSize GetMaxSize() const;
00102 <span class="keywordtype">bool</span> SetSize(<span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);
00103 <span class="keywordtype">bool</span> SetSize(const QSize &new_size);
00104 <span class="keywordtype">int</span> GetFramerate() const;
00105 <span class="keywordtype">bool</span> SetFramerate(<span class="keywordtype">int</span> fps);
00106 <span class="keywordtype">int</span> GetMBuffers() const;
00107 <span class="keywordtype">int</span> GetBuffers() const;
00108
00109 <span class="keywordtype">int</span> GetVideoInputs() const;
00110 <span class="keywordtype">int</span> GetCurrentVideoInput() const;
00111 <a class="code" href="class_c_video_device_input.html">CVideoDeviceInput</a> *GetVideoInput(<span class="keywordtype">int</span> number = -1) const;
00112 <span class="keywordtype">bool</span> SelectVideoInput(<span class="keywordtype">int</span> number);
00113
00114 <span class="keywordtype">int</span> GetAudioInputs() const;
00115 <a class="code" href="class_c_video_audio_input.html">CVideoAudioInput</a> *GetAudioInput(<span class="keywordtype">int</span> number = -1) const;
00116 <span class="keywordtype">bool</span> SelectAudioInput(<span class="keywordtype">int</span> number);
00117
00118 <span class="keywordtype">int</span> GetBrightness() const;
00119 <span class="keywordtype">bool</span> SetBrightness(<span class="keywordtype">int</span> val);
00120 <span class="keywordtype">int</span> GetContrast() const;
00121 <span class="keywordtype">bool</span> SetContrast(<span class="keywordtype">int</span> val);
00122 <span class="keywordtype">int</span> GetHue() const;
00123 <span class="keywordtype">bool</span> SetHue(<span class="keywordtype">int</span> val);
00124 <span class="keywordtype">int</span> GetColour() const;
00125 <span class="keywordtype">bool</span> SetColour(<span class="keywordtype">int</span> val);
00126 <span class="keywordtype">int</span> GetWhiteness() const;
00127 <span class="keywordtype">bool</span> SetWhiteness(<span class="keywordtype">int</span> val);
00128
00129 <span class="keywordtype">int</span> ReadImage();
00130
00131 QImage *GetRGB(<span class="keywordtype">int</span> offset = 0) const;
00132 QImage *GetY(<span class="keywordtype">int</span> offset = 0) const;
00133 QImage *GetU(<span class="keywordtype">int</span> offset = 0) const;
00134 QImage *GetV(<span class="keywordtype">int</span> offset = 0) const;
00135
00136 signals:
00138 <span class="keywordtype">void</span> Notify();
00140 <span class="keywordtype">void</span> Closed();
00142 <span class="keywordtype">void</span> Resized(const QSize &new_size);
00144 <span class="keywordtype">void</span> FramerateChanged(<span class="keywordtype">int</span>);
00146 <span class="keywordtype">void</span> ChangedVideoInput(<span class="keywordtype">int</span> input);
00148 <span class="keywordtype">void</span> ChangedTunerNorm(<span class="keywordtype">int</span> tuner, <span class="keywordtype">int</span> norm);
00150 <span class="keywordtype">void</span> Error(<span class="keywordtype">int</span> err_num);
00151 };
00152
00153 #endif
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Wed Dec 13 23:38:46 2006 for CamStream by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>
|