server: replay RemoteFX session in original time
This commit is contained in:
parent
c72ab1456d
commit
0c7abe3e57
@ -23,6 +23,7 @@
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
FREERDP_API void freerdp_sleep(uint32 seconds);
|
||||
FREERDP_API void freerdp_usleep(uint32 useconds);
|
||||
|
||||
#endif /* __SLEEP_UTILS_H */
|
||||
|
@ -28,6 +28,11 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
void freerdp_sleep(uint32 seconds)
|
||||
{
|
||||
sleep(seconds);
|
||||
}
|
||||
|
||||
void freerdp_usleep(uint32 useconds)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/utils/sleep.h>
|
||||
#include <freerdp/utils/memory.h>
|
||||
#include <freerdp/utils/thread.h>
|
||||
#include <freerdp/rfx/rfx.h>
|
||||
@ -239,6 +240,8 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y)
|
||||
void test_peer_dump_rfx(freerdp_peer* client)
|
||||
{
|
||||
STREAM* s;
|
||||
uint32 seconds;
|
||||
uint32 useconds;
|
||||
rdpUpdate* update;
|
||||
rdpPcap* pcap_rfx;
|
||||
pcap_record record;
|
||||
@ -248,6 +251,8 @@ void test_peer_dump_rfx(freerdp_peer* client)
|
||||
client->update->pcap_rfx = pcap_open(test_pcap_file, False);
|
||||
pcap_rfx = client->update->pcap_rfx;
|
||||
|
||||
seconds = useconds = 0;
|
||||
|
||||
while (pcap_has_next_record(pcap_rfx))
|
||||
{
|
||||
pcap_get_next_record_header(pcap_rfx, &record);
|
||||
@ -259,6 +264,15 @@ void test_peer_dump_rfx(freerdp_peer* client)
|
||||
pcap_get_next_record_content(pcap_rfx, &record);
|
||||
s->p = s->data + s->size;
|
||||
|
||||
seconds = record.header.ts_sec - seconds;
|
||||
useconds = record.header.ts_usec - useconds;
|
||||
|
||||
if (seconds > 0)
|
||||
freerdp_sleep(seconds);
|
||||
|
||||
if (useconds > 0)
|
||||
freerdp_usleep(useconds);
|
||||
|
||||
update->SurfaceCommand(update, s);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user