1
/****************************************************************************
5
** Copyright © 2012 Ruslan Nigmatullin <euroelessar@yandex.ru>
7
*****************************************************************************
9
** $JREEN_BEGIN_LICENSE$
10
** This program is free software: you can redistribute it and/or modify
11
** it under the terms of the GNU General Public License as published by
12
** the Free Software Foundation, either version 2 of the License, or
13
** (at your option) any later version.
15
** This program is distributed in the hope that it will be useful,
16
** but WITHOUT ANY WARRANTY; without even the implied warranty of
17
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
** See the GNU General Public License for more details.
20
** You should have received a copy of the GNU General Public License
21
** along with this program. If not, see http://www.gnu.org/licenses/.
22
** $JREEN_END_LICENSE$
24
****************************************************************************/
26
#ifndef JINGLEAUDIOCONTENT_H
27
#define JINGLEAUDIOCONTENT_H
29
#include "jinglecontent.h"
30
#include "jingleaudiopayload.h"
35
class JingleAudioContentPrivate;
36
class JingleAudioCodecFactory;
38
class JREEN_EXPORT JingleAudioContent : public JingleContent
41
Q_DECLARE_PRIVATE(JingleAudioContent)
43
JingleAudioContent(JingleSession *session);
44
~JingleAudioContent();
46
JingleAudioPayload currentPayload() const;
47
int currentPayloadFrameSize() const;
48
QIODevice *audioDevice() const;
50
virtual JingleDescription::Ptr defaultDescription();
51
virtual JingleDescription::Ptr handleDescription(const JingleDescription::Ptr &description);
53
static void registerCodec(JingleAudioCodecFactory *factory);
56
virtual void receive(int component, const QByteArray &data);
59
void payloadChoosed(const Jreen::JingleAudioPayload &payload);
62
class JREEN_EXPORT JingleAudioCodec
65
virtual ~JingleAudioCodec() {}
67
virtual int frameSize() const = 0;
68
virtual QByteArray encodeFrame(const char *data, int size) = 0;
69
virtual QByteArray decodeFrame(const char *data, int size) = 0;
72
class JREEN_EXPORT JingleAudioCodecFactory
75
virtual ~JingleAudioCodecFactory() {}
76
virtual QList<JingleAudioPayload> supportedPayloads() = 0;
77
virtual bool supportsPayload(const JingleAudioPayload &payload) = 0;
78
virtual JingleAudioCodec *createCodec(const JingleAudioPayload &payload) = 0;
83
Q_DECLARE_INTERFACE(Jreen::JingleAudioCodecFactory, "org.qutim.Jreen.Jingle.AudioCodecFactory")
85
#endif // JINGLEAUDIOCONTENT_H