1
/* This file is part of the KDE project.
3
Copyright (C) 2011 Trever Fischer <tdfischer@fedoraproject.org>
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.
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.
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/>.
18
#ifndef Phonon_GSTREAMER_PLUGININSTALLER_H
19
#define Phonon_GSTREAMER_PLUGININSTALLER_H
21
#include <QtCore/QObject>
22
#include <QtCore/QHash>
23
#include <gst/gstcaps.h>
24
#include <gst/pbutils/install-plugins.h>
25
#include "phonon-config-gstreamer.h"
36
* A class to help with installing missing gstreamer plugins
39
class PluginInstaller : public QObject {
58
PluginInstaller(QObject *parent = 0);
60
void addPlugin(const QString &name, PluginType type);
61
void addPlugin(const GstCaps *caps, PluginType type);
63
InstallStatus checkInstalledPlugins();
64
#ifdef PLUGIN_INSTALL_API
65
static void pluginInstallationDone(GstInstallPluginsReturn result, gpointer data);
66
void pluginInstallationResult(GstInstallPluginsReturn result);
72
* Returns the translated, user-friendly string that describes a plugin
74
static QString description(const gchar *name, PluginType type);
75
static QString description(const GstCaps *caps, PluginType type);
77
static QString getCapType(const GstCaps *caps);
80
* Builds a string suitable for passing to gst_install_plugins_*
82
static QString buildInstallationString(const gchar *name, PluginType type);
83
static QString buildInstallationString(const GstCaps *caps, PluginType type);
88
void failure(const QString &message);
91
QHash<QString, PluginType> m_pluginList;
92
QHash<GstCaps *, PluginType> m_capList;
102
#endif // Phonon_GSTREAMER_PLUGININSTALLER_H