46 #include "qgstreameraudioencode_maemo.h" |
46 #include "qgstreameraudioencode_maemo.h" |
47 #include "qgstreamervideoencode_maemo.h" |
47 #include "qgstreamervideoencode_maemo.h" |
48 #include "qgstreamerbushelper.h" |
48 #include "qgstreamerbushelper.h" |
49 #include "qgstreamercapturemetadatacontrol_maemo.h" |
49 #include "qgstreamercapturemetadatacontrol_maemo.h" |
50 |
50 |
51 #include "qgstreamervideooutputcontrol.h" |
|
52 #include "qgstreameraudioinputendpointselector.h" |
51 #include "qgstreameraudioinputendpointselector.h" |
53 #include "qgstreamervideoinputdevicecontrol.h" |
52 #include "qgstreamervideoinputdevicecontrol.h" |
54 |
53 |
55 #include "qgstreamervideooverlay.h" |
54 #include "qgstreamervideooverlay.h" |
56 #include "qgstreamervideorenderer.h" |
55 #include "qgstreamervideorenderer.h" |
135 m_metaDataControl = 0; |
134 m_metaDataControl = 0; |
136 |
135 |
137 m_audioInputEndpointSelector = 0; |
136 m_audioInputEndpointSelector = 0; |
138 m_videoInputDevice = 0; |
137 m_videoInputDevice = 0; |
139 |
138 |
140 m_videoOutput = 0; |
|
141 m_videoRenderer = 0; |
139 m_videoRenderer = 0; |
142 m_videoRendererFactory = 0; |
140 m_videoRendererFactory = 0; |
143 m_videoWindow = 0; |
141 m_videoWindow = 0; |
144 m_videoWindowFactory = 0; |
142 m_videoWindowFactory = 0; |
145 m_videoWidgetControl = 0; |
143 m_videoWidgetControl = 0; |
162 // m_cameraControl, SLOT(setDevice(QString))); |
160 // m_cameraControl, SLOT(setDevice(QString))); |
163 |
161 |
164 //TODO:if (m_videoInputDevice->deviceCount()) |
162 //TODO:if (m_videoInputDevice->deviceCount()) |
165 // m_cameraControl->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice())); |
163 // m_cameraControl->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice())); |
166 |
164 |
167 m_videoOutput = new QGstreamerVideoOutputControl(this); |
|
168 connect(m_videoOutput, SIGNAL(outputChanged(QVideoOutputControl::Output)), |
|
169 this, SLOT(videoOutputChanged(QVideoOutputControl::Output))); |
|
170 |
|
171 m_videoRenderer = new QGstreamerVideoRenderer(this); |
165 m_videoRenderer = new QGstreamerVideoRenderer(this); |
172 m_videoRendererFactory = new QGstreamerVideoRendererWrapper(m_videoRenderer); |
166 m_videoRendererFactory = new QGstreamerVideoRendererWrapper(m_videoRenderer); |
173 m_videoWindow = new QGstreamerVideoOverlay(this); |
167 m_videoWindow = new QGstreamerVideoOverlay(this); |
174 m_videoWindowFactory = new QGstreamerVideoRendererWrapper(m_videoWindow); |
168 m_videoWindowFactory = new QGstreamerVideoRendererWrapper(m_videoWindow); |
175 |
169 |
176 m_videoWidgetControl = new QGstreamerVideoWidgetControl(this); |
170 m_videoWidgetControl = new QGstreamerVideoWidgetControl(this); |
177 m_videoWidgetFactory = new QGstreamerVideoRendererWrapper(m_videoWidgetControl); |
171 m_videoWidgetFactory = new QGstreamerVideoRendererWrapper(m_videoWidgetControl); |
178 |
172 |
179 m_videoOutput->setAvailableOutputs(QList<QVideoOutputControl::Output>() |
|
180 << QVideoOutputControl::RendererOutput |
|
181 << QVideoOutputControl::WindowOutput |
|
182 << QVideoOutputControl::WidgetOutput); |
|
183 } |
173 } |
184 |
174 |
185 if (!m_captureSession) { |
175 if (!m_captureSession) { |
186 qWarning() << "Service type is not supported:" << service; |
176 qWarning() << "Service type is not supported:" << service; |
187 return; |
177 return; |
200 |
190 |
201 QGstreamerCaptureService::~QGstreamerCaptureService() |
191 QGstreamerCaptureService::~QGstreamerCaptureService() |
202 { |
192 { |
203 } |
193 } |
204 |
194 |
205 QMediaControl *QGstreamerCaptureService::control(const char *name) const |
195 QMediaControl *QGstreamerCaptureService::requestControl(const char *name) |
206 { |
196 { |
207 if (qstrcmp(name, QVideoOutputControl_iid) == 0) |
|
208 return m_videoOutput; |
|
209 |
|
210 if (qstrcmp(name, QVideoRendererControl_iid) == 0) |
197 if (qstrcmp(name, QVideoRendererControl_iid) == 0) |
211 return m_videoRenderer; |
198 return m_videoRenderer; |
212 |
199 |
213 if (qstrcmp(name, QVideoWindowControl_iid) == 0) |
200 if (qstrcmp(name, QVideoWindowControl_iid) == 0) |
214 return m_videoWindow; |
201 return m_videoWindow; |
232 return m_captureSession->videoEncodeControl(); |
219 return m_captureSession->videoEncodeControl(); |
233 |
220 |
234 if (qstrcmp(name,QMediaContainerControl_iid) == 0) |
221 if (qstrcmp(name,QMediaContainerControl_iid) == 0) |
235 return m_captureSession->mediaContainerControl(); |
222 return m_captureSession->mediaContainerControl(); |
236 |
223 |
237 if (qstrcmp(name,QMetaDataControl_iid) == 0) |
224 if (qstrcmp(name,QMetaDataWriterControl_iid) == 0) |
238 return m_metaDataControl; |
225 return m_metaDataControl; |
239 |
226 |
240 return 0; |
227 return 0; |
241 } |
228 } |
242 |
229 |
243 void QGstreamerCaptureService::videoOutputChanged(QVideoOutputControl::Output output) |
230 void QGstreamerCaptureService::releaseControl(QMediaControl *control) |
244 { |
231 { |
245 switch (output) { |
232 if (control && control == m_videoOutput) { |
246 case QVideoOutputControl::NoOutput: |
233 m_videoOutput = 0; |
247 m_captureSession->setVideoPreview(0); |
234 m_captureSession->setVideoPreview(0); |
248 break; |
235 } |
249 case QVideoOutputControl::RendererOutput: |
236 } |
250 m_captureSession->setVideoPreview(m_videoRendererFactory); |
237 |
251 break; |
238 |
252 case QVideoOutputControl::WindowOutput: |
|
253 m_captureSession->setVideoPreview(m_videoWindowFactory); |
|
254 break; |
|
255 case QVideoOutputControl::WidgetOutput: |
|
256 m_captureSession->setVideoPreview(m_videoWidgetFactory); |
|
257 break; |
|
258 default: |
|
259 qWarning("Invalid video output selection"); |
|
260 m_captureSession->setVideoPreview(0); |
|
261 break; |
|
262 } |
|
263 } |
|
264 |
|