Commit b24affc1 authored by Clément Stenac's avatar Clément Stenac

HTTP announcing support

parent 3ee0c159
......@@ -2,7 +2,7 @@
* message.cpp : SAP Message class
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: message.cpp,v 1.6 2003/07/24 17:09:22 nitrox Exp $
* $Id: message.cpp,v 1.7 2003/09/11 15:33:53 zorglub Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
* Philippe Van Hecke <philippe.vanhecke@belnet.be>
......@@ -145,7 +145,16 @@ void Message::AddProgram(Program *p)
fprintf(stderr, "Non permanent program not supported ...\n");
fprintf(stderr, "Announcing permanent session instead\n");
}
string m="m=audio "+p->GetPort()+" udp 14\n";
string m="m=audio "+p->GetPort()+" ";
if( p->IsHTTP() )
{
m+="http 14\n";
}
else
{
m+="udp 14\n";
}
string c;
......@@ -154,10 +163,22 @@ void Message::AddProgram(Program *p)
else
c="c=IN IP4 "+p->GetAddress()+"/"+p->GetTTL()+"\n";
// TODO ttl type should be specified
string a="a=type:test\n";
string a;
if( p->IsHTTP() )
{
a+= "a=type:http\n";
a+= "a=http-path:"+p->GetHTTPPath()+"\n";
}
else
{
a= "a=type:udp\n";
}
sdp += v + o + s + u + t + m + c + a;
printf("%s\n",sdp.c_str());
return;
}
......
......@@ -2,7 +2,7 @@
* parser.cpp : SAP configuration file parser
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: parser.cpp,v 1.7 2003/08/10 12:44:18 zorglub Exp $
* $Id: parser.cpp,v 1.8 2003/09/11 15:33:53 zorglub Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
......@@ -259,6 +259,18 @@ int Config::Parse()
pp->SetIPVersion(tline);
}
if(strstr(line,"type=") && strstr(line,"http") )
{
pp->SetHTTP(true);
}
if(strstr(line,"path="))
{
strgeta(line,tline,'=');
something=1;
pp->SetHTTPPath(tline);
}
if(strstr(line,"user="))
{
strgeta(line,tline,'=');
......
......@@ -2,7 +2,7 @@
* program.cpp : SAP Program class
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: program.cpp,v 1.8 2003/08/10 12:44:18 zorglub Exp $
* $Id: program.cpp,v 1.9 2003/09/11 15:33:53 zorglub Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
* Philippe Van Hecke <philippe.vanhecke@belnet.be>
......@@ -55,17 +55,20 @@ string Program::GetSite(void) {return site;}
string Program::GetAddress(void){return address;}
string Program::GetPort(void){return port;}
string Program::GetTTL(void){return program_ttl;}
string Program::GetHTTPPath(void){return http_path;}
int Program::GetIPVersion(void){return program_ipversion;};
bool Program::IsPermanent(void){return permanent;}
bool Program::IsHTTP(void){return b_http;}
void Program::SetHTTP(bool b){b_http = b;}
void Program::SetName(char* n){name=n;}
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::SetHTTPPath(char *h){http_path=h;}
void Program::SetPort(char* p)
{
int i_port=atoi(p);
......
......@@ -2,7 +2,7 @@
* program.h : SAP programs classes definition
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: program.h,v 1.6 2003/07/24 17:09:22 nitrox Exp $
* $Id: program.h,v 1.7 2003/09/11 15:33:53 zorglub Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
*
......@@ -37,6 +37,7 @@ class Program
string GetAddress();
string GetPort();
string GetTTL();
string GetHTTPPath();
int GetIPVersion();
/* Functions to set the values */
......@@ -47,9 +48,12 @@ class Program
void SetAddress(char*);
void SetPort(char *);
void SetTTL(char *);
void SetHTTPPath(char *);
void SetIPVersion(char *);
void SetHTTP(bool);
bool IsPermanent();
bool IsHTTP();
private:
string name;
......@@ -59,8 +63,10 @@ class Program
string address;
string port;
string program_ttl;
string http_path;
int program_ipversion;
bool permanent;
bool b_http;
uint32_t start_time;
uint32_t stop_time;
/* TODO support for periodical programs */
......
......@@ -41,6 +41,6 @@ site=www.videolan.org
program_ttl=12
program_ipversion=4
type=http
address=myserver.com
address=echo.via.ecp.fr
port=80
path=/myfolder/mystream.mpg
path=/~zorglub/2k3.avi
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