Commit 9ed90260 authored by Alexis de Lattre's avatar Alexis de Lattre

New 'port' parameter, coutesy of Philippe Van Hecke

<philippe.vanhecke@belnet.be>.
parent f20241c5
......@@ -2,10 +2,10 @@
* message.cpp : SAP Message class
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: message.cpp,v 1.2 2003/05/25 16:36:00 nitrox Exp $
* $Id: message.cpp,v 1.3 2003/05/25 21:41:19 alexis Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
*
* Philippe Van Hecke <philippe.vanhecke@belnet.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -145,7 +145,7 @@ void Message::AddProgram(Program *p)
fprintf(stderr, "Non permanent program not supported ...\n");
fprintf(stderr, "Announcing permanent session instead\n");
}
string m="m=audio 1234 udp 14\n";
string m="m=audio "+p->GetPort()+" udp 14\n";
string c="c=IN IP4 "+p->GetAddress()+"/15\n";
// TODO ttl type should be specified
string a="a=type:test\n";
......
......@@ -2,12 +2,13 @@
* parser.cpp : SAP configuration file parser
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: parser.cpp,v 1.1 2003/05/22 02:22:45 nitrox Exp $
* $Id: parser.cpp,v 1.2 2003/05/25 21:41:19 alexis Exp $
*
* Authors: Fabrice Ollivier <cif@via.ecp.fr>
* Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
* Damien Lucas
* Damien Lucas <nitrox@videolan.org>
* Philippe Van Hecke <philippe.vanhecke@belnet.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -161,6 +162,10 @@ int Config::Parse()
if(something)
{
/* We were in a program with at least one field filled */
if (!pp->GetPort().length())
{
pp->SetPort("1234");
}
Programs.push_back(pp);
pp=new Program();
something=0;
......@@ -201,8 +206,23 @@ int Config::Parse()
something=1;
pp->SetAddress(tline);
}
if(strstr(line,"port="))
{
strgeta(line,tline,'=');
something=1;
pp->SetPort(tline);
}
}
if(something)
{
if (!pp->GetPort().length())
{
pp->SetPort("1234");
}
if(something) Programs.push_back(pp);
Programs.push_back(pp);
}
return(0);
}
......@@ -2,10 +2,10 @@
* program.cpp : SAP Program class
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: program.cpp,v 1.2 2003/05/25 16:36:00 nitrox Exp $
* $Id: program.cpp,v 1.3 2003/05/25 21:41:19 alexis Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
*
* Philippe Van Hecke <philippe.vanhecke@belnet.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -45,6 +45,7 @@ string Program::GetUser(void) {return user;}
string Program::GetMachine(void) {return machine;}
string Program::GetSite(void) {return site;}
string Program::GetAddress(void){return address;}
string Program::GetPort(void){return port;}
bool Program::IsPermanent(void){return permanent;}
void Program::SetName(char* n){name=n;}
......@@ -52,13 +53,15 @@ void Program::SetUser(char* u){user=u;}
void Program::SetMachine(char* m){machine=m;}
void Program::SetSite(char* s){site=s;}
void Program::SetAddress(char* a){address=a;}
void Program::SetPort(char* p){port=p;}
Program::Program(string n, string u, string m, string s, string a)
Program::Program(string n, string u, string m, string s, string a,string p)
{
name=n;
user=u;
machine=m;
site=s;
address=a;
port=p;
permanent=true;
}
......@@ -2,7 +2,7 @@
* program.h : SAP programs classes definition
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: program.h,v 1.2 2003/05/25 16:36:00 nitrox Exp $
* $Id: program.h,v 1.3 2003/05/25 21:41:19 alexis Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
*
......@@ -25,7 +25,7 @@
class Program
{
public:
Program(string, string, string, string, string);
Program(string, string, string, string, string,string);
Program();
~Program();
string GetName();
......@@ -33,11 +33,13 @@ class Program
string GetMachine();
string GetSite();
string GetAddress();
string GetPort();
void SetName(char*);
void SetUser(char*);
void SetMachine(char*);
void SetSite(char*);
void SetAddress(char*);
void SetPort(char *);
bool IsPermanent();
private:
......@@ -46,6 +48,7 @@ class Program
string machine;
string site;
string address;
string port;
bool permanent;
uint32_t start_time;
uint32_t stop_time;
......
......@@ -13,6 +13,7 @@ user=videolan# Name of the streaming entity
machine=vlcs.via.ecp.fr # Name of the streaming machine
site=www.videolan.org # Site of the streaming entity
address=239.255.12.12 # Multicast IP address of the program
port=1234
[program]
name=TV2
......@@ -20,3 +21,4 @@ user=videolan
machine=vlcs.via.ecp.fr
site=www.videolan.org
address=239.255.12.13
port=1234
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