summaryrefslogtreecommitdiff
path: root/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cc')
-rw-r--r--src/server.cc25
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[])
-{
-}
-*/