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

Last change on this file was 846, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 2.3 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 QString icon;
46};
47
48class DeviceManager : public QObject {
49 Q_OBJECT
50public:
51 DeviceManager(Backend *parent);
52 virtual ~DeviceManager();
53 const QList<AudioDevice> audioOutputDevices() const;
54 GstPad *requestPad(int device) const;
55 int allocateDeviceId();
56 int deviceId(const QByteArray &gstId) const;
57 const QByteArray gstId(int id);
58 AudioDevice* audioDevice(int id);
59 GstElement *createGNOMEAudioSink(Category category);
60 GstElement *createAudioSink(Category category = NoCategory);
61 AbstractRenderer *createVideoRenderer(VideoWidget *parent);
62
63signals:
64 void deviceAdded(int);
65 void deviceRemoved(int);
66
67public slots:
68 void updateDeviceList();
69
70private:
71 bool canOpenDevice(GstElement *element) const;
72 Backend *m_backend;
73 QList <AudioDevice> m_audioDeviceList;
74 int m_audioDeviceCounter;
75 QTimer m_devicePollTimer;
76 QByteArray m_audioSink;
77 QByteArray m_videoSinkWidget;
78};
79}
80} // namespace Phonon::Gstreamer
81
82QT_END_NAMESPACE
83
84#endif // Phonon_GSTREAMER_DEVICEMANAGER_H
Note: See TracBrowser for help on using the repository browser.