Forgot to put the links:<div><br></div><div>For Phonon: <a href="http://gitorious.org/phonon/phonon/merge_requests/14">http://gitorious.org/phonon/phonon/merge_requests/14</a></div><div><a href="http://gitorious.org/phonon/phonon/merge_requests/14"></a>For Phonon-VLC: <a href="http://gitorious.org/phonon/phonon-vlc/merge_requests/9">http://gitorious.org/phonon/phonon-vlc/merge_requests/9</a><br>
<br><div class="gmail_quote">On Mon, Jun 28, 2010 at 7:41 PM, Casian Andrei <span dir="ltr">&lt;<a href="mailto:skeletk13@gmail.com">skeletk13@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<div><br></div><div>I worked on Phonon video capture devices last month, as part of GSoC. I have reached a stage where using a V4L capture device with Phonon and Phonon-VLC works, so I am proposing a merge request. There is much more work to be done.</div>

<div><br></div><div><div>Phonon</div><div>===========================================================================</div><div>What is provided:</div><div>- a method to get a video capture device list</div><div>- a method to set the desired capture device by using MediaSource.</div>

<div><br></div><div>Currently it works with V4L devices by using Phonon-VLC.</div><div><br></div><div>There are also changes to AudioCaptureDevices, but these are not tested.</div><div><br></div><div>There is a test application for video capture. It works fine on my system. I&#39;ve</div>

<div>tested it with 2 v4l devices attached. The lines that &quot;make contact&quot; with the</div><div>changes are:</div><div><br></div><div>// The part for grabbing a video capture device list</div><div>QList&lt;Phonon::VideoCaptureDevice&gt; l = Phonon::BackendCapabilities::availableVideoCaptureDevices();</div>

<div>m_deviceModel = new Phonon::VideoCaptureDeviceModel(l, 0);</div><div><br></div><div>// The part for setting the current video capture device</div><div>Phonon::VideoCaptureDevice vc = m_deviceModel-&gt;modelData(mi); // mi is the model index</div>

<div>Phonon::MediaSource mediaSource(vc);</div><div><br></div><div>There are other ways of doing the job, including an ugly one (by specifying the device name directly)</div><div><br></div><div><br></div><div>These video capture changes are only implemented in the Phonon-VLC backend.</div>

<div><br></div><div>Some of the changes just uncomment things for VideoCaptureDevice and are like those for AudioOutputDevice or AudioCaptureDevice.</div><div><br></div><div>Summary of the changes:</div><div>------------------------------------</div>

<div>backendcapabilities.h --</div><div>availableVideoCaptureDevices()</div><div>signals for changed video devices</div><div><br></div><div>factory_p.h --</div><div>signals for changed video devices</div><div><br></div><div>

globalconfig.h --</div><div>deviceProperties(Phonon::ObjectDescriptionType, index)</div><div>audioOutputDeviceProperties(index)</div><div>audioCaptureDeviceProperties(index)</div><div>videoCaptureDeviceProperties(index)</div>

<div><br></div><div>videoCaptureDeviceListFor(Phonon::Category)</div><div>videoCaptureDeviceFor(Phonon::Category)</div><div><br></div><div><a href="http://phononnamespace.h.in" target="_blank">phononnamespace.h.in</a> --</div>
<div>added an enum for CaptureDeviceType. It can be either invalid, or V4LVideo or Audio. It is used by the MediaSource to know that it uses a capture device and act accordingly (by using deviceName). This enum may be used for other types of capture devices, for instance ones that don&#39;t have anything to do with a device name. V4L isn&#39;t platform independent, but this name can be changed because it is mostly used internally. The exception is when creating a MediaSource by providing a platform-dependent device name.</div>

<div><br></div><div>mediasource.h --</div><div>constructors for creating a media source from Phonon::AudioCaptureDevice or Phonon::VideoCaptureDevice or directly by giving Phonon::V4LVideo and /dev/videoX</div><div><br></div>

<div>added captureDeviceType, audioCaptureDevice, videoCaptureDevice to the MediaSource data</div><div><br></div><div>objectdescription.h --</div><div>added VideoCaptureDeviceType</div><div><br></div><div><br></div><div>
Phonon-VLC:</div>
<div>=================================================================</div><div>What is provided:</div><div>- get video capture device list (v4l currently)</div><div>- handle v4l capture devices in MediaObject::setSource()</div>

<div><br></div><div>The most changes are in the DeviceManager. The AudioOutputDevice class has been</div><div>changed into a more generic DeviceInfo class. The DeviceManager is able to provide</div><div>lists for audioCaptureDevices, videoCaptureDevices and audioOutputDevices.</div>

<div><br></div><div>The backend can pass a list of v4l devices to Phonon.</div><div><br></div><div>There are 2 new files (header + cpp) for grabbing a list of v4l capture devices. scanDevices() probes what it can find in /dev/videoX. The code is adapted from vlc</div>

<div>from v4l2 access.</div><div><br></div><div><br></div><div>-------------------</div><div>Best regards,</div></div><div>Casian</div>
</blockquote></div><br></div>