Commit 6e815cbe authored by Damien Lucas's avatar Damien Lucas

. changes in order to have all settings in lowercase

   You will have to downcase your vls.cfg
   (you may do that with:
      tr A-Z a-z < vls.cfg > vls.cfg.new
   )
   I may have broken few little things, so just tell me if anything
   does not work anymore

 . fix commandline execution when compiled without backward compatibility
   (still need to fix --loop, --end and --rtp options)
parent 36d6dbe2
......@@ -2,7 +2,7 @@
* application.cpp: Application class
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: application.cpp,v 1.21 2003/06/02 09:22:45 nitrox Exp $
* $Id: application.cpp,v 1.22 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -157,7 +157,7 @@ int C_Application::Init(int iArgc, char* paArg[])
// Init the logger
if(!iRc)
{
C_String strLogFileSetting = "Global.LogFile";
C_String strLogFileSetting = "global.logfile";
C_String strLogFile = GetSetting(strLogFileSetting, "");
if (strLogFile != "")
......@@ -168,13 +168,13 @@ int C_Application::Init(int iArgc, char* paArg[])
}
// Check if System Logging is enabled in the vls.cfg
C_String strSystemLog = GetSetting("Global.SystemLog", "disable");
C_String strSystemLog = GetSetting("global.systemlog", "disable");
if (strSystemLog == "enable")
m_iLogFlags |= LOG_SYSTEM;
// Check if screen Logging is enabled in the vls.cfg
C_String strScrLog = GetSetting("Global.ScreenLog", "enable");
C_String strScrLog = GetSetting("global.screenlog", "enable");
if (strScrLog == "enable")
m_iLogFlags |= LOG_SCR;
......
......@@ -2,7 +2,7 @@
* parsers.cpp: Command line and configuration files parsers
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: parsers.cpp,v 1.19 2003/07/31 14:46:36 nitrox Exp $
* $Id: parsers.cpp,v 1.20 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -213,7 +213,7 @@ C_Vector<C_String> C_CfgFileParser::Parse(const C_String& strFileName,
C_String strValue(yytext);
// Remove the quotes. FIXME: should be done by the lexer
C_String strStrippedValue(strValue.SubString(1, strValue.Length()-1));
if(strFirstToken=="ConfigPath")
if(strFirstToken=="configpath")
{
C_String* strInc=new C_String(strStrippedValue+"/input.cfg");
C_String* strIncRoot=new C_String(m_pCallBack->GetSection());
......@@ -257,12 +257,12 @@ C_Vector<C_String> C_CfgFileParser::Parse(const C_String& strFileName,
if(strRoot=="")
{
m_pCallBack->OnStartSection("local1");
m_pCallBack->OnProperty("ProgramCount", m_pCallBack->GetLocalCount());
m_pCallBack->OnProperty("programcount", m_pCallBack->GetLocalCount());
m_pCallBack->OnEndSection("local1");
}
else
{
m_pCallBack->OnProperty("ProgramCount", m_pCallBack->GetLocalCount());
m_pCallBack->OnProperty("programcount", m_pCallBack->GetLocalCount());
}
return vInclude;
}
......@@ -312,27 +312,29 @@ void C_CfgFileParser::AddCmdLineSetting(unsigned char sOption, C_String sValue)
if(sDest1=="") throw E_Parser(GEN_ERR, "No IP destination specified");
if(sDest2.ToInt()<=0 && sDest2!="")
throw E_Parser(GEN_ERR, "Invalid port specification");
m_pCallBack->OnStartSection("Channels");
m_pCallBack->OnStartSection("channels");
m_pCallBack->OnProperty("output1", "network");
m_pCallBack->OnEndSection("Channels");
m_pCallBack->OnEndSection("channels");
m_pCallBack->OnStartSection("output1");
m_pCallBack->OnProperty("DstHost", sDest1);
if(sDest2!="") m_pCallBack->OnProperty("DstPort", sDest2);
m_pCallBack->OnProperty("dsthost", sDest1);
if(sDest2!="") m_pCallBack->OnProperty("dstport", sDest2);
if(sDest1.ToInt()<=239 && sDest1.ToInt()>=224)
m_pCallBack->OnProperty("StreamType", "multicast");
if(sMeth=="udp") m_pCallBack->OnProperty("Protocol", "udp");
else m_pCallBack->OnProperty("Protocol", "rtp");
m_pCallBack->OnProperty("streamtype", "multicast");
else
m_pCallBack->OnProperty("streamtype", "unicast");
if(sMeth=="udp") m_pCallBack->OnProperty("protocol", "udp");
else m_pCallBack->OnProperty("protocol", "rtp");
m_pCallBack->OnEndSection("output1");
}
else if (sMeth=="file")
{
if(sDest1=="") throw E_Parser(GEN_ERR, "No Filename specified");
m_pCallBack->OnStartSection("Channels");
m_pCallBack->OnStartSection("channels");
m_pCallBack->OnProperty("output1", "file");
m_pCallBack->OnEndSection("Channels");
m_pCallBack->OnEndSection("channels");
m_pCallBack->OnStartSection("output1");
m_pCallBack->OnProperty("FileName", sDest1);
m_pCallBack->OnProperty("Append", "no");
m_pCallBack->OnProperty("filename", sDest1);
m_pCallBack->OnProperty("append", "no");
m_pCallBack->OnEndSection("output1");
}
break;
......@@ -452,7 +454,10 @@ void C_CfgFileParser::AddCmdLineTarget(C_String sTarget, C_String sTags)
/* Automatic start section */
m_pCallBack->OnStartSection("LaunchOnStartUp");
m_pCallBack->OnProperty("command1", "start "+sProgramLaunch
+" output1 input1 "+sTags);
m_pCallBack->OnProperty("command1", "broadcast_add broadcast1 output1 "
+ sProgramLaunch +" input1 ");
m_pCallBack->OnProperty("command2", "broadcast_start broadcast1");
// TODO nitrox
// handle sTags (rtp, loop, end, ...)
m_pCallBack->OnEndSection("LaunchOnStartUp");
}
......@@ -2,7 +2,7 @@
* dvbinput.cpp: DVB streams
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.cpp,v 1.30 2003/08/13 22:56:01 adq Exp $
* $Id: dvbinput.cpp,v 1.31 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Damien Lucas <nitrox@videolan.org>
......@@ -148,11 +148,11 @@ void C_DvbInput::OnInit()
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
iNumber = pApp->GetSetting(GetName() + ".DeviceNumber", "0").ToInt();
m_strTrickPlayType = pApp->GetSetting(GetName() + ".TrickPlay", "Normal").ToLower();
m_iSendMethod = pApp->GetSetting(GetName() + ".SendMethod", "0").ToInt();
m_bIgnoreTimeout = pApp->GetSetting(GetName()+".IgnoreTimeout", "0").ToInt();
dvbrc = pApp->GetSetting(GetName()+ ".Dvbrc", "");
iNumber = pApp->GetSetting(GetName() + ".devicenumber", "0").ToInt();
m_strTrickPlayType = pApp->GetSetting(GetName() + ".trickplay", "Normal").ToLower();
m_iSendMethod = pApp->GetSetting(GetName() + ".sendmethod", "0").ToInt();
m_bIgnoreTimeout = pApp->GetSetting(GetName()+".ignoretimeout", "0").ToInt();
dvbrc = pApp->GetSetting(GetName()+ ".dvbrc", "");
if(dvbrc.Length() != 0)
{
strncpy(filen, dvbrc.GetString(), dvbrc.Length()+1);
......
......@@ -2,7 +2,7 @@
* localinput.cpp: Local streams
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: localinput.cpp,v 1.20 2003/08/14 08:50:14 nitrox Exp $
* $Id: localinput.cpp,v 1.21 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -107,10 +107,10 @@ void C_LocalInput::OnInit()
// Build the program list
for(int ui = 1;
ui <= pApp->GetSetting(GetName()+".ProgramCount", "0").ToInt(); ui++)
ui <= pApp->GetSetting(GetName()+".programcount", "0").ToInt(); ui++)
{
C_String strName = pApp->GetSetting(GetName()+"."+C_String(ui)
+ ".Name", C_String("Pgrm") + ui);
+ ".name", C_String("Pgrm") + ui);
C_String* pStr = new C_String(strName);
m_vProgramNames.Add(pStr);
Log(m_hLog, LOG_NOTE, "Added program '" + *pStr+"'");
......@@ -170,8 +170,7 @@ void C_LocalInput::OnStartStreaming(C_Broadcast* pBroadcast)
m_vProgramNames.Find(pBroadcast->GetProgram()->GetName()) + 1;
ASSERT(uiId > 0);
C_String strId = GetName() + "." + uiId;
C_String strType = pApp->GetSetting(strId + ".Type",
"Mpeg2-TS").ToLower();
C_String strType = pApp->GetSetting(strId + ".type", "mpeg2-ts");
C_String strReaderType;
C_String strConverterType;
......@@ -186,7 +185,7 @@ void C_LocalInput::OnStartStreaming(C_Broadcast* pBroadcast)
// Reader configuration
strReaderType = "file";
C_String strFile = m_strFilesPath +
pApp->GetSetting(strId+".FileName", "");
pApp->GetSetting(strId+".filename", "");
pBroadcast->SetOption("filename", strFile);
// Converter configuration
......@@ -202,7 +201,7 @@ void C_LocalInput::OnStartStreaming(C_Broadcast* pBroadcast)
// Reader configuration
strReaderType = "file";
C_String strFile = m_strFilesPath +
pApp->GetSetting(strId+".FileName", "");
pApp->GetSetting(strId+".filename", "");
pBroadcast->SetOption("filename", strFile);
// Converter configuration
......@@ -216,8 +215,7 @@ void C_LocalInput::OnStartStreaming(C_Broadcast* pBroadcast)
pBuffer = new C_SyncFifo(uiSize);
// Reader configuration
strReaderType = "file";
C_String strFile = m_strFilesPath +
pApp->GetSetting(strId+".FileName", "");
C_String strFile = m_strFilesPath + pApp->GetSetting(strId+".filename", "");
pBroadcast->SetOption("filename", strFile);
// Converter configuration
......@@ -230,7 +228,7 @@ void C_LocalInput::OnStartStreaming(C_Broadcast* pBroadcast)
pBuffer = new C_SyncFifo(uiSize);
// Reader configuration
strReaderType = "dvd";
C_String strDevice = pApp->GetSetting(strId+".Device", "");
C_String strDevice = pApp->GetSetting(strId+".device", "");
pBroadcast->SetOption("device", strDevice);
C_String strDvdTitle = pApp->GetSetting(strId+".dvdtitle","");
pBroadcast->SetOption("dvdtitle", strDvdTitle);
......@@ -296,8 +294,8 @@ void C_LocalInput::OnStartStreaming(C_Broadcast* pBroadcast)
// Create the TrickPlay
C_TrickPlay* pTrickPlay;
strTrickPlayType = pApp->GetSetting(GetName()+".TrickPlay",
"Normal").ToLower();
strTrickPlayType = pApp->GetSetting(GetName()+".trickPlay",
"normal").ToLower();
C_TrickPlayModule* pTrickPlayModule = (C_TrickPlayModule*)
C_Application::GetModuleManager()
......@@ -488,7 +486,7 @@ void C_LocalInput::OnUpdateProgram(C_String strProgram,
{
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
int uiPgrmCount = pApp->GetSetting(GetName()+".ProgramCount", "0").ToInt();
int uiPgrmCount = pApp->GetSetting(GetName()+".programcount", "0").ToInt();
unsigned int uiId = m_vProgramNames.Find(strProgram) + 1;
......@@ -501,18 +499,18 @@ void C_LocalInput::OnUpdateProgram(C_String strProgram,
if(uiPgrmCount)
{
uiPgrmCount++;
C_String strKey = C_String(uiPgrmCount)+ ".Name";
C_String strKey = C_String(uiPgrmCount)+ ".name";
pApp->SetSettings(strKey,strProgram);
strKey = C_String(uiPgrmCount)+ ".FileName";
strKey = C_String(uiPgrmCount)+ ".filename";
pApp->SetSettings(strKey, strFileName);
strKey = C_String(uiPgrmCount)+ ".Type";
strKey = C_String(uiPgrmCount)+ ".type";
pApp->SetSettings(strKey, strType);
strKey = C_String("Input.ProgramCount");
strKey = C_String("input.programcount");
C_String strPgrmCount=C_String(uiPgrmCount);
pApp->SetSettings(strKey, strPgrmCount);
// add to m_vProgramNames
C_String strName = pApp->GetSetting(C_String(uiPgrmCount) + ".Name",
C_String strName = pApp->GetSetting(C_String(uiPgrmCount) + ".name",
C_String("Pgrm") + uiPgrmCount);
C_String* pStr = new C_String(strName);
m_vProgramNames.Add(pStr);
......@@ -535,47 +533,48 @@ void C_LocalInput::OnDeleteProgram(C_String strProgram)
if (uiId>0)
{
// Delete settings from m_cSettings
C_String strPgrmCount = pApp->GetSetting("Input.ProgramCount", "0");
C_String strPgrmCount = pApp->GetSetting("input.programcount", "0");
unsigned int uiPgrmCount = strPgrmCount.ToInt();
if(uiPgrmCount)
{
C_String strDelKey = C_String(uiId)+ ".Name";
C_String strDelKey = C_String(uiId)+ ".name";
pApp->DeleteSetting(strDelKey);
if (pApp->GetSetting(C_String(uiId)+".FileName", "") != "" )
if (pApp->GetSetting(C_String(uiId)+".filename", "") != "" )
{
strDelKey = C_String(uiId)+ ".FileName";
strDelKey = C_String(uiId)+ ".filename";
pApp->DeleteSetting(strDelKey);
}
if (pApp->GetSetting(C_String(uiId)+".Device", "") != "" )
if (pApp->GetSetting(C_String(uiId)+".device", "") != "" )
{
strDelKey = C_String(uiId)+ ".Device";
strDelKey = C_String(uiId)+ ".device";
pApp->DeleteSetting(strDelKey);
}
strDelKey = C_String(uiId)+ ".Type";
strDelKey = C_String(uiId)+ ".type";
pApp->DeleteSetting(strDelKey);
// Move all other settings one item down
for(unsigned int ui = uiId; ui <= uiPgrmCount; ui++)
{
C_String strProgram = pApp->GetSetting(C_String(ui+1) + ".Name",C_String("Pgrm") + ui+1);
C_String strFileName = pApp->GetSetting(C_String(ui+1)+".FileName", "");
C_String strType = pApp->GetSetting(C_String(ui+1) + ".Type", "Mpeg2-TS");
C_String strDevice = pApp->GetSetting(C_String(ui+1)+".Device", "");
C_String strProgram = pApp->GetSetting(C_String(ui+1) + ".name",
C_String("Pgrm") + ui+1);
C_String strFileName = pApp->GetSetting(C_String(ui+1)+".filename", "");
C_String strType = pApp->GetSetting(C_String(ui+1)+".type", "mpeg2-ts");
C_String strDevice = pApp->GetSetting(C_String(ui+1)+".device", "");
// update settings
C_String strKey = C_String(ui)+ ".Name";
C_String strKey = C_String(ui)+ ".name";
pApp->SetSettings(strKey,strProgram);
strKey = C_String(ui)+ ".FileName";
strKey = C_String(ui)+ ".filename";
pApp->SetSettings(strKey, strFileName);
strKey = C_String(ui)+ ".Device";
strKey = C_String(ui)+ ".device";
pApp->SetSettings(strKey, strDevice);
strKey = C_String(ui)+ ".Type";
strKey = C_String(ui)+ ".type";
pApp->SetSettings(strKey, strType);
}
// Lower program count
uiPgrmCount--;
strDelKey = C_String("Input.ProgramCount");
strDelKey = C_String("input.programcount");
C_String strProgramCount=C_String(uiPgrmCount);
pApp->SetSettings(strDelKey, strPgrmCount);
//pApp->SetSettings(strDelKey, C_String(uiPgrmCount));
......@@ -583,14 +582,14 @@ void C_LocalInput::OnDeleteProgram(C_String strProgram)
// ** DEBUG **
Log(m_hLog, LOG_NOTE, "Debugging inputs m_cSettings list.");
C_String strPgrmCount = pApp->GetSetting("Input.ProgramCount", "0");
C_String strPgrmCount = pApp->GetSetting("input.programcount", "0");
unsigned int uiPgrmCount = strPgrmCount.ToInt();
for(unsigned int ui = 1; ui <= uiPgrmCount; ui++)
{
C_String strProgram = pApp->GetSetting(C_String(ui) + ".Name",C_String("Pgrm") + ui);
C_String strFileName = pApp->GetSetting(C_String(ui)+".FileName", "");
C_String strDevice = pApp->GetSetting(C_String(ui)+".Device", "");
C_String strType = pApp->GetSetting(C_String(ui) + ".Type", "Mpeg2-TS").ToLower();
C_String strProgram = pApp->GetSetting(C_String(ui) + ".name",C_String("Pgrm") + ui);
C_String strFileName = pApp->GetSetting(C_String(ui)+".filename", "");
C_String strDevice = pApp->GetSetting(C_String(ui)+".device", "");
C_String strType = pApp->GetSetting(C_String(ui) + ".type", "mpeg2-ts").ToLower();
Log(m_hLog, LOG_NOTE, "Program: \"" + strProgram +"\"");
Log(m_hLog, LOG_NOTE, " FileName: \"" + strFileName+"\"");
Log(m_hLog, LOG_NOTE, " Device: \"" + strDevice+"\"");
......
......@@ -2,7 +2,7 @@
* telnetinterface.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: telnetinterface.cpp,v 1.4 2003/08/05 12:28:46 nitrox Exp $
* $Id: telnetinterface.cpp,v 1.5 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -757,53 +757,52 @@ int C_TelnetInterface::Init()
int iRc = NO_ERR;
//Don't start the telnet server when Telnet.Use is false
if(pApp->GetSetting(m_sInterfaceName+".Use", "false").ToLower()=="true")
{
// Get config
C_String strDomain = pApp->GetSetting(m_sInterfaceName+".Domain", "Inet4").ToLower();
// Get config
C_String strDomain = pApp->GetSetting(m_sInterfaceName+".domain", "inet4");
int iDomain;
C_String strDefaultHost;
int iDomain;
C_String strDefaultHost;
if(strDomain == "inet4")
{
iDomain = AF_INET;
strDefaultHost = "0.0.0.0";
}
if(strDomain == "inet4")
{
iDomain = AF_INET;
strDefaultHost = "0.0.0.0";
}
#ifdef HAVE_IPV6
else if(strDomain == "inet6")
else if(strDomain == "inet6")
{
iDomain = AF_INET6;
strDefaultHost = "0::0";
}
#endif
else
{
Log(C_Interface::m_hLog, LOG_ERROR, "Unknown domain:\n" + strDomain);
iRc = GEN_ERR;
}
if(!iRc)
{
C_String strAddr = pApp->GetSetting(m_sInterfaceName+".localaddress",
strDefaultHost);
C_String strPort = pApp->GetSetting(m_sInterfaceName+".localport", "9999");
// Init the socket
try
{
iDomain = AF_INET6;
strDefaultHost = "0::0";
C_ConnectionsHandler<C_TelnetInterfaceSession>::Init(iDomain, strAddr, strPort);
}
#endif
else
catch(E_Exception e)
{
Log(C_Interface::m_hLog, LOG_ERROR, "Unknown domain:\n" + strDomain);
Log(C_Interface::m_hLog, LOG_ERROR,
m_sInterfaceName+" server initialisation failed:\n" + e.Dump());
iRc = GEN_ERR;
}
if(!iRc)
{
C_String strAddr = pApp->GetSetting(m_sInterfaceName+".LocalAddress", strDefaultHost);
C_String strPort = pApp->GetSetting(m_sInterfaceName+".LocalPort", "9999");
// Init the socket
try
{
C_ConnectionsHandler<C_TelnetInterfaceSession>::Init(iDomain, strAddr, strPort);
}
catch(E_Exception e)
{
Log(C_Interface::m_hLog, LOG_ERROR,
m_sInterfaceName+" server initialisation failed:\n" + e.Dump());
iRc = GEN_ERR;
}
Log(C_Interface::m_hLog, LOG_NOTE, m_sInterfaceName+" server initialised");
}
if(!iRc)
Log(C_Interface::m_hLog, LOG_NOTE, m_sInterfaceName+" server initialised");
}
return iRc;
}
......
......@@ -2,7 +2,7 @@
* v4linput.cpp: Reading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2003 VideoLAN
* $Id: v4linput.cpp,v 1.18 2003/08/11 16:57:50 tooney Exp $
* $Id: v4linput.cpp,v 1.19 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
*
......@@ -152,53 +152,53 @@ void C_v4lInput::OnStartStreaming(C_Broadcast* pBroadcast)
unsigned int uiSize = pTsProvider->Capacity() -pChannel->GetBuffCapacity()-2;
C_SyncFifo* pBuffer;
C_String strDevice = pApp->GetSetting(GetName()+".Device", "/dev/video");
C_String strDevice = pApp->GetSetting(GetName()+".device", "/dev/video");
pBroadcast->SetOption("v4l_device", strDevice);
C_String strAudioDevice =
pApp->GetSetting(GetName()+".AudioDevice", "/dev/dsp");
pApp->GetSetting(GetName()+".audiodevice", "/dev/dsp");
pBroadcast->SetOption("v4l_audiodevice", strAudioDevice);
C_String strV4LQuality = pApp->GetSetting(GetName()+".Quality", "31.0");
C_String strV4LQuality = pApp->GetSetting(GetName()+".quality", "31.0");
pBroadcast->SetOption("v4l_quality", strV4LQuality);
C_String strV4LChannel = pApp->GetSetting(GetName()+".Channel", "0");
C_String strV4LChannel = pApp->GetSetting(GetName()+".channel", "0");
pBroadcast->SetOption("v4l_channel", strV4LChannel);
C_String strV4LSize = pApp->GetSetting(GetName()+".Size", "");
C_String strV4LSize = pApp->GetSetting(GetName()+".size", "");
pBroadcast->SetOption("v4l_size", strV4LSize);
C_String strV4LNorm = pApp->GetSetting(GetName()+".Norm", "0");
C_String strV4LNorm = pApp->GetSetting(GetName()+".norm", "0");
pBroadcast->SetOption("v4l_norm", strV4LNorm);
C_String strV4LBitrate = pApp->GetSetting(GetName()+".Bitrate", "1000");
C_String strV4LBitrate = pApp->GetSetting(GetName()+".bitrate", "1000");
pBroadcast->SetOption("v4l_bitrate", strV4LBitrate);
C_String strV4LMute = pApp->GetSetting(GetName()+".AudioMute", "false");
C_String strV4LMute = pApp->GetSetting(GetName()+".audioMute", "false");
pBroadcast->SetOption("v4l_mute", strV4LMute);
C_String strV4LAudioChannel =
pApp->GetSetting(GetName()+".AudioChannel", "2");
pApp->GetSetting(GetName()+".audiochannel", "2");
pBroadcast->SetOption("v4l_audiochannel", strV4LAudioChannel);
C_String strV4LAudioFreq =
pApp->GetSetting(GetName()+".AudioFreq", "44100");
pApp->GetSetting(GetName()+".audiofreq", "44100");
pBroadcast->SetOption("v4l_audiofreq", strV4LAudioFreq);
C_String strV4LAudioBitrate =
pApp->GetSetting(GetName()+".AudioBitrate", "64");
pApp->GetSetting(GetName()+".audiobitrate", "64");
pBroadcast->SetOption("v4l_audiobitrate", strV4LAudioBitrate);
C_String strV4LFrequency = pApp->GetSetting(GetName()+".Frequency", "-1");
C_String strV4LFrequency = pApp->GetSetting(GetName()+".frequency", "-1");
pBroadcast->SetOption("v4l_frequency", strV4LFrequency);
C_String strV4LDeInt = pApp->GetSetting(GetName()+".DeInterlace", "0");
C_String strV4LDeInt = pApp->GetSetting(GetName()+".deinterlace", "0");
pBroadcast->SetOption("v4l_deinterlace", strV4LDeInt);
C_String strV4LAudioCodec = pApp->GetSetting(GetName()+".AudioCompression", "mp2");
C_String strV4LAudioCodec = pApp->GetSetting(GetName()+".audiocompression", "mp2");
pBroadcast->SetOption("v4l_audiocodec", strV4LAudioCodec);
C_String strV4Lcodec = pApp->GetSetting(GetName()+".Compression", "mpeg1");
C_String strV4Lcodec = pApp->GetSetting(GetName()+".compression", "mpeg1");
pBroadcast->SetOption("v4l_codec", strV4Lcodec);
C_String strReaderType;
......@@ -251,8 +251,8 @@ void C_v4lInput::OnStartStreaming(C_Broadcast* pBroadcast)
// Create the TrickPlay
C_TrickPlay* pTrickPlay;
strTrickPlayType = pApp->GetSetting(GetName() + ".TrickPlay",
"Normal").ToLower();
strTrickPlayType = pApp->GetSetting(GetName() + ".trickPlay",
"normal").ToLower();
C_TrickPlayModule* pTrickPlayModule = (C_TrickPlayModule*)
C_Application::GetModuleManager()
->GetModule("trickplay",
......@@ -391,42 +391,8 @@ void C_v4lInput::OnStopStreaming(C_Broadcast* pBroadcast)
void C_v4lInput::OnUpdateProgram(C_String strProgram,
C_String strFileName, C_String strType)
{
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
C_String strPgrmCount = pApp->GetSetting("Input.ProgramCount", "0");
unsigned int uiPgrmCount = strPgrmCount.ToInt();
unsigned int uiId = m_vProgramNames.Find(strProgram) + 1;
if (uiId>0)
{
Log(m_hLog, LOG_WARN, "The program already exists in the list for this input");
}
if(uiPgrmCount)
{
uiPgrmCount++;
C_String strKey = C_String(uiPgrmCount)+ ".Name";
pApp->SetSettings(strKey,strProgram);
strKey = C_String(uiPgrmCount)+ ".FileName";
pApp->SetSettings(strKey, strFileName);
strKey = C_String(uiPgrmCount)+ ".Type";
pApp->SetSettings(strKey, strType);
strKey = C_String("Input.ProgramCount");
C_String strPgrmCount=C_String(uiPgrmCount);
pApp->SetSettings(strKey, strPgrmCount);
// add to m_vProgramNames
C_String strName = pApp->GetSetting(C_String(uiPgrmCount) + ".Name",
C_String("Pgrm") + uiPgrmCount);
C_String* pStr = new C_String(strName);
m_vProgramNames.Add(pStr);
}
else
{
throw E_Exception(GEN_ERR,
"The \"ProgramCount\" variable isn't specified in the file \"" +
m_strConfigPath + "/input.cfg\"");
}
// TODO Write this part
ASSERT(false);
}
//------------------------------------------------------------------------------
......@@ -434,82 +400,5 @@ void C_v4lInput::OnUpdateProgram(C_String strProgram,
//------------------------------------------------------------------------------
void C_v4lInput::OnDeleteProgram(C_String strProgram)
{
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
// Get the type of the program
unsigned int uiId = m_vProgramNames.Find(strProgram) + 1;
if (uiId>0)
{
// Delete settings from m_cSettings
C_String strPgrmCount = pApp->GetSetting("Input.ProgramCount", "0");
unsigned int uiPgrmCount = strPgrmCount.ToInt();
if(uiPgrmCount)
{
C_String strDelKey = C_String(uiId)+ ".Name";
pApp->DeleteSetting(strDelKey);
if (pApp->GetSetting(C_String(uiId)+".FileName", "") != "" )
{
strDelKey = C_String(uiId)+ ".FileName";
pApp->DeleteSetting(strDelKey);
}
if (pApp->GetSetting(C_String(uiId)+".Device", "") != "" )
{
strDelKey = C_String(uiId)+ ".Device";
pApp->DeleteSetting(strDelKey);
}
strDelKey = C_String(uiId)+ ".Type";
pApp->DeleteSetting(strDelKey);
// Move all other settings one item down
for(unsigned int ui = uiId; ui <= uiPgrmCount; ui++)
{
C_String strProgram = pApp->GetSetting(C_String(ui+1) + ".Name",C_String("Pgrm") + ui+1);
C_String strFileName = pApp->GetSetting(C_String(ui+1)+".FileName", "");
C_String strType = pApp->GetSetting(C_String(ui+1) + ".Type", "Mpeg2-TS");
C_String strDevice = pApp->GetSetting(C_String(ui+1)+".Device", "");
// update settings
C_String strKey = C_String(ui)+ ".Name";
pApp->SetSettings(strKey,strProgram);
strKey = C_String(ui)+ ".FileName";
pApp->SetSettings(strKey, strFileName);
strKey = C_String(ui)+ ".Device";
pApp->SetSettings(strKey, strDevice);
strKey = C_String(ui)+ ".Type";
pApp->SetSettings(strKey, strType);
}
// Lower program count
uiPgrmCount--;
strDelKey = C_String("Input.ProgramCount");
C_String strProgramCount=C_String(uiPgrmCount);
pApp->SetSettings(strDelKey, strPgrmCount);
//pApp->SetSettings(strDelKey, C_String(uiPgrmCount));
m_vProgramNames.Delete(uiId);
// ** DEBUG **
Log(m_hLog, LOG_NOTE, "Debugging inputs m_cSettings list.");
C_String strPgrmCount = pApp->GetSetting("Input.ProgramCount", "0");
unsigned int uiPgrmCount = strPgrmCount.ToInt();
for(unsigned int ui = 1; ui <= uiPgrmCount; ui++)
{
C_String strProgram = pApp->GetSetting(C_String(ui) + ".Name",C_String("Pgrm") + ui);
C_String strFileName = pApp->GetSetting(C_String(ui)+".FileName", "");
C_String strDevice = pApp->GetSetting(C_String(ui)+".Device", "");
C_String strType = pApp->GetSetting(C_String(ui) + ".Type", "Mpeg2-TS").ToLower();
Log(m_hLog, LOG_NOTE, "Program: \"" + strProgram +"\"");
Log(m_hLog, LOG_NOTE, " FileName: \"" + strFileName+"\"");
Log(m_hLog, LOG_NOTE, " Device: \"" + strDevice+"\"");
Log(m_hLog, LOG_NOTE, " Type: \"" + strType+"\"");
}
}
else
{
throw E_Exception(GEN_ERR,"Deleting program information from input failed");
}
}
else
{
throw E_Exception(GEN_ERR, "The program is not known by this input.");
}
ASSERT(false);
}
......@@ -2,7 +2,7 @@
* videoinput.cpp: Video4linux streams
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: videoinput.cpp,v 1.17 2003/08/13 22:51:33 adq Exp $
* $Id: videoinput.cpp,v 1.18 2003/08/14 11:12:53 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -105,10 +105,10 @@ void C_VideoInput::OnInit()
ASSERT(pApp);
// Retrieve the configuration from vls.cfg
m_strDevice = pApp->GetSetting(GetName() + ".Device", "/dev/video");
m_strType = pApp->GetSetting(GetName() + ".Type", "Mpeg2-PS").ToLower();
m_strTrickPlayType = pApp->GetSetting(GetName() + ".TrickPlay",
"Normal").ToLower();
m_strDevice = pApp->GetSetting(GetName() + ".device", "/dev/video");
m_strType = pApp->GetSetting(GetName() + ".type", "mpeg2-ps").ToLower();
m_strTrickPlayType = pApp->GetSetting(GetName() + ".trickplay",
"normal").ToLower();
// Build the program list : there is only one program named "video"
C_String* pStr = new C_String("video");
......
......@@ -2,7 +2,7 @@
* admin.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: admin.cpp,v 1.29 2003/08/13 15:59:31 nitrox Exp $
* $Id: admin.cpp,v 1.30 2003/08/14 11:12:54 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -583,7 +583,7 @@ int C_Admin::Init()
#endif
// Groups
C_Vector<C_Setting> vGroups = pApp->GetSettings("Groups");
C_Vector<C_Setting> vGroups = pApp->GetSettings("groups");
for(unsigned int ui = 0; ui < vGroups.Size(); ui++)
{
......@@ -626,7 +626,7 @@ int C_Admin::Init()
// Users
if(!iRc)
{
C_Vector<C_Setting> vUsers = pApp->GetSettings("Users");
C_Vector<C_Setting> vUsers = pApp->GetSettings("users");
for(unsigned int ui = 0; ui < vUsers.Size(); ui++)