File indexing completed on 2024-05-05 04:44:41

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2005-2007 Matthias Kretz <kretz@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) version 3, or any
0008     later version accepted by the membership of KDE e.V. (or its
0009     successor approved by the membership of KDE e.V.), Nokia Corporation
0010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
0011     act as a proxy defined in Section 6 of version 3 of the license.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Lesser General Public License for more details.
0017 
0018     You should have received a copy of the GNU Lesser General Public
0019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0020 
0021 */
0022 #include "videodataoutput.h"
0023 #include "videodataoutput_p.h"
0024 #include "factory_p.h"
0025 #include <QSize>
0026 #include "videoframe2.h"
0027 
0028 #define PHONON_CLASSNAME VideoDataOutput
0029 
0030 namespace Phonon
0031 {
0032 namespace Experimental
0033 {
0034 
0035 VideoDataOutput::VideoDataOutput(QObject *parent)
0036     : QObject(parent)
0037     , AbstractVideoOutput(*new VideoDataOutputPrivate)
0038 {
0039     P_D(VideoDataOutput);
0040     d->createBackendObject();
0041 }
0042 
0043 void VideoDataOutputPrivate::createBackendObject()
0044 {
0045     if (m_backendObject)
0046         return;
0047     P_Q(VideoDataOutput);
0048     m_backendObject = Factory::createVideoDataOutput(q);
0049     if (m_backendObject) {
0050         setupBackendObject();
0051     }
0052 }
0053 
0054 
0055 PHONON_GETTER(int, latency, d->latency)
0056 
0057 bool VideoDataOutputPrivate::aboutToDeleteBackendObject()
0058 {
0059     Q_ASSERT(m_backendObject);
0060 
0061     return AbstractVideoOutputPrivate::aboutToDeleteBackendObject();
0062 }
0063 
0064 void VideoDataOutputPrivate::setupBackendObject()
0065 {
0066     P_Q(VideoDataOutput);
0067     Q_ASSERT(m_backendObject);
0068     //AbstractVideoOutputPrivate::setupBackendObject();
0069 
0070     //QObject::connect(m_backendObject, SIGNAL(frameReady(Phonon::Experimental::VideoFrame)),
0071     //        q, SIGNAL(frameReady(Phonon::Experimental::VideoFrame)));
0072 
0073     QObject::connect(m_backendObject, SIGNAL(displayFrame(qint64,qint64)),
0074                      q, SIGNAL(displayFrame(qint64,qint64)));
0075     QObject::connect(m_backendObject, SIGNAL(endOfMedia()), q, SIGNAL(endOfMedia()));
0076 }
0077 
0078 bool VideoDataOutput::isRunning() const
0079 {
0080      //P_D(const VideoDataOutput);
0081      //return d->m_backendObject->isRunning();
0082      return false;
0083 }
0084 
0085 VideoFrame VideoDataOutput::frameForTime(qint64 timestamp)
0086 {
0087     Q_UNUSED(timestamp);
0088 
0089     //return d->m_backendObject->frameForTime(timestamp);
0090     return VideoFrame();
0091 }
0092 
0093 void VideoDataOutput::setRunning(bool running)
0094 {
0095     Q_UNUSED(running);
0096 
0097     //return d->m_backendObject->setRunning(running);
0098 }
0099 
0100 void VideoDataOutput::start()
0101 {
0102     //return d->m_backendObject->setRunning(true);
0103 }
0104 
0105 void VideoDataOutput::stop()
0106 {
0107     //return d->m_backendObject->setRunning(false);
0108 }
0109 
0110 } // namespace Experimental
0111 } // namespace Phonon
0112 
0113 #undef PHONON_CLASSNAME
0114 // vim: sw=4 ts=4 tw=80