1
/* This file is part of the KDE project
2
Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
24
#include <QtCore/QExplicitlySharedDataPointer>
25
#include <QtCore/QSet>
28
#include "shareddata.h"
30
// the gcc 4.0 STL includes assert.h
41
class SourceNodeXT : virtual public SharedData
44
SourceNodeXT(const char *name = "SourceNode");
45
virtual ~SourceNodeXT();
46
virtual xine_post_out_t *audioOutputPort() const;
47
virtual xine_post_out_t *videoOutputPort() const;
48
void assert() { Q_ASSERT(!deleted); }
50
const char *const className;
55
friend class XineThread;
56
friend class AudioDataOutputXT;
58
// hold a ref to the sink that we're connected to to make 100% sure it's always valid
59
QExplicitlySharedDataPointer<SinkNodeXT> m_xtSink;
64
friend class WireCall;
66
SourceNode(SourceNodeXT *_xt);
67
virtual ~SourceNode();
68
virtual MediaStreamTypes outputMediaStreamTypes() const = 0;
69
void addSink(SinkNode *s);
70
void removeSink(SinkNode *s);
71
QSet<SinkNode *> sinks() const;
72
virtual SinkNode *sinkInterface();
74
virtual void upstreamEvent(Event *);
75
virtual void downstreamEvent(Event *);
77
inline QExplicitlySharedDataPointer<SourceNodeXT> threadSafeObject() const { return m_threadSafeObject; }
80
QExplicitlySharedDataPointer<SourceNodeXT> m_threadSafeObject;
82
QSet<SinkNode *> m_sinks;
87
Q_DECLARE_INTERFACE(Phonon::Xine::SourceNode, "XineSourceNode.phonon.kde.org")
89
inline QDebug operator<<(QDebug &s, const Phonon::Xine::SourceNodeXT *const node)
91
if (node->className) {
92
s.nospace() << node->className << '(' << static_cast<const void *>(node) << ')';
94
s.nospace() << "no classname: " << static_cast<const void *>(node);
99
#endif // SOURCENODE_H