Commit c71a7ea7 authored by Damien Lucas's avatar Damien Lucas

. parser.cpp manager.cpp admin.cpp:

    Changed the 'type' option in the Channel definition to 'streamtype'
     'type' is the ChannelType (network, file, ...)
     'streamtype' is an option for network channel specifying multicast/unicast

. vls.cfg: updated for parameter streamtype

. admin.cpp manger.cpp: modification in the answer for 'show' command.
  optional arguments are now shown only if they were set by the user.
parent c6d6a74b
......@@ -2,7 +2,7 @@
* parsers.cpp: Command line and configuration files parsers
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: parsers.cpp,v 1.17 2003/06/04 17:47:30 alexis Exp $
* $Id: parsers.cpp,v 1.18 2003/06/26 01:00:35 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -317,7 +317,7 @@ void C_CfgFileParser::AddCmdLineSetting(unsigned char sOption, C_String sValue)
m_pCallBack->OnProperty("DstHost", sDest1);
if(sDest2!="") m_pCallBack->OnProperty("DstPort", sDest2);
if(sDest1.ToInt()<=239 && sDest1.ToInt()>=224)
m_pCallBack->OnProperty("Type", "multicast");
m_pCallBack->OnProperty("StreamType", "multicast");
if(sMeth=="udp") m_pCallBack->OnProperty("Protocol", "udp");
else m_pCallBack->OnProperty("Protocol", "rtp");
m_pCallBack->OnEndSection("output1");
......
......@@ -2,7 +2,7 @@
* dvbinput.cpp: DVB streams
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.cpp,v 1.24 2003/06/02 19:50:35 jpsaman Exp $
* $Id: dvbinput.cpp,v 1.25 2003/06/26 01:00:35 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Damien Lucas <nitrox@videolan.org>
......@@ -143,7 +143,7 @@ void C_DvbInput::OnInit()
C_String dvbrc;
char filen[FILELEN];
char devname[80];
// Retrieve config
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
......@@ -162,7 +162,7 @@ void C_DvbInput::OnInit()
sprintf(devname, DVR_DEV, iNumber, 0); m_strDVR = C_String(devname);
sprintf(devname, DEMUX_DEV, iNumber, 0); m_strDEMUX = C_String(devname);
sprintf(devname, VIDEO_DEV, iNumber, 0); m_strVIDEO = C_String(devname);
//Check whether card has a decoder:
//When opening the video device, we should get an error
int iDummy=open(m_strVIDEO.GetString(), O_RDWR|O_NONBLOCK);
......@@ -185,7 +185,7 @@ void C_DvbInput::OnInit()
}
Log(m_hLog, LOG_NOTE, strType + " Card registered "+
(m_bHasDecoder ? "with decoder\n" : "without decoder\n"));
//Get the .dvbrc file
if (!get_dvbrc(filen,*dvb,iNumber,FILELEN))
throw E_Exception(GEN_ERR, "Unable to find any dvbrc file");
......@@ -338,7 +338,7 @@ void C_DvbInput::OnSelectPid(u16 iPid, u8 iType)
if((m_iSendMethod == 0) || (iType < TS_TYPE_MPEG2_PRIVATE))
{
int iFd = open(m_strDEMUX.GetString(), O_RDWR|O_NONBLOCK);
if(iFd < 0)
Log(m_hLog, LOG_ERROR, "Unable to open demux");
......@@ -346,18 +346,18 @@ void C_DvbInput::OnSelectPid(u16 iPid, u8 iType)
{
struct dmx_pes_filter_params pesFilterParams;
pesFilterParams.pid = iPid;
pesFilterParams.input = DMX_IN_FRONTEND;
pesFilterParams.output = DMX_OUT_TS_TAP;
// With Nova Cards, putting DMX_PES_VIDEO & DMX_PES_AUDIO
// doesn't work when receiving severals programs
// Putting DMX_PES_OTHER everywhere seems to work...
//
// But, with DVB-S Cards, you should put the exact type ...
// It implicates that can receive only 1 audio channel
if(!m_bHasDecoder) pesFilterParams.pes_type = DMX_PES_OTHER;
else
{
......
......@@ -2,7 +2,7 @@
* netoutput.cpp: network output
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netoutput.cpp,v 1.12 2003/02/24 18:55:49 tooney Exp $
* $Id: netoutput.cpp,v 1.13 2003/06/26 01:00:35 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -63,7 +63,8 @@ C_NetOutput::C_NetOutput(const C_String& strChannelName)
m_strSrcPort = pApp->GetSetting(strChannelName+".SrcPort", "");
m_strDstHost = pApp->GetSetting(strChannelName+".DstHost", "");
m_strDstPort = pApp->GetSetting(strChannelName+".DstPort", "1234");
m_strType = pApp->GetSetting(strChannelName+".Type", "unicast").ToLower();
m_strType =
pApp->GetSetting(strChannelName+".StreamType", "unicast").ToLower();
m_strInterface = pApp->GetSetting(strChannelName+".Interface", "");
C_String strTTL = pApp->GetSetting(strChannelName+".TTL", "0");
m_iTTL = strTTL.ToInt();
......
......@@ -2,7 +2,7 @@
* manager.cpp: Vls manager
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: manager.cpp,v 1.26 2003/06/02 19:50:36 jpsaman Exp $
* $Id: manager.cpp,v 1.27 2003/06/26 01:00:35 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -714,8 +714,16 @@ C_Answer C_Manager::Show(const C_Request& cRequest)
// Create answer
C_Answer cChannelDescr(strChannelName);
cChannelDescr.SetStatus(NO_ERR);
if(strSettings!="")
{
cChannelDescr.AddMessage("channel "+strChannelName+
" type "+strChannelType+" "+strSettings);
}
else
{
cChannelDescr.AddMessage("channel "+strChannelName+
" type "+strChannelType);
}
cAnswer.Add(cChannelDescr);
}
cAnswer.SetStatus(NO_ERR);
......@@ -1233,7 +1241,7 @@ C_Answer C_Manager::Channel(const C_Request& cRequest)
C_String strDstPort = cRequest.GetArg("dest_port");
ASSERT(strDstPort != "");
C_String strStreamType = cRequest.GetArg("stream_type");
C_String strStreamType = cRequest.GetArg("streamtype");
ASSERT(strStreamType != "");
// Optional arguments
......@@ -1278,14 +1286,26 @@ C_Answer C_Manager::Channel(const C_Request& cRequest)
pApp->SetSettings( strKey, strDstHost );
strKey = strChannelName+C_String(".DstPort");
pApp->SetSettings( strKey, strDstPort );
strKey = strChannelName+C_String(".Type");
pApp->SetSettings( strKey, strStreamType );
strKey = strChannelName+C_String(".Domain");
pApp->SetSettings( strKey, strDomain );
strKey = strChannelName+C_String(".TTL");
pApp->SetSettings( strKey, strTTL );
strKey = strChannelName+C_String(".Interface");
pApp->SetSettings( strKey, strInterface );
if(strStreamType!="")
{
strKey = strChannelName+C_String(".streamtype");
pApp->SetSettings( strKey, strStreamType );
}
if(strDomain!="")
{
strKey = strChannelName+C_String(".Domain");
pApp->SetSettings( strKey, strDomain );
}
if(strTTL!="")
{
strKey = strChannelName+C_String(".TTL");
pApp->SetSettings( strKey, strTTL );
}
if(strInterface!="")
{
strKey = strChannelName+C_String(".Interface");
pApp->SetSettings( strKey, strInterface );
}
C_ChannelModule* pModule = (C_ChannelModule*)
C_Application::GetModuleManager()
......
......@@ -198,18 +198,18 @@ END
#END
#BEGIN "multicast1" # multicast example
# Type = "multicast"
# TTL = "1" # Time To Live
# DstHost = "239.2.12.42" # multicast address
# DstPort = "1234" # destination port
# streamtype = "multicast"
# TTL = "1" # Time To Live
# DstHost = "239.2.12.42" # multicast address
# DstPort = "1234" # destination port
#END
#BEGIN "multicast2" # multicast IPv6 example
# Domain = "inet6"
# Type = "multicast"
# TTL = "1" # Time To Live
# DstHost = "ff08::2" # multicast IPv6 address
# DstPort = "1234" # destination port
# Domain = "inet6"
# streamtype = "multicast"
# TTL = "1" # Time To Live
# DstHost = "ff08::2" # multicast IPv6 address
# DstPort = "1234" # destination port
#END
#BEGIN "localfile" # file output example
......
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