| 1 | /* This file is part of the KDE project |
| 2 | Copyright (C) 2007 Matthias Kretz <kretz@kde.org> |
| 3 | |
| 4 | This library is free software; you can redistribute it and/or |
| 5 | modify it under the terms of the GNU Lesser General Public |
| 6 | License as published by the Free Software Foundation; either |
| 7 | version 2.1 of the License, or (at your option) version 3, or any |
| 8 | later version accepted by the membership of KDE e.V. (or its |
| 9 | successor approved by the membership of KDE e.V.), Nokia Corporation |
| 10 | (or its successors, if any) and the KDE Free Qt Foundation, which shall |
| 11 | act as a proxy defined in Section 6 of version 3 of the license. |
| 12 | |
| 13 | This library is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | Lesser General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU Lesser General Public |
| 19 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | */ |
| 22 | |
| 23 | #ifndef MEDIASOURCE_P_H |
| 24 | #define MEDIASOURCE_P_H |
| 25 | |
| 26 | #include "mediasource.h" |
| 27 | #include "abstractmediastream.h" |
| 28 | #include "objectdescription.h" |
| 29 | #include "mrl.h" |
| 30 | |
| 31 | #include <QUrl> |
| 32 | #include <QString> |
| 33 | #include <QSharedData> |
| 34 | #include <QPointer> |
| 35 | |
| 36 | class QFile; |
| 37 | |
| 38 | namespace Phonon |
| 39 | { |
| 40 | |
| 41 | class PHONON_EXPORT MediaSourcePrivate : public QSharedData |
| 42 | { |
| 43 | public: |
| 44 | MediaSourcePrivate(MediaSource::Type t) |
| 45 | : type(t), discType(NoDisc), |
| 46 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
| 47 | stream(nullptr), |
| 48 | ioDevice(nullptr), |
| 49 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
| 50 | autoDelete(false) |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | virtual ~MediaSourcePrivate(); |
| 55 | |
| 56 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
| 57 | void setStream(AbstractMediaStream *s); |
| 58 | #endif |
| 59 | |
| 60 | MediaSource::Type type; |
| 61 | Mrl url; |
| 62 | Phonon::DiscType discType; |
| 63 | QString deviceName; // Used for discs |
| 64 | Phonon::DeviceAccessList audioDeviceAccessList; |
| 65 | Phonon::DeviceAccessList videoDeviceAccessList; |
| 66 | |
| 67 | #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM |
| 68 | // The AbstractMediaStream(2) may be deleted at any time by the application. If that happens |
| 69 | // stream will be 0 automatically, but streamEventQueue will stay valid as we hold a |
| 70 | // reference to it. This is necessary to avoid a races when setting the MediaSource while |
| 71 | // another thread deletes the AbstractMediaStream2. StreamInterface(2) will then just get a |
| 72 | // StreamEventQueue where nobody answers. |
| 73 | QPointer<AbstractMediaStream> stream; |
| 74 | QIODevice *ioDevice; |
| 75 | #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM |
| 76 | |
| 77 | #if !defined(PHONON_NO_VIDEOCAPTURE) && !defined(PHONON_NO_AUDIOCAPTURE) |
| 78 | void setCaptureDevice(Capture::DeviceType deviceType, CaptureCategory category); |
| 79 | void setCaptureDevices(CaptureCategory category); |
| 80 | void setCaptureDevices(const AudioCaptureDevice &audioDevice, const VideoCaptureDevice &videoDevice); |
| 81 | #endif // !PHONON_NO_VIDEOCAPTURE && !PHONON_NO_AUDIOCAPTURE |
| 82 | |
| 83 | #ifndef PHONON_NO_AUDIOCAPTURE |
| 84 | AudioCaptureDevice audioCaptureDevice; |
| 85 | #endif |
| 86 | |
| 87 | #ifndef PHONON_NO_VIDEOCAPTURE |
| 88 | VideoCaptureDevice videoCaptureDevice; |
| 89 | #endif |
| 90 | |
| 91 | //QList<MediaSource> linkedSources; |
| 92 | bool autoDelete; |
| 93 | }; |
| 94 | |
| 95 | } // namespace Phonon |
| 96 | |
| 97 | #endif // MEDIASOURCE_P_H |
| 98 | // vim: sw=4 sts=4 et tw=100 |
| 99 | |
| 100 | |
| 101 | |