From ce6843044cd9d446a897e11ba94cc65878da963f Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 20 Oct 2010 03:23:28 +0200 Subject: [PATCH] Restructuring + installer scripts --- .gitignore | 6 +++--- {Server => Buffer}/Makefile | 2 +- {Server => Buffer}/buffer.h | 0 {Server => Buffer}/main.cpp | 0 {Server => Buffer}/play1000kbit.sh | 2 +- {Server => Buffer}/playh264.sh | 4 ++-- {Server => Buffer}/user.cpp | 0 {Client => Connector_HTTP}/Makefile | 2 +- {Client => Connector_HTTP}/main.cpp | 0 Connector_RTMP/parsechunks.cpp | 2 +- Makefile | 25 +++++++++++++++++++++++++ 11 files changed, 34 insertions(+), 9 deletions(-) rename {Server => Buffer}/Makefile (96%) rename {Server => Buffer}/buffer.h (100%) rename {Server => Buffer}/main.cpp (100%) rename {Server => Buffer}/play1000kbit.sh (82%) rename {Server => Buffer}/playh264.sh (90%) rename {Server => Buffer}/user.cpp (100%) rename {Client => Connector_HTTP}/Makefile (95%) rename {Client => Connector_HTTP}/main.cpp (100%) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 8896d067..e1c6e5a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ #ignore object files and nonsense like that *.[oa] Admin/main -Client/Client_PLS -Server/Server_PLS +Connector_HTTP/Connector_HTTP +Buffer/Buffer Connector_RTMP/Connector_RTMP Connector_RTSP/Connector_RTSP *~ - +bin/* diff --git a/Server/Makefile b/Buffer/Makefile similarity index 96% rename from Server/Makefile rename to Buffer/Makefile index ace5d9e8..a1e7bd97 100644 --- a/Server/Makefile +++ b/Buffer/Makefile @@ -1,6 +1,6 @@ SRC = main.cpp ../sockets/sw_base.cpp ../sockets/sw_inet.cpp ../sockets/sw_unix.cpp OBJ = $(SRC:.cpp=.o) -OUT = Server_PLS +OUT = Buffer INCLUDES = CCFLAGS = -Wall -Wextra -funsigned-char -g CC = $(CROSS)g++ diff --git a/Server/buffer.h b/Buffer/buffer.h similarity index 100% rename from Server/buffer.h rename to Buffer/buffer.h diff --git a/Server/main.cpp b/Buffer/main.cpp similarity index 100% rename from Server/main.cpp rename to Buffer/main.cpp diff --git a/Server/play1000kbit.sh b/Buffer/play1000kbit.sh similarity index 82% rename from Server/play1000kbit.sh rename to Buffer/play1000kbit.sh index c6811478..4393b22e 100755 --- a/Server/play1000kbit.sh +++ b/Buffer/play1000kbit.sh @@ -1,4 +1,4 @@ #!/bin/bash -ffmpeg -re -i "$1" -b 1024000 -ar 11025 -f flv - 2> /dev/null | ./Server_PLS 500 +ffmpeg -re -i "$1" -b 1024000 -ar 11025 -f flv - 2> /dev/null | ./Buffer 500 diff --git a/Server/playh264.sh b/Buffer/playh264.sh similarity index 90% rename from Server/playh264.sh rename to Buffer/playh264.sh index cbc0473b..cde1f2fd 100755 --- a/Server/playh264.sh +++ b/Buffer/playh264.sh @@ -3,7 +3,7 @@ -#ffmpeg -y -i "$1" -ar 44100 -vcodec libx264 -b 1000k -g 150 -r 20 -f flv - | ./Server_PLS 500 +#ffmpeg -y -i "$1" -ar 44100 -vcodec libx264 -b 1000k -g 150 -r 20 -f flv - | ./Buffer 500 -ffmpeg -i "$1" -re -acodec aac -ar 11025 -vcodec libx264 -b 700k -vpre ultrafast -refs 1 -bf 0 -g 150 -f flv - 2> /dev/null | ./Server_PLS 500 +ffmpeg -i "$1" -re -acodec aac -ar 11025 -vcodec libx264 -b 700k -vpre ultrafast -refs 1 -bf 0 -g 150 -f flv - 2> /dev/null | ./Buffer 500 diff --git a/Server/user.cpp b/Buffer/user.cpp similarity index 100% rename from Server/user.cpp rename to Buffer/user.cpp diff --git a/Client/Makefile b/Connector_HTTP/Makefile similarity index 95% rename from Client/Makefile rename to Connector_HTTP/Makefile index 532552af..c56329e5 100644 --- a/Client/Makefile +++ b/Connector_HTTP/Makefile @@ -1,6 +1,6 @@ SRC = main.cpp ../sockets/sw_base.cpp ../sockets/sw_inet.cpp ../sockets/sw_unix.cpp OBJ = $(SRC:.cpp=.o) -OUT = Client_PLS +OUT = Connector_HTTP INCLUDES = CCFLAGS = -Wall -Wextra -funsigned-char -g CC = $(CROSS)g++ diff --git a/Client/main.cpp b/Connector_HTTP/main.cpp similarity index 100% rename from Client/main.cpp rename to Connector_HTTP/main.cpp diff --git a/Connector_RTMP/parsechunks.cpp b/Connector_RTMP/parsechunks.cpp index e4f8477f..5860b65f 100644 --- a/Connector_RTMP/parsechunks.cpp +++ b/Connector_RTMP/parsechunks.cpp @@ -186,7 +186,7 @@ void parseChunk(){ for (std::string::iterator i=streamname.end()-1; i>=streamname.begin(); --i){ if (!isalpha(*i) && !isdigit(*i)){streamname.erase(i);}else{*i=tolower(*i);} } - streamname = "/tmp/" + streamname; + streamname = "/tmp/shared_socket_" + streamname; SendUSR(0, 1);//send UCM StreamBegin (0), stream 1 //send a status reply AMFType amfreply("container", (unsigned char)0xFF); diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..b0c6e2dc --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +default: client-local-install + +client: + cd Connector_HTTP; $(MAKE) + cd Connector_RTMP; $(MAKE) + cd Connector_RTSP; $(MAKE) + cd Buffer; $(MAKE) +client-clean: + cd Connector_HTTP; $(MAKE) clean + cd Connector_RTMP; $(MAKE) clean + cd Connector_RTSP; $(MAKE) clean + cd Buffer; $(MAKE) clean +clean: client-clean +client-install: client + cp -f ./Connector_HTTP/Connector_HTTP /usr/bin/ + cp -f ./Connector_RTMP/Connector_RTMP /usr/bin/ + cp -f ./Connector_RTSP/Connector_RTSP /usr/bin/ + cp -f ./Buffer/Buffer /usr/bin/ +client-local-install: client + mkdir -p ./bin + cp -f ./Connector_HTTP/Connector_HTTP ./bin/ + cp -f ./Connector_RTMP/Connector_RTMP ./bin/ + cp -f ./Connector_RTSP/Connector_RTSP ./bin/ + cp -f ./Buffer/Buffer ./bin/ +