forked from ProgrammerAndHacker/media-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparticipant.h
93 lines (76 loc) · 1.85 KB
/
participant.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* File: participant.h
* Author: Sergio
*
* Created on 19 de enero de 2012, 18:29
*/
#ifndef PARTICIPANT_H
#define PARTICIPANT_H
#include "video.h"
#include "audio.h"
#include "text.h"
#include "rtpsession.h"
class Participant
{
public:
enum Type { RTP=0,RTMP=1 };
public:
class Listener
{
public:
//Virtual desctructor
virtual ~Listener(){};
public:
//Interface
virtual void onRequestFPU(Participant *part) = 0;
};
public:
Participant(Type type,int partId,const std::wstring &token) : token(token)
{
this->type = type;
this->partId = partId;
}
virtual ~Participant()
{
}
Type GetType()
{
return type;
}
void SetListener(Listener *listener)
{
//Store listener
this->listener = listener;
}
DWORD GetPartId()
{
return partId;
}
const std::wstring& GetToken()
{
return token;
}
virtual int SetVideoCodec(VideoCodec::Type codec,int mode,int fps,int bitrate,int intraPeriod,const Properties &properties) = 0;
virtual int SetAudioCodec(AudioCodec::Type codec,const Properties &properties) = 0;
virtual int SetTextCodec(TextCodec::Type codec) = 0;
virtual int SetVideoInput(VideoInput* input) = 0;
virtual int SetVideoOutput(VideoOutput* output) = 0;
virtual int SetAudioInput(AudioInput* input) = 0;
virtual int SetAudioOutput(AudioOutput *output) = 0;
virtual int SetTextInput(TextInput* input) = 0;
virtual int SetTextOutput(TextOutput* output) = 0;
virtual MediaStatistics GetStatistics(MediaFrame::Type media) = 0;
virtual int SetMute(MediaFrame::Type media, bool isMuted) = 0;
virtual int SendVideoFPU() = 0;
virtual int Init() = 0;
virtual int End() = 0;
void SetName(const std::wstring& name) { this->name.assign(name); }
std::wstring GetName() { return name; }
protected:
Type type;
Listener *listener;
DWORD partId;
std::wstring token;
std::wstring name;
};
#endif /* PARTICIPANT_H */