Commit 36d6dbe2 authored by Damien Lucas's avatar Damien Lucas

. fix the shutdown process

 . fix refcounts stuffs
 . changed settings functions in order to be case sensitive
 . added configure in .cvsignore
parent 0b27b2a5
......@@ -7,3 +7,4 @@ config.status
autom4te.cache
Makefile.opts
build-stamp
configure
......@@ -2,7 +2,7 @@
* settings.cpp: Application settings management
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: settings.cpp,v 1.15 2003/08/05 23:18:19 nitrox Exp $
* $Id: settings.cpp,v 1.16 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -122,7 +122,7 @@ void C_SettingsHandler::OnStartSection(const C_String& strName)
#ifdef DEBUG
printf("Implicit declaration of input 'local1'\n");
#endif
OnStartSection("inputs");
OnStartSection("Inputs");
OnProperty("local1", "local");
OnEndSection("Inputs");
m_strPrefix += "local1.";
......@@ -196,7 +196,7 @@ void C_SettingsHandler::OnProperty(const C_String& strName,
const C_String& strValue)
{
C_String strKey = m_strPrefix + strName;
m_pSettings->Update(strKey.ToLower(), strValue);
m_pSettings->Update(strKey, strValue);
}
......@@ -270,9 +270,12 @@ void C_Settings::Delete(const C_String& strName)
C_String C_Settings::GetSetting(const C_String& strName,
const C_String& strDfltValue) const
{
C_String* pstrValue = m_cSettings.Get(strName.ToLower());
C_String* pstrValue = m_cSettings.Get(strName);
//C_String* pstrValue = m_cSettings.Get(strName.ToLower());
if(pstrValue)
{
return *pstrValue;
}
else
{
return strDfltValue;
......@@ -295,7 +298,7 @@ C_Vector<C_Setting> C_Settings::GetSettings(const C_String& strSection) const
C_String strName = pNode->GetKey();
C_String* pstrValue = pNode->GetValue();
if(strName.StartsWith(strSection.ToLower() + "."))
if(strName.StartsWith(strSection + "."))
{
// Strip the initial section name
unsigned int iOffset = strSection.Length() + 1;
......
......@@ -2,7 +2,7 @@
* localinput.cpp: Local streams
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: localinput.cpp,v 1.19 2003/08/13 22:48:43 adq Exp $
* $Id: localinput.cpp,v 1.20 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -497,7 +497,6 @@ void C_LocalInput::OnUpdateProgram(C_String strProgram,
Log(m_hLog, LOG_WARN, "Program already exists in the list for this input");
}
printf("here we are \n"); //nitrox
printf("uiPgrmCount =%d\n", uiPgrmCount);
if(uiPgrmCount)
{
......
......@@ -2,7 +2,7 @@
* trickplay.cpp: base class to control trickplay status
*-------------------------------------------------------------------------------
* (c)1999-2003 VideoLAN
* $Id: trickplay.cpp,v 1.3 2003/08/08 16:54:18 tooney Exp $
* $Id: trickplay.cpp,v 1.4 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -95,9 +95,10 @@ void C_TrickPlay::InitWork()
void C_TrickPlay::StopWork()
{
m_iRequestTrickPlayStatus = TRICKPLAY_STOP;
m_cResumeCond.Protect();
m_cResumeCond.Signal();
m_bStop = true;
m_pConverter->StopWork();
//Interrupt();
Interrupt();
}
......
......@@ -4,7 +4,7 @@
* --Meuuh
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: config.h.in,v 1.4 2002/07/12 18:09:36 massiot Exp $
* $Id: config.h.in,v 1.5 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -36,7 +36,7 @@
//------------------------------------------------------------------------------
#define PGRM_VERSION "@VLS_VERSION@"
#define PGRM_INFO "VideoLAN Server v @VLS_VERSION@ (" __DATE__ ") " \
"- (c)1999-2002 VideoLAN\n"
"- (c)1999-2003 VideoLAN\n"
#define PLUGIN_PATH "@prefix@/lib/videolan/vls"
......
......@@ -2,7 +2,7 @@
* manager.cpp: Vls manager
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: manager.cpp,v 1.39 2003/08/13 15:59:31 nitrox Exp $
* $Id: manager.cpp,v 1.40 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -152,7 +152,7 @@ int C_Manager::Run()
}
}
return iRc;
}
......@@ -224,7 +224,7 @@ void C_Manager::InitPgrmTable()
// Get the input lists of programs and merge them with the manager one
C_RepositoryBrowser<C_String, C_Input> cIterator =
m_cInputList.CreateBrowser();
while(cIterator.HasNextItem())
{
C_Input* pInput = cIterator.GetNextItem();
......@@ -464,7 +464,7 @@ void C_Manager::DestroyChannels()
//------------------------------------------------------------------------------
void C_Manager::StopPrograms()
{
// Stop all th programs so that the inputs could be destroyed
// Stop all the programs so that the inputs could be destroyed
m_cBroadcastsList.Lock();
......@@ -479,7 +479,7 @@ void C_Manager::StopPrograms()
if(pBroadcast->GetStatus()!=BROADCAST_WAITING)
{
C_Request* pRequest = new C_Request("broadcast_stop");
pRequest->SetArg("broadcast", pBroadcast->GetChannel()->GetName());
pRequest->SetArg("broadcast", pBroadcast->GetName());
cRequests.Add(pRequest);
}
}
......@@ -491,17 +491,6 @@ void C_Manager::StopPrograms()
{
C_Request& cRequest = cRequests[i];
HandleRequest(cRequest);
LogDbg(m_hLog, "Remove the broadcast");
m_cBroadcastsList.Lock();
#ifdef DEBUG
int iRc = m_cBroadcastsList.Remove(cRequest.GetArg("program") + ":" +
cRequest.GetArg("input"));
#else
m_cBroadcastsList.Remove(cRequest.GetArg("program") + ":" +
cRequest.GetArg("input"));
#endif
m_cBroadcastsList.UnLock();
LogDbg(m_hLog, C_String("Broadcast removed with status ") + iRc);
}
}
......@@ -571,13 +560,12 @@ void C_Manager::PrivHandleEvent(const C_Event& cEvent)
case EOF_EVENT :
case CONNEXION_LOST_EVENT :
C_String strName = cEvent.GetBroadcast()->GetName();
ASSERT(strName != "");
// First we have to stop the broadcasts
C_Request cRequest("broadcast_stop");
cRequest.SetArg("broadcast", strName);
C_Answer cAnswer = HandleRequest(cRequest);
break;
}
}
......
......@@ -2,7 +2,7 @@
* manager_broadcast.cpp: Brodacast mtehods for Vls manager
*-------------------------------------------------------------------------------
* (c)1999-2003 VideoLAN
* $Id: manager_broadcast.cpp,v 1.4 2003/08/13 15:59:31 nitrox Exp $
* $Id: manager_broadcast.cpp,v 1.5 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Damien Lucas <damien.lucas@anevia.com>
* Benoit Steiner <benny@via.ecp.fr>
......@@ -74,9 +74,7 @@ C_Broadcast* C_Manager::CreateBroadcast(C_String& strName,
m_cBroadcastsList.Add(strName, pBroadcast);
m_cBroadcastsList.UnLock();
}
if ( pInput ) m_cInputList.Release(strInput);
if ( pChannel ) m_cChannelList.Release(strChannel);
if ( pPgrm ) m_cProgramList.ReleasePgrm(strPgrm);
return pBroadcast;
......@@ -176,9 +174,8 @@ C_Answer C_Manager::Broadcast_Del(C_Request& cRequest)
cAnswer.Add(cInputAnswer);
//Release repository items (Channel, Program, Input)
// m_cChannelList.Release(pBroadcast->GetChannel()->GetName());
// m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
// m_cInputList.Release(pInput->GetName());
m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());
}
else
{
......@@ -276,10 +273,6 @@ C_Answer C_Manager::Broadcast_Resume(C_Request& cRequest)
}
cAnswer.Add(cInputAnswer);
// Release repository items (Channel, Program, Input)
m_cChannelList.Release(strChannel);
m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());
}
else
{
......@@ -316,10 +309,9 @@ C_Answer C_Manager::Broadcast_Suspend(C_Request& cRequest)
}
cAnswer.Add(cInputAnswer);
// Release repository items (Channel, Program, Input)
m_cChannelList.Release(strChannel);
m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());
// Release repository items (Program, Input)
/*m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());*/
}
else
{
......@@ -357,10 +349,6 @@ C_Answer C_Manager::Broadcast_Forward(C_Request& cRequest)
}
cAnswer.Add(cInputAnswer);
// Release repository items (Channel, Program, Input)
m_cChannelList.Release(strChannel);
m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());
}
else
{
......@@ -397,10 +385,6 @@ C_Answer C_Manager::Broadcast_Rewind(C_Request& cRequest)
}
cAnswer.Add(cInputAnswer);
// Release repository items (Channel, Program, Input)
m_cChannelList.Release(strChannel);
m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());
}
else
{
......@@ -436,7 +420,6 @@ C_Answer C_Manager::Broadcast_Stop(C_Request& cRequest)
cAnswer.Add(cInputAnswer);
// Release repository items (Channel, Program, Input)
m_cChannelList.Release(strChannel);
m_cProgramList.ReleasePgrm(pBroadcast->GetProgram()->GetName());
m_cInputList.Release(pInput->GetName());
......@@ -452,6 +435,7 @@ C_Answer C_Manager::Broadcast_Stop(C_Request& cRequest)
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Nothing broadcasted to channel " + strChannel);
fprintf(stderr, "nitrox --- nothing broadcasted to this bbroadcast\n");
}
m_cBroadcastsList.UnLock();
......
......@@ -2,7 +2,7 @@
* manager_channel.cpp: Channel methods for Vls manager
*-------------------------------------------------------------------------------
* (c)1999-2003 VideoLAN
* $Id: manager_channel.cpp,v 1.4 2003/08/13 15:59:31 nitrox Exp $
* $Id: manager_channel.cpp,v 1.5 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Damien Lucas <damien.lucas@anevia.com>
* Benoit Steiner <benny@via.ecp.fr>
......@@ -121,15 +121,15 @@ C_Answer C_Manager::Channel_Add (C_Request& cRequest)
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
C_String strKey = C_String("Channels.") + cConfig.m_strName;
C_String strKey = C_String("channels.") + cConfig.m_strName;
pApp->SetSettings( strKey, cConfig.m_strType );
strKey = cConfig.m_strName+C_String(".DstHost");
strKey = cConfig.m_strName+C_String(".dsthost");
pApp->SetSettings( strKey, cConfig.m_strDstHost );
strKey = cConfig.m_strName+C_String(".DstPort");
strKey = cConfig.m_strName+C_String(".dstport");
pApp->SetSettings( strKey, cConfig.m_strDstPort );
strKey = cConfig.m_strName+C_String(".Domain");
strKey = cConfig.m_strName+C_String(".domain");
pApp->SetSettings( strKey, cConfig.m_strDomain );
strKey = cConfig.m_strName+C_String(".TTL");
strKey = cConfig.m_strName+C_String(".ttl");
C_String a=C_String("");
a += cConfig.m_iTTL;
pApp->SetSettings( strKey, a );
......@@ -140,7 +140,7 @@ C_Answer C_Manager::Channel_Add (C_Request& cRequest)
}
if(cConfig.m_strInterface!="")
{
strKey = cConfig.m_strName+C_String(".Interface");
strKey = cConfig.m_strName+C_String(".interface");
pApp->SetSettings( strKey, cConfig.m_strInterface );
}
......@@ -238,7 +238,7 @@ C_Answer C_Manager::Channel_Del(C_Request& cRequest)
{
C_String strKey = C_String("channels.")+strChannelName;
if (pApp->GetSetting(strKey, "") != "")
pApp->DeleteSetting(strKey);
pApp->DeleteSetting(strKey);
strKey = strChannelName + C_String(".dsthost") ;
if (pApp->GetSetting(strKey, "") != "")
pApp->DeleteSetting(strKey);
......
......@@ -2,7 +2,7 @@
* repository.h: Repository class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: repository.h,v 1.5 2003/08/08 15:57:50 nitrox Exp $
* $Id: repository.h,v 1.6 2003/08/14 08:50:14 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -61,7 +61,7 @@ template <class T> class C_RepositoryItem
{
ASSERT(false);
}
T* GetItem()
{ return m_pItem; }
......@@ -82,18 +82,18 @@ template <class T> class C_RepositoryItem
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
//
//
//------------------------------------------------------------------------------
template <class Key, class Data> class C_RepositoryBrowser
{
public:
inline C_RepositoryBrowser(const C_Repository<Key, Data>& cRepository);
// Items browsing
bool HasNextItem()
{ return m_cDataIterator.HasNext(); }
inline Data* GetNextItem();
// Keys browsing
bool HasNextkey()
{ return m_cKeyIterator.HasNext(); }
......@@ -132,7 +132,7 @@ template <class Key, class Data> class C_Repository
// Repository locking
void Lock();
void UnLock();
// Global repository update
// Should only be called when a lock on the repository has been taken
int Add(const Key& cKey, Data* pItem);
......@@ -144,7 +144,7 @@ template <class Key, class Data> class C_Repository
// [] must be used instead
Data* Get(const Key& cKey);
void Release(const Key& cKey);
// Repository browsing. Must be used only when a lock on the
// repository is owned
Data* operator [] (const Key& cKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment