From f16ff0800b17870101596aca86a1ed17a6142056 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 17 May 2018 20:16:07 +0000 Subject: [PATCH] 2018-05-17 Fred Gleason * Added an 'RLM_VLOG_QUANTITY' define to 'rlm.h'. * Updated 'RLM_VERSION' to 18 in 'rlm.h'. * Updated the 'rlm_icecast2' plug-in to support vlogs. --- ChangeLog | 4 + conf/rlm_icecast2.conf | 40 +++++++ rlm/rlm.h | 13 ++- rlm/rlm_icecast2.c | 260 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 304 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47c722e1..0de56557 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16834,3 +16834,7 @@ * Fixed a bug in rdvairplay(1) that broke log chain-to events. * Enabled RLMs in rdvairplay(1). * Modified the 'rlm_test' RLM to support vLogs. +2018-05-17 Fred Gleason + * Added an 'RLM_VLOG_QUANTITY' define to 'rlm.h'. + * Updated 'RLM_VERSION' to 18 in 'rlm.h'. + * Updated the 'rlm_icecast2' plug-in to support vlogs. diff --git a/conf/rlm_icecast2.conf b/conf/rlm_icecast2.conf index 662447ec..c51967d6 100644 --- a/conf/rlm_icecast2.conf +++ b/conf/rlm_icecast2.conf @@ -60,6 +60,26 @@ FormatString=%t MasterLog=Yes Aux1Log=Yes Aux2Log=Yes +VLog101=No +VLog102=No +VLog103=No +VLog104=No +VLog105=No +VLog106=No +VLog107=No +VLog108=No +VLog109=No +VLog110=No +VLog111=No +VLog112=No +VLog113=No +VLog114=No +VLog115=No +VLog116=No +VLog117=No +VLog118=No +VLog119=No +VLog120=No ; Additional Icecast2 mountpoints can be configured by adding new sections... @@ -73,3 +93,23 @@ Aux2Log=Yes ;MasterLog=Yes ;Aux1Log=No ;Aux2Log=Onair +;VLog101=No +;VLog102=No +;VLog103=No +;VLog104=No +;VLog105=No +;VLog106=No +;VLog107=No +;VLog108=No +;VLog109=No +;VLog110=No +;VLog111=No +;VLog112=No +;VLog113=No +;VLog114=No +;VLog115=No +;VLog116=No +;VLog117=No +;VLog118=No +;VLog119=No +;VLog120=No diff --git a/rlm/rlm.h b/rlm/rlm.h index a47b91d7..4fcf8266 100644 --- a/rlm/rlm.h +++ b/rlm/rlm.h @@ -2,7 +2,7 @@ * * The Rivendell Loadable Module Interface * - * (C) Copyright 2008-2013 Fred Gleason + * (C) Copyright 2008-2018 Fred Gleason * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -80,7 +80,7 @@ extern "C" { /* * RLM Interface Version */ -#define RLM_VERSION 17 +#define RLM_VERSION 18 /* * Available Timers @@ -126,6 +126,12 @@ extern "C" { #define RLM_ENCODE_XML 1 #define RLM_ENCODE_URL 2 +/* + * Virtual Logs + * + */ +#define RLM_VLOG_QUANTITY 20 + /* * Service data structure */ @@ -140,7 +146,8 @@ extern "C" { */ struct rlm_log { char log_name[65]; /* Log name */ - uint32_t log_mach; /* Log machine number, 0=Main, 1=Aux 1, 2=Aux2 */ + uint32_t log_mach; /* Log machine number, 0=Main, 1=Aux 1, 2=Aux2, + * 100 - 119=vLogs */ char log_onair; /* On-air flag, 0=False, 1=True */ uint32_t log_mode; /* Log machine mode, 1=LiveAssist, 2=Automatic, 3=Manual */ char reserved[1974]; /* Reserved for future use */ diff --git a/rlm/rlm_icecast2.c b/rlm/rlm_icecast2.c index 6e3cc056..555809b7 100644 --- a/rlm/rlm_icecast2.c +++ b/rlm/rlm_icecast2.c @@ -46,7 +46,26 @@ char *rlm_icecast2_formats; int *rlm_icecast2_masters; int *rlm_icecast2_aux1s; int *rlm_icecast2_aux2s; - +int *rlm_icecast2_vlog101s; +int *rlm_icecast2_vlog102s; +int *rlm_icecast2_vlog103s; +int *rlm_icecast2_vlog104s; +int *rlm_icecast2_vlog105s; +int *rlm_icecast2_vlog106s; +int *rlm_icecast2_vlog107s; +int *rlm_icecast2_vlog108s; +int *rlm_icecast2_vlog109s; +int *rlm_icecast2_vlog110s; +int *rlm_icecast2_vlog111s; +int *rlm_icecast2_vlog112s; +int *rlm_icecast2_vlog113s; +int *rlm_icecast2_vlog114s; +int *rlm_icecast2_vlog115s; +int *rlm_icecast2_vlog116s; +int *rlm_icecast2_vlog117s; +int *rlm_icecast2_vlog118s; +int *rlm_icecast2_vlog119s; +int *rlm_icecast2_vlog120s; int rlm_icecast2_BufferDiff(char *sString,int dOrigin,int dDiff,int dMaxSize) { @@ -172,6 +191,26 @@ void rlm_icecast2_RLMStart(void *ptr,const char *arg) rlm_icecast2_masters=NULL; rlm_icecast2_aux1s=NULL; rlm_icecast2_aux2s=NULL; + rlm_icecast2_vlog101s=NULL; + rlm_icecast2_vlog102s=NULL; + rlm_icecast2_vlog103s=NULL; + rlm_icecast2_vlog104s=NULL; + rlm_icecast2_vlog105s=NULL; + rlm_icecast2_vlog106s=NULL; + rlm_icecast2_vlog107s=NULL; + rlm_icecast2_vlog108s=NULL; + rlm_icecast2_vlog109s=NULL; + rlm_icecast2_vlog110s=NULL; + rlm_icecast2_vlog111s=NULL; + rlm_icecast2_vlog112s=NULL; + rlm_icecast2_vlog113s=NULL; + rlm_icecast2_vlog114s=NULL; + rlm_icecast2_vlog115s=NULL; + rlm_icecast2_vlog116s=NULL; + rlm_icecast2_vlog117s=NULL; + rlm_icecast2_vlog118s=NULL; + rlm_icecast2_vlog119s=NULL; + rlm_icecast2_vlog120s=NULL; sprintf(section,"Icecast%d",i++); strncpy(username,RLMGetStringValue(ptr,arg,section,"Username",""),255); @@ -216,6 +255,107 @@ void rlm_icecast2_RLMStart(void *ptr,const char *arg) (rlm_icecast2_devs+1)*sizeof(int)); rlm_icecast2_aux2s[rlm_icecast2_devs]= rlm_icecast2_GetLogStatus(ptr,arg,section,"Aux2Log"); + rlm_icecast2_vlog101s=realloc(rlm_icecast2_vlog101s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog101s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog101"); + + rlm_icecast2_vlog102s=realloc(rlm_icecast2_vlog102s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog102s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog102"); + + rlm_icecast2_vlog103s=realloc(rlm_icecast2_vlog103s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog103s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog103"); + + rlm_icecast2_vlog104s=realloc(rlm_icecast2_vlog104s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog104s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog104"); + + rlm_icecast2_vlog105s=realloc(rlm_icecast2_vlog105s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog105s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog105"); + + rlm_icecast2_vlog106s=realloc(rlm_icecast2_vlog106s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog106s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog106"); + + rlm_icecast2_vlog107s=realloc(rlm_icecast2_vlog107s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog107s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog107"); + + rlm_icecast2_vlog108s=realloc(rlm_icecast2_vlog108s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog108s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog108"); + + rlm_icecast2_vlog109s=realloc(rlm_icecast2_vlog109s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog109s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog109"); + + rlm_icecast2_vlog110s=realloc(rlm_icecast2_vlog110s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog110s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog110"); + + rlm_icecast2_vlog111s=realloc(rlm_icecast2_vlog111s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog111s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog111"); + + rlm_icecast2_vlog112s=realloc(rlm_icecast2_vlog112s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog112s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog112"); + + rlm_icecast2_vlog113s=realloc(rlm_icecast2_vlog113s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog113s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog113"); + + rlm_icecast2_vlog114s=realloc(rlm_icecast2_vlog114s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog114s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog114"); + + rlm_icecast2_vlog115s=realloc(rlm_icecast2_vlog115s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog115s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog115"); + + rlm_icecast2_vlog116s=realloc(rlm_icecast2_vlog116s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog116s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog116"); + + rlm_icecast2_vlog117s=realloc(rlm_icecast2_vlog117s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog117s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog117"); + + rlm_icecast2_vlog118s=realloc(rlm_icecast2_vlog118s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog118s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog118"); + + rlm_icecast2_vlog119s=realloc(rlm_icecast2_vlog119s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog119s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog119"); + + rlm_icecast2_vlog120s=realloc(rlm_icecast2_vlog120s, + (rlm_icecast2_devs+1)*sizeof(int)); + rlm_icecast2_vlog120s[rlm_icecast2_devs]= + rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog120"); + + sprintf(errtext,"rlm_icecast2: configured mountpoint \"http://%s:%u%s\"", rlm_icecast2_hostnames+256*rlm_icecast2_devs, rlm_icecast2_tcpports[rlm_icecast2_devs], @@ -240,6 +380,26 @@ void rlm_icecast2_RLMFree(void *ptr) free(rlm_icecast2_masters); free(rlm_icecast2_aux1s); free(rlm_icecast2_aux2s); + free(rlm_icecast2_vlog101s); + free(rlm_icecast2_vlog102s); + free(rlm_icecast2_vlog103s); + free(rlm_icecast2_vlog104s); + free(rlm_icecast2_vlog105s); + free(rlm_icecast2_vlog106s); + free(rlm_icecast2_vlog107s); + free(rlm_icecast2_vlog108s); + free(rlm_icecast2_vlog109s); + free(rlm_icecast2_vlog110s); + free(rlm_icecast2_vlog111s); + free(rlm_icecast2_vlog112s); + free(rlm_icecast2_vlog113s); + free(rlm_icecast2_vlog114s); + free(rlm_icecast2_vlog115s); + free(rlm_icecast2_vlog116s); + free(rlm_icecast2_vlog117s); + free(rlm_icecast2_vlog118s); + free(rlm_icecast2_vlog119s); + free(rlm_icecast2_vlog120s); } @@ -257,17 +417,97 @@ void rlm_icecast2_RLMPadDataSent(void *ptr,const struct rlm_svc *svc, for(i=0;ilog_mach) { - case 0: - flag=rlm_icecast2_masters[i]; - break; + case 0: + flag=rlm_icecast2_masters[i]; + break; - case 1: - flag=rlm_icecast2_aux1s[i]; - break; + case 1: + flag=rlm_icecast2_aux1s[i]; + break; - case 2: - flag=rlm_icecast2_aux2s[i]; - break; + case 2: + flag=rlm_icecast2_aux2s[i]; + break; + + case 100: + flag=rlm_icecast2_vlog101s[i]; + break; + + case 101: + flag=rlm_icecast2_vlog102s[i]; + break; + + case 102: + flag=rlm_icecast2_vlog103s[i]; + break; + + case 103: + flag=rlm_icecast2_vlog104s[i]; + break; + + case 104: + flag=rlm_icecast2_vlog105s[i]; + break; + + case 105: + flag=rlm_icecast2_vlog106s[i]; + break; + + case 106: + flag=rlm_icecast2_vlog107s[i]; + break; + + case 107: + flag=rlm_icecast2_vlog108s[i]; + break; + + case 108: + flag=rlm_icecast2_vlog109s[i]; + break; + + case 109: + flag=rlm_icecast2_vlog110s[i]; + break; + + case 110: + flag=rlm_icecast2_vlog111s[i]; + break; + + case 111: + flag=rlm_icecast2_vlog112s[i]; + break; + + case 112: + flag=rlm_icecast2_vlog113s[i]; + break; + + case 113: + flag=rlm_icecast2_vlog114s[i]; + break; + + case 114: + flag=rlm_icecast2_vlog115s[i]; + break; + + case 115: + flag=rlm_icecast2_vlog116s[i]; + break; + + case 116: + flag=rlm_icecast2_vlog117s[i]; + break; + + case 117: + flag=rlm_icecast2_vlog118s[i]; + break; + + case 118: + flag=rlm_icecast2_vlog119s[i]; + break; + + case 119: + flag=rlm_icecast2_vlog120s[i]; + break; } if((flag==1)||((flag==2)&&(log->log_onair!=0))) { strncpy(str,RLMResolveNowNext(ptr,now,next,