forked from ProgrammerAndHacker/media-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPCAPTransportEmulator.h
63 lines (51 loc) · 1.45 KB
/
PCAPTransportEmulator.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: PCAPTransportEmulator.h
* Author: Sergio
*
* Created on 12 de julio de 2018, 15:45
*/
#ifndef PCAPTRANSPORTEMULATOR_H
#define PCAPTRANSPORTEMULATOR_H
#include "config.h"
#include "rtp.h"
#include "PCAPReader.h"
#include "EventLoop.h"
class PCAPTransportEmulator :
public RTPReceiver
{
public:
PCAPTransportEmulator();
virtual ~PCAPTransportEmulator();
void SetRemoteProperties(const Properties& properties);
bool AddIncomingSourceGroup(RTPIncomingSourceGroup *group);
bool RemoveIncomingSourceGroup(RTPIncomingSourceGroup *group);
bool Open(const char* filename);
bool SetReader(UDPReader* reader);
bool Play();
uint64_t Seek(uint64_t time);
bool Stop();
bool Close();
// RTPReceiver interface
virtual int SendPLI(DWORD ssrc) override { return 1; }
TimeService& GetTimeService() { return loop; }
private:
int Run();
RTPIncomingSourceGroup* GetIncomingSourceGroup(DWORD ssrc);
RTPIncomingSource* GetIncomingSource(DWORD ssrc);
private:
EventLoop loop;
std::unique_ptr<UDPReader> reader;
RTPMap rtpMap;
RTPMap extMap;
RTPMap aptMap;
std::map<DWORD,RTPIncomingSourceGroup*> incoming;
std::map<MediaFrame::Type, RTPIncomingSourceGroup*> unknow;
uint64_t first = 0;
volatile bool running = false;;
};
#endif /* PCAPTRANSPORTEMULATOR_H */