From 7d39c063ea84b9b30dbe669ac4ae641a49506836 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 20 Jul 2006 17:53:17 +0000 Subject: Utilized the global info object. Utilized the global info object. Utilized the global info object. --- server/server.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'server/server.cc') diff --git a/server/server.cc b/server/server.cc index e306cf1..9af22d9 100644 --- a/server/server.cc +++ b/server/server.cc @@ -46,6 +46,7 @@ #include #include "miav_config.h" +#include "info.h" #include "mov_encoder_thread.h" #include "img_encoder.h" @@ -54,12 +55,12 @@ #include "dv.h" -void newConnection(Socket *socket, Info *info) +void newConnection(Socket *socket) { char cpr[256]; char clientip[64]; bool hasCpr = false; - ServerStatus status(info); + ServerStatus status; n_savestate savestate = LATER; n_header h; @@ -69,17 +70,17 @@ void newConnection(Socket *socket, Info *info) frame = new Frame(NULL, DVPACKAGE_SIZE); - info->info("CONNECTION OPENED"); - info->info("New connection (%s)", inet_ntoa(socket->socketaddr.sin_addr)); + MIaV::info->info("CONNECTION OPENED"); + MIaV::info->info("New connection (%s)", inet_ntoa(socket->socketaddr.sin_addr)); sprintf(clientip, "%s", inet_ntoa(socket->socketaddr.sin_addr)); - Network network = Network(socket, info); + Network network = Network(socket); while(int ret = network.recvPackage(&h, frame->data, frame->size)) { status.checkPoint(); if(ret == -1) { - info->error("A network error ocurred, terminating session"); + MIaV::info->error("A network error ocurred, terminating session"); break; } @@ -92,17 +93,17 @@ void newConnection(Socket *socket, Info *info) if(h.header.h_data.snapshot) { if(freeze_frame) { - ImgEncoder(cpr, info).encode(freeze_frame, 100); + ImgEncoder(cpr).encode(freeze_frame, 100); delete freeze_frame; freeze_frame = NULL; } else { - ImgEncoder(cpr, info).encode(frame, 100); + ImgEncoder(cpr).encode(frame, 100); } } if(h.header.h_data.savestate != NO_CHANGE) { savestate = h.header.h_data.savestate; - info->info("GOT SAVESTATE FROM NETWORK: %d", savestate ); + MIaV::info->info("GOT SAVESTATE FROM NETWORK: %d", savestate ); } if(h.header.h_data.freeze) { @@ -114,14 +115,14 @@ void newConnection(Socket *socket, Info *info) // This one must be last! if(h.header.h_data.record) { // if(!enc) enc = newMovEncoder(cpr); - if(!enc) enc = new MovEncoderThread(clientip, cpr, info); + if(!enc) enc = new MovEncoderThread(clientip, cpr); enc->encode(frame); } frame = new Frame(NULL, DVPACKAGE_SIZE); } - info->info("Closing connection..."); + MIaV::info->info("Closing connection..."); // No encoder exists, if this is a pure snapshot (image) connection. if(enc) { @@ -132,5 +133,5 @@ void newConnection(Socket *socket, Info *info) delete enc; } - info->info("CONNECTION CLOSED"); + MIaV::info->info("CONNECTION CLOSED"); } -- cgit v1.2.3