1
#ifndef JINGLE_RTP_SESSION_H
2
#define JINGLE_RTP_SESSION_H
13
class JingleRtpSession : public QObject
19
* In = for data coming in.
20
* Out = for data going out.
22
enum Direction {In = 0, Out};
25
* Creates a new RTP session with direction dir.
27
JingleRtpSession(Direction dir);
30
* Destroys the RTP sessions and frees all allocated memory.
35
* Sets the socket as RTP socket. This socket must be connected to a host.
36
* It will create the RTCP socket on port rtcpPort if set, RTP socket port + 1 if not.
38
void setRtpSocket(QAbstractSocket*, int rtcpPort = 0);
41
* Create UDP sockets with the given address and ports respectively for RTP and RTCP.
42
* If rtcpPort is not set, rtpPort + 1 will be used.
44
void connectToHost(const QString& address, int rtpPort, int rtcpPort = 0);
47
* Binds sockets to any address on ports rtpPort and rtcpPort for respectively RTP and RTCP.
48
* If rtcpPort is not set, rtpPort + 1 will be used.
50
void bind(int rtpPort, int rtcpPort = 0);
53
* Sends data to the remote host after wrapping it in a RTP packet.
54
* TODO:There should be overloaded methods to support other data type (QString, const *char).
56
void send(const QByteArray& data);
59
* Sets the payload type used for this session.
60
* The argument is the payload type in a payload-type XML tag.
62
void setPayload(const QDomElement& payload);
64
void setMediaSession(MediaSession *mSession);
68
* Called when rtp data is ready to be read from the socket, we then wait
69
* for the media data to be extracted from the RTP packet by oRTP.
72
void rtcpDataReady(); // Maybe not used.
76
void readyRead(const QByteArray&);
79
QUdpSocket *rtpSocket;
80
QUdpSocket *rtcpSocket;
81
RtpSession *m_rtpSession;
84
enum State {SendingData = 0} state;
85
Direction m_direction;
88
MediaSession *m_mediaSession;