1/* This file is part of the KDE project
2 Copyright (C) 2005-2007 Matthias Kretz <kretz@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) version 3, or any
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
10 (or its successors, if any) and the KDE Free Qt Foundation, which shall
11 act as a proxy defined in Section 6 of version 3 of the license.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library. If not, see <http://www.gnu.org/licenses/>.
20
21*/
22#include "videodataoutput.h"
23#include "videodataoutput_p.h"
24#include "factory_p.h"
25#include <QSize>
26#include "videoframe2.h"
27
28#define PHONON_CLASSNAME VideoDataOutput
29
30namespace Phonon
31{
32namespace Experimental
33{
34
35VideoDataOutput::VideoDataOutput(QObject *parent)
36 : QObject(parent)
37 , AbstractVideoOutput(*new VideoDataOutputPrivate)
38{
39 P_D(VideoDataOutput);
40 d->createBackendObject();
41}
42
43void VideoDataOutputPrivate::createBackendObject()
44{
45 if (m_backendObject)
46 return;
47 P_Q(VideoDataOutput);
48 m_backendObject = Factory::createVideoDataOutput(parent: q);
49 if (m_backendObject) {
50 setupBackendObject();
51 }
52}
53
54
55PHONON_GETTER(int, latency, d->latency)
56
57bool VideoDataOutputPrivate::aboutToDeleteBackendObject()
58{
59 Q_ASSERT(m_backendObject);
60
61 return AbstractVideoOutputPrivate::aboutToDeleteBackendObject();
62}
63
64void VideoDataOutputPrivate::setupBackendObject()
65{
66 P_Q(VideoDataOutput);
67 Q_ASSERT(m_backendObject);
68 //AbstractVideoOutputPrivate::setupBackendObject();
69
70 //QObject::connect(m_backendObject, SIGNAL(frameReady(Phonon::Experimental::VideoFrame)),
71 // q, SIGNAL(frameReady(Phonon::Experimental::VideoFrame)));
72
73 QObject::connect(sender: m_backendObject, SIGNAL(displayFrame(qint64,qint64)),
74 receiver: q, SIGNAL(displayFrame(qint64,qint64)));
75 QObject::connect(sender: m_backendObject, SIGNAL(endOfMedia()), receiver: q, SIGNAL(endOfMedia()));
76}
77
78bool VideoDataOutput::isRunning() const
79{
80 //P_D(const VideoDataOutput);
81 //return d->m_backendObject->isRunning();
82 return false;
83}
84
85VideoFrame VideoDataOutput::frameForTime(qint64 timestamp)
86{
87 Q_UNUSED(timestamp);
88
89 //return d->m_backendObject->frameForTime(timestamp);
90 return VideoFrame();
91}
92
93void VideoDataOutput::setRunning(bool running)
94{
95 Q_UNUSED(running);
96
97 //return d->m_backendObject->setRunning(running);
98}
99
100void VideoDataOutput::start()
101{
102 //return d->m_backendObject->setRunning(true);
103}
104
105void VideoDataOutput::stop()
106{
107 //return d->m_backendObject->setRunning(false);
108}
109
110} // namespace Experimental
111} // namespace Phonon
112
113#undef PHONON_CLASSNAME
114// vim: sw=4 ts=4 tw=80
115

source code of phonon/phonon/experimental/videodataoutput.cpp