summaryrefslogtreecommitdiffstats
blob: bdb2861f9e2cf92d10372c99993dfc44ebeab1ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (c) 2012 Yoann Blein
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#pragma once

#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/Network/HostAddressPort.h>
#include <Swiften/Base/boost_bsignals.h>

#include <boost/shared_ptr.hpp>

namespace Swift {
	class UDPSocket;

	class RTPSession {
		public:
			typedef boost::shared_ptr<RTPSession> ref;

			enum PayloadType {
				VP8 = 98,
			};

		public:
			virtual ~RTPSession() {}

			virtual void create(boost::shared_ptr<UDPSocket> udpSocket, const HostAddressPort& remotePeer, PayloadType payloadType, int frequency) = 0;
			virtual void poll() = 0;
			virtual void checkIncomingPackets() = 0;
			virtual void sendPacket(const SafeByteArray& data, int timestampinc, bool marker = false) = 0;
			virtual void injectData(const SafeByteArray& data) = 0;
			virtual void stop(int maxWaitMs = 100) = 0;

		public:
			boost::signal<void (uint8_t* data, size_t len, bool marker)> onIncomingPacket;
	};
}