1
/* This file is part of the KDE project
2
Copyright (C) 2006 Matthias Kretz <kretz@kde.org>
3
Copyright (C) 2009 Martin Sandsmark <sandsmark@samfundet.no>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) version 3, or any
9
later version accepted by the membership of KDE e.V. (or its
10
successor approved by the membership of KDE e.V.), Nokia Corporation
11
(or its successors, if any) and the KDE Free Qt Foundation, which shall
12
act as a proxy defined in Section 6 of version 3 of the license.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library. If not, see <http://www.gnu.org/licenses/>.
23
#ifndef Phonon_GSTREAMER_AUDIODATAOUTPUT_H
24
#define Phonon_GSTREAMER_AUDIODATAOUTPUT_H
26
#include "abstractaudiooutput.h"
28
#include "medianode.h"
29
#include <phonon/audiodataoutput.h>
30
#include <phonon/audiodataoutputinterface.h>
40
* \author Martin Sandsmark <sandsmark@samfundet.no>
42
class AudioDataOutput : public QObject,
43
public AudioDataOutputInterface,
47
Q_INTERFACES(Phonon::AudioDataOutputInterface Phonon::Gstreamer::MediaNode)
50
AudioDataOutput(Backend *, QObject *);
55
int sampleRate() const;
56
void setDataSize(int size);
59
/// callback function for handling new audio data
60
static void processBuffer(GstPad*, GstBuffer*, gpointer);
62
Phonon::AudioDataOutput* frontendObject() const { return m_frontend; }
63
void setFrontendObject(Phonon::AudioDataOutput *frontend) { m_frontend = frontend; }
65
GstElement *audioElement() { return m_queue; }
67
void mediaNodeEvent(const MediaNodeEvent *event);
71
void dataReady(const QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> > &data);
72
void dataReady(const QMap<Phonon::AudioDataOutput::Channel, QVector<float> > &data);
73
void endOfMedia(int remainingSamples);
76
void convertAndEmit(const QVector<qint16>&, const QVector<qint16>&);
80
QVector<qint16> m_pendingData;
81
Phonon::AudioDataOutput *m_frontend;
84
}} //namespace Phonon::Gstreamer
89
// vim: sw=4 ts=4 tw=80
90
#endif // Phonon_FAKE_AUDIODATAOUTPUT_H