1/* This file is part of the KDE project
2 * Copyright © 2010 Casian Andrei <skeletk13@gmail.com>
3 * Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) version 3, or any
9 * later version accepted by the membership of KDE e.V. (or its
10 * successor approved by the membership of KDE e.V.), Nokia Corporation
11 * (or its successors, if any) and the KDE Free Qt Foundation, which shall
12 * act as a proxy defined in Section 6 of version 3 of the license.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 *
22 */
23
24#include "objectdescription.h"
25
26namespace Phonon
27{
28
29namespace Experimental
30{
31
32#ifndef PHONON_NO_VIDEOCAPTURE
33
34VideoCaptureDevice phononVcdToExperimentalVcd(const Phonon::VideoCaptureDevice &vcd)
35{
36 QHash<QByteArray, QVariant> properties;
37 const QList<QByteArray> &propertyNames = vcd.propertyNames();
38 int pi, pn = propertyNames.count();
39 for (pi = 0; pi < pn; ++ pi)
40 properties[propertyNames[pi]] = vcd.property(name: propertyNames[pi].constData());
41
42 return VideoCaptureDevice(vcd.index(), properties);
43}
44
45Phonon::VideoCaptureDevice phononExperimentalVcdToVcd(const Phonon::Experimental::VideoCaptureDevice &vcd)
46{
47 QHash<QByteArray, QVariant> properties;
48 const QList<QByteArray> &propertyNames = vcd.propertyNames();
49 int pi, pn = propertyNames.count();
50 for (pi = 0; pi < pn; ++ pi)
51 properties[propertyNames[pi]] = vcd.property(name: propertyNames[pi].constData());
52
53 return Phonon::VideoCaptureDevice(vcd.index(), properties);
54}
55
56#endif // PHONON_NO_VIDEOCAPTURE
57
58} // Experimental namespace
59} // Phonon namespace
60

source code of phonon/phonon/experimental/objectdescription.cpp