~ubuntu-branches/ubuntu/natty/phonon/natty

« back to all changes in this revision

Viewing changes to phonon/mediaobject.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2011-01-24 10:12:11 UTC
  • mfrom: (0.5.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110124101211-w9rew7q0dmwbwhqx
Tags: 4:4.7.0really4.4.4-0ubuntu1
* New upstream release
* Xine and GStreamer backends now split out source, remove build-deps and
  binary packages from debian/control
* Remove 02_no_rpath.patch, now upstream
* Disable kubuntu04_no_va_mangle.patch, no longer applies
* Remove kubuntu_05_gst_codec_installer_window_id.diff, kubuntu_06_forward_events.diff,
  kubuntu_07_include_fix.diff, gstreamer now separate

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    License as published by the Free Software Foundation; either
7
7
    version 2.1 of the License, or (at your option) version 3, or any
8
8
    later version accepted by the membership of KDE e.V. (or its
9
 
    successor approved by the membership of KDE e.V.), Nokia Corporation 
 
9
    successor approved by the membership of KDE e.V.), Nokia Corporation
10
10
    (or its successors, if any) and the KDE Free Qt Foundation, which shall
11
11
    act as a proxy defined in Section 6 of version 3 of the license.
12
12
 
15
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
16
    Lesser General Public License for more details.
17
17
 
18
 
    You should have received a copy of the GNU Lesser General Public 
 
18
    You should have received a copy of the GNU Lesser General Public
19
19
    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
20
20
 
21
21
*/
254
254
    if (d->mediaSource.type() == MediaSource::Stream) {
255
255
        Q_ASSERT(d->mediaSource.stream());
256
256
        d->mediaSource.stream()->d_func()->setMediaObjectPrivate(d);
257
 
    } 
 
257
    }
258
258
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
259
259
 
260
260
    INTERFACE_CALL(setSource(d->mediaSource));
453
453
    Q_ASSERT(m_backendObject);
454
454
    //pDebug() << Q_FUNC_INFO;
455
455
 
 
456
    // Queue the stateChanged connection to prevent issues with Amarok's engine controller.
 
457
    // On error Amarok's engine controller will delete the MediaObject, meaning if
 
458
    // the error state was emitted from the same thread it will destroy the backend's
 
459
    // MediaObject *while* it is doing something.
 
460
    // By queuing the connection the MediaObject can finish whatever it is doing
 
461
    // before Amarok starts doing nasty things to us.
456
462
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
457
 
    QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SLOT(_k_stateChanged(Phonon::State, Phonon::State)));
 
463
    QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SLOT(_k_stateChanged(Phonon::State, Phonon::State)), Qt::QueuedConnection);
458
464
#else
459
 
    QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SIGNAL(stateChanged(Phonon::State, Phonon::State)));
 
465
    QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SIGNAL(stateChanged(Phonon::State, Phonon::State)), Qt::QueuedConnection);
460
466
#endif // QT_NO_PHONON_ABSTRACTMEDIASTREAM
461
467
    QObject::connect(m_backendObject, SIGNAL(tick(qint64)),             q, SIGNAL(tick(qint64)));
462
468
    QObject::connect(m_backendObject, SIGNAL(seekableChanged(bool)),    q, SIGNAL(seekableChanged(bool)));
464
470
    QObject::connect(m_backendObject, SIGNAL(hasVideoChanged(bool)),    q, SIGNAL(hasVideoChanged(bool)));
465
471
#endif //QT_NO_PHONON_VIDEO
466
472
    QObject::connect(m_backendObject, SIGNAL(bufferStatus(int)),        q, SIGNAL(bufferStatus(int)));
467
 
    QObject::connect(m_backendObject, SIGNAL(finished()),               q, SIGNAL(finished()));
 
473
    QObject::connect(m_backendObject, SIGNAL(finished()),               q, SIGNAL(finished()), Qt::QueuedConnection);
468
474
    QObject::connect(m_backendObject, SIGNAL(aboutToFinish()),          q, SLOT(_k_aboutToFinish()));
469
475
    QObject::connect(m_backendObject, SIGNAL(prefinishMarkReached(qint32)), q, SIGNAL(prefinishMarkReached(qint32)));
470
476
    QObject::connect(m_backendObject, SIGNAL(totalTimeChanged(qint64)), q, SIGNAL(totalTimeChanged(qint64)));
471
477
    QObject::connect(m_backendObject, SIGNAL(metaDataChanged(const QMultiMap<QString, QString> &)),
472
478
            q, SLOT(_k_metaDataChanged(const QMultiMap<QString, QString> &)));
473
 
    QObject::connect(m_backendObject, SIGNAL(currentSourceChanged(const MediaSource&)), 
 
479
    QObject::connect(m_backendObject, SIGNAL(currentSourceChanged(const MediaSource&)),
474
480
        q, SLOT(_k_currentSourceChanged(const MediaSource&)));
475
481
 
476
482
    // set up attributes