diff options
| author | yangwei <[email protected]> | 2024-09-14 17:51:26 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-09-14 17:51:26 +0800 |
| commit | 39ddfa84cebfac48f49231de2596ad39f34fe18f (patch) | |
| tree | 437fee92af5f62a97279286428fde0c8c3dd1b93 /module_test | |
| parent | 1b14f987c03adb9ba57a35d715f94facc84cea2d (diff) | |
🧪 test(udp timeout): set g_monotonic_time_ms in ip pluginFeature-monotonic-time
Diffstat (limited to 'module_test')
| -rw-r--r-- | module_test/src/gtest_sapp_ipv4_plug.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/module_test/src/gtest_sapp_ipv4_plug.cpp b/module_test/src/gtest_sapp_ipv4_plug.cpp index 9937aa9..e71ab0e 100644 --- a/module_test/src/gtest_sapp_ipv4_plug.cpp +++ b/module_test/src/gtest_sapp_ipv4_plug.cpp @@ -107,6 +107,8 @@ extern "C" char ipv4_frag_assemble_checksum(const struct streaminfo *pstream, } #include "../../include/private/sapp_private_api.h" +extern volatile long long g_monotonic_time_ms; +extern volatile time_t g_monotonic_time; extern volatile long long g_current_time_ms; extern volatile time_t g_current_time; /* If the Real World time is used, the time difference may be inaccurate due to overload CPU resources, operating system scheduling or other issues. */ @@ -140,17 +142,26 @@ extern "C" char iplayer_readjust_time_entry(const struct streaminfo *pstream, un first_pkt_stamp.tv_usec = cur_pkt_stamp.tv_usec; g_current_time_ms = 0; // set time to PanGu g_current_time = 0; // set time to PanGu + g_monotonic_time_ms=g_current_time_ms; + g_monotonic_time=g_current_time; return APP_STATE_GIVEME; } g_current_time_ms = ((long)cur_pkt_stamp.tv_sec * 1000 + cur_pkt_stamp.tv_usec / 1000) - ((long)first_pkt_stamp.tv_sec * 1000 + first_pkt_stamp.tv_usec / 1000); g_current_time = g_current_time_ms / 1000; + g_monotonic_time_ms=g_current_time_ms; + g_monotonic_time=g_current_time; return APP_STATE_GIVEME; } extern "C" char timer_add_1s_polling_entry(struct streaminfo *stream , void **pme , int thread_seq ,void *a_packet ) { - if(g_current_time_ms >= 0)g_current_time_ms+=1000; + if(g_current_time_ms >= 0) + { + g_current_time_ms+=1000; + g_monotonic_time_ms=g_current_time_ms; + g_monotonic_time=g_current_time; + } return POLLING_STATE_IDLE; } |
