using namespace std;
-Reorderer::Reorderer(Protocol* sender)
+Reorderer::Reorderer(Sender* sender)
: sender(sender), last_seq(-1)
{
}
-void Reorderer::handle_packet(uint16_t proto, const string& data, int seq)
+void Reorderer::send_packet(uint16_t proto, const string& data, int seq)
{
bool silence = false;
if (packet_buffer.size() >= PACKET_BUFFER_SIZE) {
// printf("seq=%d\n", front_seq);
//}
const string &data = packet_buffer.top().data;
- send_packet(packet_buffer.top().proto, data, silence);
+ check_ts_discontinuity(packet_buffer.top().proto, data, silence);
+ sender->send_packet(proto, data, seq);
packet_buffer.pop();
last_seq = front_seq;
if (!silence && !packet_buffer.empty()) {
}
}
-void Reorderer::send_packet(uint16_t proto, const string &data, bool silence)
+void Reorderer::check_ts_discontinuity(uint16_t proto, const string &data, bool silence)
{
if (data.size() == 1344) {
for (int i = 0; i < 7; ++i) {
}
}
}
- sender->send_packet(proto, data);
}