~oem-solutions-group/unity-2d/phonon

« back to all changes in this revision

Viewing changes to qt7/backendheader.h

  • Committer: Alex Chiang
  • Date: 2011-04-12 15:51:11 UTC
  • Revision ID: achiang@canonical.com-20110412155111-n3oq9x9w9f2yt4xk
* New upstream release
* Switch to source format 3.0 (quilt)
* Bump the Breaks version too. I really should have test installed that.
* Bump version number so that the phonon packages are installable
* Sync with Debian, now packaging separately from Qt since QtWebKit is also packaged separately
* Bump version number to match ours
* Bump Qt build-depends to 4.7
* Update symbol file for armel, fixes FTBFS.
* New upstream release:
 - fixes crash when opening PDF document (Closes: #580802);
* Add debian/watch.
* Update patches:
  - refresh 01 and 02;
  - adapt 03 to upstream changes;
  - remove 04, was stolen from upstream.
* Use dh_xine, version libxine-dev build dependency to >= 1.1.16.3
  (Closes: #575115).
* Update libphonon4 symbol file.
* Add ${misc:Depends} to phonon-backend-null.
* Update libphonon-dev.install: ship new style CamelCase headers in
  /usr/include/phonon.
* Make libphonon-dev depend on libqt4-dev.
* Manually create /usr/include/qt4/phonon symlink on upgrades.
  See #404850 why dpkg does not create it by itself.
* Urgency high as the bug leaves Phonon undiscoverable by KDE
  FindPhonon.cmake after upgrade and the buggy libphonon-dev is already in
  testing.
* phonon-backend-gstreamer: depend on gstreamer0.10-alsa only on Linux
  architectures, as ALSA is available only there. (Closes: #578255)
* Upload to unstable.
* New upstream release (4.4.0).
* Add 04_skip_pa_detection_if_no_glib_loop.diff patch which fixes phonon
  hang if GLib loop is disabled in Qt.
* Refresh patches.
* Update libphonon4 symbol file.
* Update libphonon-dev.install: add pulsesupport.h.
* Override lintian "phonon-backend-null: empty-binary-package".
* Add explicit debian/source/format as lintian suggests.
* New upstream release (using really-style version number).
* Build Phonon from kdesupport again:
  - Add phonon, phonon-dbg, libphonon4 and libphonon-dev packages.
* Remove patches:
  - 02_disable_phonon_build.diff - dropped.
  - 03_r950739_fullscreen_hidecursor.diff - stolen upstream.
  - 05_924144_encoding_local_files_fix.diff - stolen upstream.
  - 06_983650_play_filenames_with_hash.diff - stolen upstream.
  - 07_feature_backport_xine_equalizer.diff - stolen upstream.
* Update debian/control:
  - Bump build dependencies (debhelper and pkg-kde-tools).
  - Add libpulse-dev build dependency.
  - Remove libphonon-dev build dependency.
  - Bump Standards-Version from 3.8.2 to 3.8.4 (no changes needed).
* Remove myself from Uploaders.
* Change my email address to modax@debian.org in Uploaders field.
* Fix Vcs-Browser URL.
* Improve descriptions.
* Downgrade Qt build dependency to 4.5.
* Bump version to 4:4.6.0really4.3.80 to be higher than the last
  release of the Phonon libraries with the qt4-x11 source package.
* Convert libphonon4.symbols to new pkg-kde-tools 0.6 style, adjust
  for 4.3.80 release.
* Do not install "experimental" headers to libphonon-dev.
* Add libphonon4 lintian overrides for
  {shlibs,symbols}-declares-dependency-on-other-package warnings.
* Add 02_no_rpath.patch patch to disable /usr/lib RPATH by default.
* Add DEP-3 patch header to 01_phonon-inc.patch.
* Tweak copyright file a bit so lintian stops thinking it's of
  old-dh-make style. Also bump years of packaging copyright.
* Add phonon-backends-dbg to phonon-dbg Conflicts and Replaces.
* Do not version dependency on the phonon metapackage.
* Use strict interdependencies among backends and libphonon4.
* Build depend on dpkg-dev 1.15.5.
* Make libphonon4 break phonon-backend-xine (<< 4:4.6.0really4.3.80).
* Fix installing of include headers so that others can also find them.
+++ Changes by Modestas Vainius:
* Rename source package to phonon-backends.
* Add phonon-backends-dbg debug package.
* Add patch (06_983650_play_filenames_with_hash.diff) to fix playback of
  files with hash (#) symbol in their name (Closes: #546271).
* Backport Xine equalizer support from Phonon trunk (patch
  07_feature_backport_xine_equalizer.diff).
+++ Changes by Modestas Vainius:
* Install backends to /usr/lib/qt4 (Closes: #539623). Otherwise pure Qt4
  applications cannot find any backends.
+++ Changes by Sune Vuorela:
* Backport a bugfix from upstream to fix encoding issues with filenames.
* Fix not-installed file and remove trailing whitespaces
+++ Changes by Fathi Boudra:
* Add gstreamer0.10-alsa dependency to phonon-backend-gstreamer.
  (Closes: #532490)
+++ Changes by Modestas Vainius:
* Add 03_r950739_fullscreen_hidecursor.diff patch which makes it possible
  to hide mouse cursor in fullscreen mode when xine backend is in use.
* Build Phonon from Qt sources:
  - Add myself to Uploaders field.
  - Add 02_disable_phonon_build.diff to avoid Phonon build.
  - Add versioned libphonon-dev build dependency.
  - Bump Standards-Version from 3.8.1 to 3.8.2 (no changes needed).
  - Remove phonon, phonon-dbg, libphonon4 and libphonon-dev packages.
  - Cleanup unnecessary files.
* New upstream release.
+++ Changes by Modestas Vainius:
* Point Debian Vcs URLs to pkg-kde/trunk (new location).
+++ Changes by Modestas Vainius
* Bump debian/compat and debhelper build dependency to v7 (to get more
  sophisticated debian/tmp handling).
* Switch from internal debian/cdbs/kde.mk to pkg-kde-tools:
  - bump pkg-kde-tools build depend to 0.4;
  - remove debian/cdbs directory;
  - replace debian/cdbs/kde.mk with
    /usr/share/pkg-kde-tools/qt-kde-team/1/debian-qt-kde.mk in debian/rules;
  - remove custom symbolshelper rules from debian/rules.
* Remove THIS_SHOULD_GO_TO_UNSTABLE from debian/rules.
* New upstream release.
+++ Changes by Modestas Vainius:
* Add xine backend. Based on kdebase-runtime packaging.
* Make xine backend a default one (via phonon metapackage).
* Bump cmake build dependency to 2.6.2.
* Bump Standards-Version to 3.8.0: add README.source.
* phonon-xine-backend replaces earlier kde-icons-oxygen.
* Add symbols file for libphonon4. This needs pkg-kde-tools (>= 0.3)
  at build time.
  - Hook up phonon dependency to play(), stop(), pause() etc. methods.
* Resync patches:
  - drop phonon-libraryPaths.patch patch. Merged upstream.
  - prepend sequence number to phonon-inc.patch (01_) and refresh it.
* Switch to new installgen format.
* Make phonon-backend-xine depend on gstreamer0.10-plugins-base. Otherwise,
  it causes crashes sometimes.
* Make phonon-backend-gstreamer recommend gstreamer0.10-plugins-good and
  suggest gstreamer0.10-plugins-ugly. Explain reasoning in the package 
  description.
+++ Changes by George Kiagiadakis:
* Build-conflict with the experimental libxine2 as the
  phonon-xine backend cannot build with it.
+++ Changes by Pino Toscano:
* Update copyright file.
+++ Changes by Ana Beatriz Guerrero Lopez:
* Update packaging years and upstream URL in copyright. 
* Make phonon find its backends. (Closes: 498573)
  Thanks to Vincent Fourmond for tracking down the cause and Matthias Kretz
  for the fix.
* Create a magic phonon header (thanks to Matthias Kretz) and as the Qt.
  documentation is unclear, symlink Phonon to the phonon header.
  Also create a symlink from /usr/include/qt4/phonon to /usr/include/phonon
  so that application using qmake can use it.
* New upstream release.
+++ Changes by Modestas Vainius:
* Bump libphonon shlibs to 4.2.0.

* New snapshot, upload to unstable. 
+++ Changes by Modestas Vainius:
* Exclude phonon metapackage from automatic shlibdeps because libphonon4
  itself ended up depending on it somehow.
+++ Changes by Ana Beatriz Guerrero Lopez:
* Update copyright file and write the BSD license instead of pointing at it.
* Replace the N/A stuff with some more meaningful (unspecified).
+++ Changes by Ana Guerrero, Modestas Vainius, Pino Toscano and Sune Vuorela:
* First release. This has been split out from kde4libs.
* Add support for Phonon backends:
  - Make the phonon-backend-gstreamer provide a virtual phonon-backend.
  - Create a phonon metapackage that installs the phonon library and ensure
    a backend is installed too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_QT7_BACKENDHEADER_H
 
19
#define Phonon_QT7_BACKENDHEADER_H
 
20
 
 
21
#include <QtCore/QString>
 
22
#import <Foundation/NSAutoreleasePool.h>
 
23
#include <CoreFoundation/CFBase.h>
 
24
 
 
25
#ifndef Q_WS_MAC64
 
26
#define QUICKTIME_C_API_AVAILABLE
 
27
#endif
 
28
 
 
29
QT_BEGIN_NAMESPACE
 
30
 
 
31
namespace Phonon
 
32
{
 
33
namespace QT7
 
34
{
 
35
 
 
36
// Implemented in error.cpp:
 
37
void gSetErrorString(const QString &errorString);
 
38
QString gGetErrorString();
 
39
void gSetErrorLocation(const QString &errorLocation);
 
40
void gSetErrorType(int type);
 
41
int gGetErrorType();
 
42
void gClearError();
 
43
 
 
44
#define NO_ERROR 0
 
45
#define NORMAL_ERROR 1
 
46
#define FATAL_ERROR 2
 
47
 
 
48
#define ERROR_LOCATION                                              \
 
49
    QLatin1String("Function: ") + QLatin1String(__FUNCTION__)       \
 
50
    + QLatin1String(", File: ") + QLatin1String(__FILE__)           \
 
51
    + QLatin1String(", Line: ") + QString::number(__LINE__)
 
52
 
 
53
#define SET_ERROR(string, type){                                \
 
54
        Phonon::QT7::gSetErrorString(string);    \
 
55
        Phonon::QT7::gSetErrorType(type);                       \
 
56
        Phonon::QT7::gSetErrorLocation(ERROR_LOCATION); }
 
57
 
 
58
#define BACKEND_ASSERT(test, string, type)      \
 
59
    bool fail = !test;                          \
 
60
    if (fail)                                   \
 
61
        SET_ERROR(QLatin1String(string), type)  \
 
62
    if (fail)
 
63
 
 
64
#define BACKEND_ASSERT2(test, string, type)     \
 
65
    if (!(test)) {                              \
 
66
        SET_ERROR(QLatin1String(string), type)  \
 
67
        return;                                 \
 
68
    }
 
69
 
 
70
#define BACKEND_ASSERT3(test, string, type, ret)    \
 
71
    if (!(test)) {                                  \
 
72
        SET_ERROR(QLatin1String(string), type)      \
 
73
        return ret;                                 \
 
74
    }
 
75
 
 
76
#define ARGUMENT_UNSUPPORTED(a, x, type, ret)                           \
 
77
    if ((a) == (x)) {                                                   \
 
78
        SET_ERROR("Argument value not supported: "#a" == "#x, type);    \
 
79
        return ret;                                                     \
 
80
    }
 
81
 
 
82
#define CASE_UNSUPPORTED(string, type) SET_ERROR(string, type)
 
83
 
 
84
#ifdef SET_DEBUG_IMPLEMENTED
 
85
#define IMPLEMENTED qDebug() << "QT7:" << __FUNCTION__ << "(" << __FILE__ << "):"
 
86
#else
 
87
#define IMPLEMENTED if (1); else qDebug()
 
88
#endif
 
89
 
 
90
#ifdef SET_DEBUG_HALF_IMPLEMENTED
 
91
#define HALF_IMPLEMENTED qDebug() << "QT7: --- HALF IMPLEMENTED:" << __FUNCTION__ << "(" << __FILE__ << "," << __LINE__ << "):"
 
92
#else
 
93
#define HALF_IMPLEMENTED if (1); else qDebug()
 
94
#endif
 
95
 
 
96
#ifdef SET_DEBUG_NOT_IMPLEMENTED
 
97
#define NOT_IMPLEMENTED qDebug() << "QT7: *** NOT IMPLEMENTED:" << __FUNCTION__ << "(" << __FILE__ << "," << __LINE__ << "):"
 
98
#else
 
99
#define NOT_IMPLEMENTED if (1); else qDebug()
 
100
#endif
 
101
 
 
102
#ifdef SET_DEBUG_IMPLEMENTED_SILENT
 
103
#define IMPLEMENTED_SILENT qDebug() << "QT7: (silent)" << __FUNCTION__ << "(" << __FILE__ << "," << __LINE__ << "):"
 
104
#else
 
105
#define IMPLEMENTED_SILENT if (1); else qDebug()
 
106
#endif
 
107
 
 
108
#ifdef SET_DEBUG_AUDIO_GRAPH
 
109
#define DEBUG_AUDIO_GRAPH(x) qDebug() << "QT7 DEBUG GRAPH:" << x;
 
110
#else
 
111
#define DEBUG_AUDIO_GRAPH(x) {}
 
112
#endif
 
113
 
 
114
#ifdef SET_DEBUG_AUDIO_STREAM
 
115
#define DEBUG_AUDIO_STREAM(x) qDebug() << "QT7 DEBUG STREAM:" << x;
 
116
#else
 
117
#define DEBUG_AUDIO_STREAM(x) {}
 
118
#endif
 
119
 
 
120
/////////////////////////////////////////////////////////////////////////////////////////
 
121
 
 
122
class PhononAutoReleasePool
 
123
{
 
124
private:
 
125
    void *pool;
 
126
public:
 
127
    PhononAutoReleasePool();
 
128
    ~PhononAutoReleasePool();
 
129
};
 
130
 
 
131
/////////////////////////////////////////////////////////////////////////////////////////
 
132
 
 
133
template <typename T>
 
134
class PhononCFType
 
135
{
 
136
public:
 
137
    inline PhononCFType(const T &t = 0) : type(t) {}
 
138
    inline PhononCFType(const PhononCFType &helper) : type(helper.type) { if (type) CFRetain(type); }
 
139
    inline ~PhononCFType() { if (type) CFRelease(type); }
 
140
    inline operator T() { return type; }
 
141
    inline PhononCFType operator =(const PhononCFType &helper)
 
142
    {
 
143
        if (helper.type)
 
144
            CFRetain(helper.type);
 
145
        CFTypeRef type2 = type;
 
146
        type = helper.type;
 
147
        if (type2)
 
148
            CFRelease(type2);
 
149
        return *this;
 
150
    }
 
151
    inline T *operator&() { return &type; }
 
152
    static PhononCFType constructFromGet(const T &t)
 
153
    {
 
154
        CFRetain(t);
 
155
        return PhononCFType<T>(t);
 
156
    }
 
157
protected:
 
158
    T type;
 
159
};
 
160
 
 
161
/////////////////////////////////////////////////////////////////////////////////////////
 
162
 
 
163
class PhononCFString : public PhononCFType<CFStringRef>
 
164
{
 
165
public:
 
166
    inline PhononCFString(const QString &str) : PhononCFType<CFStringRef>(0), string(str) {}
 
167
    inline PhononCFString(const CFStringRef cfstr = 0) : PhononCFType<CFStringRef>(cfstr) {}
 
168
    inline PhononCFString(const PhononCFType<CFStringRef> &other) : PhononCFType<CFStringRef>(other) {}
 
169
    operator QString() const;
 
170
    operator CFStringRef() const;
 
171
    static QString toQString(CFStringRef cfstr);
 
172
    static CFStringRef toCFStringRef(const QString &str);
 
173
private:
 
174
    QString string;
 
175
};
 
176
}} //namespace Phonon::QT7
 
177
 
 
178
QT_END_NAMESPACE
 
179
 
 
180
#ifdef Q_CC_INTEL
 
181
#pragma warning (disable : 1899) // mute icc warning for the use of 4cc
 
182
#endif
 
183
 
 
184
#endif // Phonon_QT7_BACKENDHEADER_H