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 "objectdescription.h"
28
#include "abstractmediastream.h"
29
30
#include <QtCore/QUrl>
31
#include <QtCore/QString>
32
#include <QtCore/QSharedData>
33
#include <QtCore/QPointer>
34
35
QT_BEGIN_NAMESPACE
36
37
class QFile;
38
39
namespace Phonon
40
{
41
42
class PHONON_EXPORT MediaSourcePrivate : public QSharedData
43
{
44
    public:
45
        MediaSourcePrivate(MediaSource::Type t)
46
            : type(t), discType(NoDisc),
47
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
48
            stream(0),
49
            ioDevice(0),
50
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
51
            autoDelete(false)
52
        {
53
        }
54
55
        virtual ~MediaSourcePrivate();
56
57
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
58
        void setStream(AbstractMediaStream *s);
59
#endif
60
61
        MediaSource::Type type;
62
        QUrl url;
63
        Phonon::DiscType discType;
64
        QString deviceName;
65
66
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
67
        // The AbstractMediaStream(2) may be deleted at any time by the application. If that happens
68
        // stream will be 0 automatically, but streamEventQueue will stay valid as we hold a
69
        // reference to it. This is necessary to avoid a races when setting the MediaSource while
70
        // another thread deletes the AbstractMediaStream2. StreamInterface(2) will then just get a
71
        // StreamEventQueue where nobody answers.
72
        QPointer<AbstractMediaStream> stream;
73
74
//        AudioCaptureDevice audioCaptureDevice;
75
//        VideoCaptureDevice videoCaptureDevice;
76
        QIODevice *ioDevice;
77
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
78
        //QList<MediaSource> linkedSources;
79
        bool autoDelete;
80
};
81
82
} // namespace Phonon
83
84
QT_END_NAMESPACE
85
86
#endif // MEDIASOURCE_P_H
87
// vim: sw=4 sts=4 et tw=100