MT#61856 update expire rtpe_config object names

So that their naming is self-evident and correlates
with the actual options flag:
- `media-files-expire` -> `media_files_expire_us`
- `db-cache-expire` -> `db_cache_expire_us`
- `db-media-expire` -> `db_media_expire_us`

Change-Id: I76ebe9f92ba22de7c19fbb2ff47d0bf1952e1480
mr26.1
Donat Zenichev 1 week ago
parent c6cfe59890
commit 5d67968575

@ -759,9 +759,9 @@ static void options(int *argc, char ***argv, charp_ht templates) {
int final_timeout = 0;
int offer_timeout = 0;
int delete_delay = 30;
int media_expire = 0;
int db_expire = 0;
int cache_expire = 0;
int media_files_expire = 0;
int db_media_expire = 0;
int db_cache_expire = 0;
int rtcp_interval = 0;
int redis_disable_time = 10;
int mqtt_publish_interval = 5000;
@ -921,15 +921,15 @@ static void options(int *argc, char ***argv, charp_ht templates) {
{ "kernel-player-media",0,0,G_OPTION_ARG_INT, &rtpe_config.kernel_player_media,"Max number of kernel media files","INT"},
{ "preload-media-files",0,0,G_OPTION_ARG_FILENAME_ARRAY,&rtpe_config.preload_media_files,"Preload media file(s) for playback into memory","FILE"},
{ "media-files-reload",0,0,G_OPTION_ARG_INT, &rtpe_config.media_refresh,"Refresh/reload preloaded media files at a certain interval","SECONDS"},
{ "media-files-expire",0,0,G_OPTION_ARG_INT, &media_expire, "Maximum age of unused cached media files","SECONDS"},
{ "media-files-expire",0,0,G_OPTION_ARG_INT, &media_files_expire, "Maximum age of unused cached media files","SECONDS"},
{ "expiry-timer",0,0,G_OPTION_ARG_INT, &rtpe_config.expiry_timer,"How often to check for expired media cache entries","SECONDS"},
{ "preload-db-media",0,0,G_OPTION_ARG_STRING_ARRAY,&rtpe_config.preload_db_media,"Preload media from database for playback into memory","INT"},
{ "db-media-reload",0,0,G_OPTION_ARG_INT, &rtpe_config.db_refresh,"Reload preloaded media from DB at a certain interval","SECONDS"},
{ "db-media-expire",0,0,G_OPTION_ARG_INT, &db_expire, "Maximum age of unused cached DB media entries","SECONDS"},
{ "db-media-expire",0,0,G_OPTION_ARG_INT, &db_media_expire, "Maximum age of unused cached DB media entries","SECONDS"},
{ "db-media-cache",0,0, G_OPTION_ARG_FILENAME, &rtpe_config.db_media_cache,"Directory to store media loaded from database","PATH"},
{ "preload-db-cache",0,0,G_OPTION_ARG_STRING_ARRAY,&rtpe_config.preload_db_cache,"Preload media from database for playback into file cache","INT"},
{ "db-cache-reload",0,0,G_OPTION_ARG_INT, &rtpe_config.cache_refresh,"Refresh/reload cached media from DB at a certain interval","SECONDS"},
{ "db-cache-expire",0,0,G_OPTION_ARG_INT, &cache_expire,"Maximum age of unused cached DB entries in files","SECONDS"},
{ "db-cache-expire",0,0,G_OPTION_ARG_INT, &db_cache_expire,"Maximum age of unused cached DB entries in files","SECONDS"},
{ "audio-buffer-length",0,0, G_OPTION_ARG_INT,&rtpe_config.audio_buffer_length,"Length in milliseconds of audio buffer","INT"},
{ "audio-buffer-delay",0,0, G_OPTION_ARG_INT,&rtpe_config.audio_buffer_delay,"Initial delay in milliseconds for buffered audio","INT"},
{ "audio-player",0,0, G_OPTION_ARG_STRING, &use_audio_player, "When to enable the internal audio player","on-demand|play-media|transcoding|always"},
@ -1233,16 +1233,16 @@ static void options(int *argc, char ***argv, charp_ht templates) {
if (rtpe_config.delete_delay_us < 0)
die("Invalid negative delete-delay");
rtpe_config.media_expire_us = media_expire * 1000000LL;
if (rtpe_config.media_expire_us < 0)
rtpe_config.media_files_expire_us = media_files_expire * 1000000LL;
if (rtpe_config.media_files_expire_us < 0)
die("Invalid negative media-files-expire");
rtpe_config.cache_expire_us = cache_expire * 1000000LL;
if (rtpe_config.cache_expire_us < 0)
rtpe_config.db_cache_expire_us = db_cache_expire * 1000000LL;
if (rtpe_config.db_cache_expire_us < 0)
die("Invalid negative db-cache-expire");
rtpe_config.db_expire_us = db_expire * 1000000LL;
if (rtpe_config.db_expire_us < 0)
rtpe_config.db_media_expire_us = db_media_expire * 1000000LL;
if (rtpe_config.db_media_expire_us < 0)
die("Invalid negative db-media-expire");
rtpe_config.rtcp_interval_us = rtcp_interval * 1000LL;

@ -2846,10 +2846,10 @@ unsigned int media_player_evict_player_caches(void) {
#ifdef WITH_TRANSCODING
static void media_player_expire_files(void) {
if (rtpe_config.media_expire_us <= 0)
if (rtpe_config.media_files_expire_us <= 0)
return;
int64_t limit = rtpe_now - rtpe_config.media_expire_us;
int64_t limit = rtpe_now - rtpe_config.media_files_expire_us;
unsigned int num = 0;
{
@ -2877,10 +2877,10 @@ static void media_player_expire_files(void) {
}
static void media_player_expire_dbs(void) {
if (rtpe_config.db_expire_us <= 0)
if (rtpe_config.db_media_expire_us <= 0)
return;
int64_t limit = rtpe_now - rtpe_config.db_expire_us;
int64_t limit = rtpe_now - rtpe_config.db_media_expire_us;
unsigned int num = 0;
{
@ -2911,7 +2911,7 @@ static void media_player_expire_cache_entry(unsigned long long id, unsigned int
int64_t mtime, atime;
if (!media_player_get_cache_times(id, &mtime, &atime))
return;
int64_t limit = rtpe_now - rtpe_config.cache_expire_us; // db-cache-expire
int64_t limit = rtpe_now - rtpe_config.db_cache_expire_us;
if (atime >= limit)
return;
if (media_player_evict_cache(id))
@ -2919,7 +2919,7 @@ static void media_player_expire_cache_entry(unsigned long long id, unsigned int
}
static void media_player_expire_caches(void) {
if (rtpe_config.cache_expire_us <= 0) // db-cache-expire
if (rtpe_config.db_cache_expire_us <= 0)
return;
unsigned int ret = 0;

@ -105,9 +105,9 @@ enum endpoint_learning {
X(final_timeout_us) \
X(offer_timeout_us) \
X(delete_delay_us) \
X(media_expire_us) \
X(cache_expire_us) \
X(db_expire_us) \
X(media_files_expire_us) \
X(db_cache_expire_us) \
X(db_media_expire_us) \
X(rtcp_interval_us) \
X(redis_disable_time_us) \
X(mqtt_publish_interval_us) \

Loading…
Cancel
Save