2018-05-17 Fred Gleason <fredg@paravelsystems.com>

* 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.
This commit is contained in:
Fred Gleason
2018-05-17 20:16:07 +00:00
parent 4249cbdd1d
commit f16ff0800b
4 changed files with 304 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
*
* The Rivendell Loadable Module Interface
*
* (C) Copyright 2008-2013 Fred Gleason <fredg@paravelsystems.com>
* (C) Copyright 2008-2018 Fred Gleason <fredg@paravelsystems.com>
*
* 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 */

View File

@@ -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;i<rlm_icecast2_devs;i++) {
switch(log->log_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,