blob: 98aca744fd6d5a08ccc586fa93924b7b01839c74 [file] [log] [blame]
niklase@google.com77ae29b2011-05-30 11:22:19 +00001#ifndef RTCWEB_H
2#define RTCWEB_H
3
4
5class StateNotifier
6{
7
8public:
9
10 // Called when the state of the session changes.
11 // INIT->SENT_OFFER->RECEIVED_ANSWER->INPROGRESS->TERMINATED
12 virtual void onStateChange(int newState, char * stateInfo)=0;
13};
14
15
16
17class Session
18{
19public:
20
21 static Session * create(char* id, StateNotifier & obj);
22
23
24 // generates a session description
25 virtual int generateLocalDescription(char * desc, int maxLen) = 0;
26
27 // configures the local media options
28 virtual int setLocalDescription(char * desc, int maxLenDesc, char * type, int maxLenType) = 0;
29
30 // configures the remote media options
31 virtual int setRemoteDescription(char * desc, int maxLenDesc, char * type, int maxLenType) = 0;
32
33 // Starts or stops sending/receiving media.
34 virtual int enable(bool enable) = 0;
35
36 // Mutes or unmutes the sending of media.
37 virtual int mute(char * media, int maxLen, bool mute) = 0;
38
39 // Sends a DTMF tone (for use telephony situations)
40 virtual int sendDTMF(int event) = 0;
41
42 // Adds an additional stream to the session (for multi-user)
43 virtual int addStream(char * media, int maxLen, int source) = 0;
44
45 // Removes a stream from the session.
46 virtual int removeStream(char * media, int maxLen, int source) = 0;
47
48 // Gets a URL for a given stream that can be used by
49 // <video> or another playout destination. The default
50 // stream can be obtained by passing “0”.
51 virtual int getStreamURL(char * media, int maxLen, int source) = 0;
52
53};
54
55
56
57#endif // RTCWEB_H