X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=c%3A%2FGit%2FPeerCast.root%2FPeerCast%2Fcore%2Fcommon%2Fmms.cpp;fp=c%3A%2FGit%2FPeerCast.root%2FPeerCast%2Fcore%2Fcommon%2Fmms.cpp;h=0000000000000000000000000000000000000000;hb=0bb1cde16678f894377e2497e9e1eb0a16d5a215;hp=2ddafbcc5c144e4f6f324662c4f98d0a3ace95d7;hpb=fdeb54807c210bd5b53b486d1675aba4567e5f2b;p=peercast-im%2FPeerCastIM.git diff --git a/c:/Git/PeerCast.root/PeerCast/core/common/mms.cpp b/c:/Git/PeerCast.root/PeerCast/core/common/mms.cpp deleted file mode 100644 index 2ddafbc..0000000 --- a/c:/Git/PeerCast.root/PeerCast/core/common/mms.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// ------------------------------------------------ -// File : mms.cpp -// Date: 28-may-2003 -// Author: giles -// -// (c) 2002-3 peercast.org -// ------------------------------------------------ -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// ------------------------------------------------ - -#include "channel.h" -#include "mms.h" -#include "asf.h" -#ifdef _DEBUG -#include "chkMemoryLeak.h" -#define DEBUG_NEW new(__FILE__, __LINE__) -#define new DEBUG_NEW -#endif - -// ------------------------------------------ -ASFInfo parseASFHeader(Stream &in); - - -// ------------------------------------------ -void MMSStream::readEnd(Stream &,Channel *) -{ -} - -// ------------------------------------------ -void MMSStream::readHeader(Stream &,Channel *) -{ -} -// ------------------------------------------ -int MMSStream::readPacket(Stream &in,Channel *ch) -{ - { - ASFChunk chunk; - - chunk.read(in); - - switch (chunk.type) - { - case 0x4824: // asf header - { - MemoryStream mem(ch->headPack.data,sizeof(ch->headPack.data)); - - chunk.write(mem); - - - - - MemoryStream asfm(chunk.data,chunk.dataLen); - ASFObject asfHead; - asfHead.readHead(asfm); - - ASFInfo asf = parseASFHeader(asfm); - LOG_DEBUG("ASF Info: pnum=%d, psize=%d, br=%d",asf.numPackets,asf.packetSize,asf.bitrate); - for(int i=0; iid) - LOG_DEBUG("ASF Stream %d : %s, br=%d",s->id,s->getTypeName(),s->bitrate); - } - - ch->info.bitrate = asf.bitrate/1000; - - ch->headPack.type = ChanPacket::T_HEAD; - ch->headPack.len = mem.pos; - ch->headPack.pos = ch->streamPos; - ch->newPacket(ch->headPack); - - ch->streamPos += ch->headPack.len; - - break; - } - case 0x4424: // asf data - { - - ChanPacket pack; - - MemoryStream mem(pack.data,sizeof(pack.data)); - - chunk.write(mem); - - pack.type = ChanPacket::T_DATA; - pack.len = mem.pos; - pack.pos = ch->streamPos; - - ch->newPacket(pack); - ch->streamPos += pack.len; - - break; - } - default: - throw StreamException("Unknown ASF chunk"); - - } - - } - return 0; -} - - -// ----------------------------------- -ASFInfo parseASFHeader(Stream &in) -{ - ASFInfo asf; - - try - { - int numHeaders = in.readLong(); - - in.readChar(); - in.readChar(); - - LOG_CHANNEL("ASF Headers: %d",numHeaders); - for(int i=0; i