summaryrefslogtreecommitdiff
path: root/client/decoder.cc
diff options
context:
space:
mode:
authordeva <deva>2006-08-25 21:20:07 +0000
committerdeva <deva>2006-08-25 21:20:07 +0000
commit8196872e3b240ef93fc17dd3c05a7d97a8015d88 (patch)
treee531edeb1c7178a8e58170c84645ce8eb706624e /client/decoder.cc
parent347b1d8ed3a4f780f3a5c0d57a04eab05ca517a2 (diff)
Rearranged the network and socket code.origin
Added status messages sent over the network using udp packets.
Diffstat (limited to 'client/decoder.cc')
-rw-r--r--client/decoder.cc30
1 files changed, 11 insertions, 19 deletions
diff --git a/client/decoder.cc b/client/decoder.cc
index afc09c9..a86dbd6 100644
--- a/client/decoder.cc
+++ b/client/decoder.cc
@@ -30,7 +30,7 @@
#include "transcoder.h"
-#define READ_DV_FROM_FILE
+//#define READ_DV_FROM_FILE
#include "dv.h"
#ifdef READ_DV_FROM_FILE
@@ -191,32 +191,24 @@ bool Decoder::eventFilter(QObject *o, QEvent *e)
return false;
}
-Status Decoder::status()
+std::vector<thread_status_t> Decoder::status()
{
- Status s;
-
- s.server_diskspace = 0xffffffff;
- s.server_diskspace_max = 0xffffffff;
- s.server_load = 0xffffffff;
- s.server_load_max = 0xffffffff;
- s.server_ping_ms = 0xffffffff;
- s.server_fps = -1.0;
+ std::vector<thread_status_t> v;
sendersmutex.lock();
- // Get the server disk status etc.
- if(senders.isEmpty() == false) senders.back()->getServerStatus(&s);
-
- // fprintf(stderr, "Load: %d of %d - ", s.server_load, s.server_load_max);
- // fprintf(stderr, "Space: %d of %d\n", s.server_diskspace, s.server_diskspace_max);
-
- // Read out the queue sizes
QLinkedList<NetworkSender*>::iterator i;
for(i = senders.begin(); i != senders.end(); i++) {
NetworkSender *ns = *i;
- s.queue_sizes.push_back(ns->queueSize());
+
+ // TODO: Cleanup (get both in one call)
+ thread_status_t s;
+ s.queuelen = ns->queueSize();
+ s.fps = ns->getfps();
+
+ v.push_back(s);
}
sendersmutex.unlock();
- return s;
+ return v;
}