diff options
author | deva <deva> | 2005-04-10 20:38:45 +0000 |
---|---|---|
committer | deva <deva> | 2005-04-10 20:38:45 +0000 |
commit | b03406e31c5e5d4f8a4e065b03e68330885a3832 (patch) | |
tree | 0d636129516814509df07afd918daef086be3133 /src/server.cc | |
parent | 55a7afdedc7cee2df9012f600dd51aff92ad1af3 (diff) |
lots of styff!
Diffstat (limited to 'src/server.cc')
-rw-r--r-- | src/server.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/server.cc b/src/server.cc index 22b691f..44abe2d 100644 --- a/src/server.cc +++ b/src/server.cc @@ -63,14 +63,20 @@ MovEncoder *newMovEncoder(char* cpr) char fname[256]; time_t t = time(NULL); ltime = localtime(&t); - sprintf(fname, "%.2d%.2d%.2d%.2d%.2d%.2d-%s.mpg", ltime->tm_year + 1900, ltime->tm_mon, - ltime->tm_mday, ltime->tm_hour, ltime->tm_min, ltime->tm_sec, cpr); + sprintf(fname, "%.2d%.2d%.2d%.2d%.2d%.2d-%s.mpg", + ltime->tm_year + 1900, + ltime->tm_mon, + ltime->tm_mday, + ltime->tm_hour, + ltime->tm_min, + ltime->tm_sec, cpr); enc = new MovEncoder(fname); return enc; } void newConnection(Socket *s) -{ +{ + n_savestate savestate = LATER; n_header h; DVFrame *f; DVFrame *freeze_frame = NULL; @@ -91,6 +97,7 @@ void newConnection(Socket *s) printf("\tcpr: %s\t", h.header.h_data.cpr); printf("\tfrz: %d\t", h.header.h_data.freeze); printf("\tsht: %d\n", h.header.h_data.snapshot); + printf("\tsave: %d\n", h.header.h_data.savestate); if(h.header.h_data.snapshot) { if(freeze_frame) { @@ -107,6 +114,10 @@ void newConnection(Socket *s) enc->encode(f); } + if(h.header.h_data.savestate) { + savestate = h.header.h_data.savestate; + } + if(h.header.h_data.freeze) { if(freeze_frame) delete freeze_frame; freeze_frame = f; @@ -116,14 +127,12 @@ void newConnection(Socket *s) f = new DVFrame(); } + + // TODO: Use save state + delete f; if(enc) delete enc; printf("Connection end[pid: %d]...\n", getpid()); } -/* -int main(int argc, char *argv[]) -{ -} -*/ |