1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include "qmediaservice.h"
41#include "qmediaservice_p.h"
42
43#include <QtCore/qtimer.h>
44
45
46
47QT_BEGIN_NAMESPACE
48
49
50/*!
51 \class QMediaService
52 \obsolete
53 \brief The QMediaService class provides a common base class for media
54 service implementations.
55 \ingroup multimedia
56 \ingroup multimedia_control
57 \ingroup multimedia_core
58 \inmodule QtMultimedia
59
60 Media services provide implementations of the functionality promised
61 by media objects, and allow multiple providers to implement a QMediaObject.
62
63 To provide the functionality of a QMediaObject media services implement
64 QMediaControl interfaces. Services typically implement one core media
65 control which provides the core feature of a media object, and some
66 number of additional controls which provide either optional features of
67 the media object, or features of a secondary media object or peripheral
68 object.
69
70 A pointer to media service's QMediaControl implementation can be obtained
71 by passing the control's interface name to the requestControl() function.
72
73 \snippet multimedia-snippets/media.cpp Request control
74
75 Media objects can use services loaded dynamically from plug-ins or
76 implemented statically within an applications. Plug-in based services
77 should also implement the QMediaServiceProviderPlugin interface. Static
78 services should implement the QMediaServiceProvider interface. In general,
79 implementing a QMediaService is outside of the scope of this documentation
80 and support on the relevant mailing lists or IRC channels should be sought.
81
82 \sa QMediaObject, QMediaControl
83*/
84
85/*!
86 Construct a media service with the given \a parent. This class is meant as a
87 base class for Multimedia services so this constructor is protected.
88*/
89
90QMediaService::QMediaService(QObject *parent)
91 : QObject(*new QMediaServicePrivate, parent)
92{
93}
94
95/*!
96 \internal
97*/
98QMediaService::QMediaService(QMediaServicePrivate &dd, QObject *parent)
99 : QObject(dd, parent)
100{
101}
102
103/*!
104 Destroys a media service.
105*/
106
107QMediaService::~QMediaService()
108{
109}
110
111/*!
112 \fn QMediaControl* QMediaService::requestControl(const char *interface)
113
114 Returns a pointer to the media control implementing \a interface.
115
116 If the service does not implement the control, or if it is unavailable a
117 null pointer is returned instead.
118
119 Controls must be returned to the service when no longer needed using the
120 releaseControl() function.
121*/
122
123/*!
124 \fn T QMediaService::requestControl()
125
126 Returns a pointer to the media control of type T implemented by a media service.
127
128 If the service does not implement the control, or if it is unavailable a
129 null pointer is returned instead.
130
131 Controls must be returned to the service when no longer needed using the
132 releaseControl() function.
133*/
134
135/*!
136 \fn void QMediaService::releaseControl(QMediaControl *control);
137
138 Releases a \a control back to the service.
139*/
140
141QT_END_NAMESPACE
142
143#include "moc_qmediaservice.cpp"
144

source code of qtmultimedia/src/multimedia/qmediaservice.cpp