|
|
|
|
@ -675,11 +675,15 @@ static void options(int *argc, char ***argv, GHashTable *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, &rtpe_config.media_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, &rtpe_config.db_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, &rtpe_config.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"},
|
|
|
|
|
@ -1604,14 +1608,21 @@ int main(int argc, char **argv) {
|
|
|
|
|
/* thread to refresh DTLS certificate */
|
|
|
|
|
dtls_timer();
|
|
|
|
|
|
|
|
|
|
thread_create_looper(media_player_refresh_timer, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "media refresh", rtpe_config.media_refresh * 1000000LL);
|
|
|
|
|
if (rtpe_config.media_refresh > 0)
|
|
|
|
|
thread_create_looper(media_player_refresh_timer, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "media refresh", rtpe_config.media_refresh * 1000000LL);
|
|
|
|
|
|
|
|
|
|
thread_create_looper(media_player_refresh_db, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "db refresh", rtpe_config.db_refresh * 1000000LL);
|
|
|
|
|
if (rtpe_config.db_refresh > 0)
|
|
|
|
|
thread_create_looper(media_player_refresh_db, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "db refresh", rtpe_config.db_refresh * 1000000LL);
|
|
|
|
|
|
|
|
|
|
thread_create_looper(media_player_refresh_cache, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "cache refresh", rtpe_config.cache_refresh * 1000000LL);
|
|
|
|
|
if (rtpe_config.cache_refresh > 0)
|
|
|
|
|
thread_create_looper(media_player_refresh_cache, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "cache refresh", rtpe_config.cache_refresh * 1000000LL);
|
|
|
|
|
|
|
|
|
|
if (rtpe_config.expiry_timer > 0)
|
|
|
|
|
thread_create_looper(media_player_expire, rtpe_config.idle_scheduling,
|
|
|
|
|
rtpe_config.idle_priority, "cache expiry", rtpe_config.expiry_timer * 1000000LL);
|
|
|
|
|
|
|
|
|
|
if (!is_addr_unspecified(&rtpe_config.redis_ep.address) && initial_rtpe_config.redis_delete_async)
|
|
|
|
|
thread_create_detach(redis_delete_async_loop, NULL, "redis async");
|
|
|
|
|
|