diff options
author | deva <deva> | 2006-07-20 17:53:17 +0000 |
---|---|---|
committer | deva <deva> | 2006-07-20 17:53:17 +0000 |
commit | 7d39c063ea84b9b30dbe669ac4ae641a49506836 (patch) | |
tree | ef1ead10d1736e9ad7ffe139872c86fd2ee00901 /server/multiplexer.cc | |
parent | c8df40b62cf30029a4acd1a57c8c54add54dda9b (diff) |
Utilized the global info object.
Utilized the global info object.
Utilized the global info object.
Diffstat (limited to 'server/multiplexer.cc')
-rw-r--r-- | server/multiplexer.cc | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/server/multiplexer.cc b/server/multiplexer.cc index 7a8b095..0bce694 100644 --- a/server/multiplexer.cc +++ b/server/multiplexer.cc @@ -28,6 +28,8 @@ #include "config.h" #include "multiplexer.h" +#include "info.h" + #include <netinet/in.h> #include <math.h> @@ -68,14 +70,13 @@ static double picture_rate_index[16] = { RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED, RESERVED }; */ -Multiplexer::Multiplexer(File *f, Multicast *m, Info *i, volatile bool *r, +Multiplexer::Multiplexer(File *f, Multicast *m, volatile bool *r, ThreadSafeQueuePriority *video_q, ThreadSafeQueuePriority *audio_q) { running = r; file = f; multicast = m; - info = i; frame[TYPE_VIDEO] = NULL; written[TYPE_VIDEO] = 0.0; @@ -204,7 +205,7 @@ int Multiplexer::Write(unsigned short int val) Frame *Multiplexer::getFrame(StreamType type) { - // info->info("Get %s Frame", type==TYPE_AUDIO?"Audio\0":"Video\0"); + // MIaV::info->info("Get %s Frame", type==TYPE_AUDIO?"Audio\0":"Video\0"); read[type] = 0; @@ -234,7 +235,7 @@ int Multiplexer::read_stream(char *buf, unsigned int size, StreamType type) // check for end of stream if( frame[type]->endOfFrameStream == true) { - info->info("endOfFrameStream in Multiplexer %s-stream.", type==TYPE_VIDEO?"video\0":"audio\0"); + MIaV::info->info("endOfFrameStream in Multiplexer %s-stream.", type==TYPE_VIDEO?"video\0":"audio\0"); return copied; } @@ -244,7 +245,7 @@ int Multiplexer::read_stream(char *buf, unsigned int size, StreamType type) unsigned int doread = (size - copied) < (frame[type]->size - read[type]) ? size - copied : (frame[type]->size - read[type]); - //info->info("Requested: %d. Read: %d. Doread: %d. In buffer %d", size, (*read), doread, (*frame)->size); + //MIaV::info->info("Requested: %d. Read: %d. Doread: %d. In buffer %d", size, (*read), doread, (*frame)->size); memcpy(buf + copied, frame[type]->data + read[type], doread); read[type] += doread; @@ -260,7 +261,7 @@ bool Multiplexer::packet(StreamType type) char buf[PACKET_SIZE]; // Write data - // info->info("\t\t[%sPacket]", type==TYPE_AUDIO?"Audio\0":"Video\0"); + // MIaV::info->info("\t\t[%sPacket]", type==TYPE_AUDIO?"Audio\0":"Video\0"); unsigned short int framesize = read_stream(buf, PACKET_SIZE, type); @@ -298,7 +299,7 @@ bool Multiplexer::packet(StreamType type) */ bool Multiplexer::packet() { - //info->info("\t\tWritten[A]: %f, Written[V]: %f", written[TYPE_AUDIO], written[TYPE_VIDEO]); + //MIaV::info->info("\t\tWritten[A]: %f, Written[V]: %f", written[TYPE_AUDIO], written[TYPE_VIDEO]); StreamType type; /* @@ -344,7 +345,7 @@ bool Multiplexer::packet() */ void Multiplexer::system_header() { - // info->info("\t\t[System Header]"); + // MIaV::info->info("\t\t[System Header]"); // system_header_start_code (32 bits) Write((void*)ISO11172_1::system_header_start_code, SIZEOF(ISO11172_1::system_header_start_code)); @@ -386,7 +387,7 @@ void Multiplexer::system_header() */ bool Multiplexer::pack() { - // info->info("\t[Pack"); + // MIaV::info->info("\t[Pack"); Write((void*)ISO11172_1::pack_start_code, SIZEOF(ISO11172_1::pack_start_code)); @@ -431,7 +432,7 @@ bool Multiplexer::pack() header.system_clock_reference2 = TIMECODE29_15(SCR); header.system_clock_reference3 = TIMECODE14_0(SCR); /* - info->info("timecode All: %lld, 1: %lld, 2: %lld, 3: %lld", + MIaV::info->info("timecode All: %lld, 1: %lld, 2: %lld, 3: %lld", SCR, (unsigned long long int)header.system_clock_reference1, (unsigned long long int)header.system_clock_reference2, @@ -447,7 +448,7 @@ bool Multiplexer::pack() for(int cnt = 0; cnt < PACKETS_PER_PACK; cnt++) if(!packet()) return false; - // info->info("\t]"); + // MIaV::info->info("\t]"); return true; } @@ -457,18 +458,18 @@ bool Multiplexer::pack() */ void Multiplexer::iso11172_stream() { - // info->info("[iso11172_stream"); + // MIaV::info->info("[iso11172_stream"); while(pack()); - // info->info("]"); - // info->info("[iso11172_end_code]"); + // MIaV::info->info("]"); + // MIaV::info->info("[iso11172_end_code]"); Write((void*)ISO11172_1::end_code, SIZEOF(ISO11172_1::end_code)); /* - info->info("false && false = %d", false && false); - info->info("true && false = %d", true && false); - info->info("true && true = %d", true && true); + MIaV::info->info("false && false = %d", false && false); + MIaV::info->info("true && false = %d", true && false); + MIaV::info->info("true && true = %d", true && true); */ } @@ -482,7 +483,7 @@ void Multiplexer::multiplex() char buf[1024]; do { frmsz = read_stream(buf, sizeof(buf), BYPASS); - info->info("Wrote %d bytes", frmsz); + MIaV::info->info("Wrote %d bytes", frmsz); Write(buf, frmsz); } while(frmsz == sizeof(buf)); return; |