1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-11-27 04:34:42 +01:00
libtgvoip/PacketReassembler.h
Grishka b1a0b3d94a 2.3
- Nonblocking sockets
- Better ShittyInternetMode
- Fixed a bunch of bugs
- Probably added some new bugs too
2018-11-09 18:44:01 +03:00

32 lines
688 B
C++

//
// Created by Grishka on 19.03.2018.
//
#ifndef TGVOIP_PACKETREASSEMBLER_H
#define TGVOIP_PACKETREASSEMBLER_H
#include <vector>
#include <functional>
#include "Buffers.h"
namespace tgvoip {
class PacketReassembler{
public:
PacketReassembler();
virtual ~PacketReassembler();
void Reset();
void AddFragment(Buffer pkt, unsigned int fragmentIndex, unsigned int fragmentCount, uint32_t pts);
void SetCallback(std::function<void(Buffer packet, uint32_t pts)> callback);
private:
uint32_t currentTimestamp;
unsigned int currentPacketPartCount=0;
std::vector<Buffer> parts;
std::function<void(Buffer, uint32_t)> callback;
};
}
#endif //TGVOIP_PACKETREASSEMBLER_H