source: trunk/src/3rdparty/phonon/gstreamer/devicemanager.h@ 757

Last change on this file since 757 was 2, checked in by Dmitry A. Kuminov, 17 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 2.2 KB
Line 
1/* This file is part of the KDE project.
2
3 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
5 This library is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 2.1 or 3 of the License.
8
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
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this library. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef Phonon_GSTREAMER_DEVICEMANAGER_H
19#define Phonon_GSTREAMER_DEVICEMANAGER_H
20
21#include "common.h"
22
23#include <phonon/audiooutputinterface.h>
24
25#include <QtCore/QObject>
26#include <QtCore/QTimer>
27
28#include <gst/gst.h>
29
30QT_BEGIN_NAMESPACE
31
32namespace Phonon {
33namespace Gstreamer {
34class Backend;
35class DeviceManager;
36class AbstractRenderer;
37class VideoWidget;
38
39class AudioDevice {
40public :
41 AudioDevice(DeviceManager *s, const QByteArray &deviceId);
42 int id;
43 QByteArray gstId;
44 QByteArray description;
45};
46
47class DeviceManager : public QObject {
48 Q_OBJECT
49public:
50 DeviceManager(Backend *parent);
51 virtual ~DeviceManager();
52 const QList<AudioDevice> audioOutputDevices() const;
53 GstPad *requestPad(int device) const;
54 int deviceId(const QByteArray &gstId) const;
55 QByteArray deviceDescription(int id) const;
56 GstElement *createGNOMEAudioSink(Category category);
57 GstElement *createAudioSink(Category category = NoCategory);
58 AbstractRenderer *createVideoRenderer(VideoWidget *parent);
59
60signals:
61 void deviceAdded(int);
62 void deviceRemoved(int);
63
64public slots:
65 void updateDeviceList();
66
67private:
68 bool canOpenDevice(GstElement *element) const;
69 Backend *m_backend;
70 QList <AudioDevice> m_audioDeviceList;
71 QTimer m_devicePollTimer;
72 QByteArray m_audioSink;
73 QByteArray m_videoSinkWidget;
74};
75}
76} // namespace Phonon::Gstreamer
77
78QT_END_NAMESPACE
79
80#endif // Phonon_GSTREAMER_DEVICEMANAGER_H
Note: See TracBrowser for help on using the repository browser.