[xiph-commits] r8765 - in trunk/oggdsf: sln/oggdsf_all src/lib/codecs/cmml/dsfCMMLRawSource src/lib/core/directshow/dsfAnxMux src/lib/core/ogg/libOOOgg src/lib/helper/libAnxHelper

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Mon Jan 17 15:38:29 PST 2005


Author: illiminable
Date: 2005-01-16 22:31:43 -0800 (Sun, 16 Jan 2005)
New Revision: 8765

Modified:
   trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
   trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp
   trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.h
   trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.cpp
   trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.h
   trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.vcproj
Log:
* Anx 3 support added to muxer.
* Added an accessor to the paginator to check pagination rules, ie page sizes, maximum packets per page etc.
* Added some new locks to the cmml raw source filter to prevent threading inconsistencies
* Added helper routines to generate the new fish skeleton packets.

Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2005-01-17 06:31:43 UTC (rev 8765)
@@ -1063,6 +1063,7 @@
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{AE32588D-2807-4796-9E68-C9104817BC1A} = {AE32588D-2807-4796-9E68-C9104817BC1A}
 		{2EBA839A-CE6E-406E-9A43-CC6FB25A78CB} = {2EBA839A-CE6E-406E-9A43-CC6FB25A78CB}
+		{6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834} = {6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834}
 		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection

Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -39,19 +39,21 @@
 
 HRESULT CMMLRawSourcePin::DeliverEndFlush(void)
 {
+	CAutoLock locLock(m_pLock);
 	mDataQueue->EndFlush();
     return S_OK;
 }
 
 HRESULT CMMLRawSourcePin::DeliverBeginFlush(void)
 {
-	
+	CAutoLock locLock(m_pLock);
 	mDataQueue->BeginFlush();
     return S_OK;
 }
 
 HRESULT CMMLRawSourcePin::CompleteConnect (IPin *inReceivePin)
 {
+	CAutoLock locLock(m_pLock);
 	mFilterHR = S_OK;
 	//Set the delegate for seeking
 	//((BasicSeekable*)(inReceivePin))->SetDelegate(this);
@@ -66,6 +68,7 @@
 }
 
 HRESULT CMMLRawSourcePin::BreakConnect(void) {
+	CAutoLock locLock(m_pLock);
 	delete mDataQueue;
 	mDataQueue = NULL;
 	return CBaseOutputPin::BreakConnect();

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -75,7 +75,7 @@
 {
 
 	//ANX3::: Need to have a better way to set this.
-	mInterleaver = new AnxPageInterleaver(this, this, mAnxVersionMajor, mAnxVersionMinor);
+	mInterleaver = new AnxPageInterleaver(this, this, mAnxVersionMajor, mAnxVersionMinor, this);
 	mInputPins.push_back(new AnxMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream(), mAnxVersionMajor, mAnxVersionMinor));
 
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -38,6 +38,7 @@
 	:	OggMuxInputPin(inOwningFilter, inFilterLock, inHR, inMuxStream)
 	,	mAnxDataPacket(NULL)
 	,	mFishBonePacket(NULL)
+	,	mExtraPacket(NULL)
 	,	mAnxVersionMajor(inAnxVersionMajor)
 	,	mAnxVersionMinor(inAnxVersionMinor)
 {
@@ -59,11 +60,17 @@
 	mMuxStream->setIsActive(true);
 
 	HRESULT locHR = mParentFilter->addAnotherPin();
-	if ((locHR == S_OK) && (mAnxDataPacket != NULL)) {
+	if ((locHR == S_OK)) {// && (mAnxDataPacket != NULL)) {
 		//ANX3::: Only do this for anx2... in anx 3 we need to get the fishbone some other way.
-		if ((mAnxVersionMajor == 2) && (mAnxVersionMinor == 0)) {
+		if ((mAnxVersionMajor == 2) && (mAnxVersionMinor == 0) && (mAnxDataPacket != NULL)) {
 			mPaginator.acceptStampedOggPacket(mAnxDataPacket);
 			return S_OK;
+		} else if ((mAnxVersionMajor == 3) && (mAnxVersionMinor == 0) && (mFishBonePacket != NULL)) {
+			//Force in a CMML Packet BOS
+			if (mExtraPacket != NULL) {
+				mPaginator.acceptStampedOggPacket(mExtraPacket);
+			}
+			return S_OK;
 		} else {
 			return S_FALSE;
 		}
@@ -81,6 +88,8 @@
 	unsigned __int64 locGranRateNum = 0;
 	unsigned __int64 locGranRateDenom = 0;
 	unsigned long locNumHeaders = 0;
+	unsigned long locPreroll = 0;
+	unsigned long locGranuleShift = 0;
 	StreamHeaders::eCodecType locCodecID = StreamHeaders::NONE;
 
 	
@@ -94,6 +103,7 @@
 		mMuxStream->setNumHeaders(3);
 		mPaginator.setNumHeaders(3);
 
+		locGranuleShift = locTheora->maxKeyframeInterval;
 		locWasOK = true;
 		locGranRateNum = locTheora->frameRateNumerator;
 		locGranRateDenom = locTheora->frameRateDenominator;
@@ -113,6 +123,7 @@
 			locGranRateNum = locVorbis->samplesPerSec;
 			locGranRateDenom = 1;
 			locNumHeaders = 3;
+			locPreroll = 2;
 
 			locCodecID = StreamHeaders::VORBIS;
 
@@ -156,14 +167,24 @@
 			//CMML
 			sCMMLFormatBlock* locCMML = (sCMMLFormatBlock*)inMediaType->pbFormat;
 			mMuxStream->setConversionParams(locCMML->granuleNumerator, locCMML->granuleDenominator, 10000000);
-			mPaginator.setNumHeaders(1);
-			mMuxStream->setNumHeaders(1);
 
 
+			//ANX3::: 1 for anx 2, 2 for anx 3.
+			if ((mAnxVersionMajor == 3) && (mAnxVersionMinor == 0)) {
+				locNumHeaders = 2;
+			} else {
+				locNumHeaders = 1;
+			}
+
+			mPaginator.setNumHeaders(locNumHeaders);
+			mMuxStream->setNumHeaders(locNumHeaders);
+
+
 			locWasOK = true;
 			locGranRateNum = locCMML->granuleNumerator;
 			locGranRateDenom = locCMML->granuleDenominator;
-			locNumHeaders = 1;
+
+
 			locCodecID = StreamHeaders::CMML;			
 		}
 	}
@@ -174,6 +195,13 @@
 		if ((mAnxVersionMajor == 2) && (mAnxVersionMinor == 0)) {
 			//Save the packet, we'll push it into the stream when the connection is established
 			mAnxDataPacket = AnxPacketMaker::makeAnxData_2_0(2, 0, locGranRateNum, locGranRateDenom, locNumHeaders, AnxPacketMaker::makeMessageHeaders(locCodecID));
+		} else if ((mAnxVersionMajor == 3) && (mAnxVersionMinor == 0)) {
+			mFishBonePacket = FishSkeleton::makeFishBone_3_0(locGranRateNum, locGranRateDenom, 0, locNumHeaders, mPaginator.parameters()->mSerialNo, locGranuleShift, locPreroll, AnxPacketMaker::makeMessageHeaders(locCodecID));
+			if (locCodecID == StreamHeaders::CMML) {
+				mExtraPacket = FishSkeleton::makeCMMLBOS();
+			} else {
+				mExtraPacket = NULL;
+			}
 		}
         return S_OK;
 	} else {

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h	2005-01-17 06:31:43 UTC (rev 8765)
@@ -37,6 +37,7 @@
 #include "OggMuxInputPin.h"
 #include "AnxMuxFilter.h"
 #include "AnxPacketMaker.h"
+#include "libAnxHelper/FishSkeleton.h"
 
 
 #include <fstream>
@@ -53,11 +54,13 @@
 	virtual HRESULT CompleteConnect(IPin* inReceivePin);
 	virtual HRESULT SetMediaType(const CMediaType* inMediaType);
 
+	friend class AnxPageInterleaver;
 protected:
 	fstream debugLog;
 
 	StampedOggPacket* mAnxDataPacket;
 	StampedOggPacket* mFishBonePacket;
+	StampedOggPacket* mExtraPacket;
 
 	unsigned long mAnxVersionMajor;
 	unsigned long mAnxVersionMinor;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -34,8 +34,9 @@
 #include "stdafx.h"
 #include ".\anxpageinterleaver.h"
 
-AnxPageInterleaver::AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor)
+AnxPageInterleaver::AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor, AnxMuxFilter* inParentFilter)
 	:	OggPageInterleaver(inFileWriter, inNotifier)
+	,	mParentFilter(inParentFilter)
 	,	mVersionMajor(inVersionMajor)
 	,	mVersionMinor(inVersionMinor)
 	,	mIsAnxSetup(false)
@@ -141,6 +142,50 @@
 
 	return locWasAny && locIsOK;
 }
+
+void AnxPageInterleaver::letsGetFishy()
+{
+	
+	unsigned long locSerialNo = 888;
+	
+	//Make the fishhead
+	unsigned char* locUTC = new unsigned char[20];
+	memset((void*)locUTC, 0, 20);
+	OggPage* locFishHead = FishSkeleton::makeFishHeadBOS_3_0(locSerialNo, mVersionMajor, mVersionMinor, 0,0,0,0,locUTC);
+
+	//Write out the fishHead
+	mFileWriter->acceptOggPage(locFishHead);
+
+	//Write out the BOS pages
+	for (size_t i = 0; i < mInputStreams.size(); i++) {
+		if (mInputStreams[i]->isActive()) {
+			mFileWriter->acceptOggPage(mInputStreams[i]->popFront());
+		}
+	}
+
+	//Write out the fishbones.
+	for (unsigned long i = 0; i < mParentFilter->GetPinCount() - 1; i++) {
+		AnxMuxInputPin* locPin = (AnxMuxInputPin*)mParentFilter->GetPin(i);
+		OggPage* locFishBonePage = FishSkeleton::makeFishBone_3_0_Page(locPin->mFishBonePacket, locSerialNo);
+		mFileWriter->acceptOggPage(locFishBonePage);
+	}
+
+	//Write out all the secondary headers
+	for (size_t stream = 0; stream < mInputStreams.size(); stream++) {
+		if (mInputStreams[stream]->isActive()) {
+			for (unsigned long pack = 1; pack < mInputStreams[stream]->numHeaders(); pack++) {
+				OggPage* locSecHead = mInputStreams[stream]->popFront();
+				mFileWriter->acceptOggPage(locSecHead);
+			}
+		}
+	}
+
+	//Write the fish skeleton EOS
+	mFileWriter->acceptOggPage(FishSkeleton::makeFishEOS(locSerialNo));
+
+
+
+}
 void AnxPageInterleaver::processData()
 {
 	if ((mVersionMajor == 2) && (mVersionMinor == 0)) {
@@ -167,7 +212,7 @@
 		}
 	} else if ((mVersionMajor == 3) && (mVersionMinor == 0)) {
 		if (!mIsAnxSetup) {
-			if (gotAllHeaders()) {
+			if (gotAllSecondaryHeaders()) {
 				//ANX3::: We need to make sure every stream has all of their headers
 				//
 				//Then we write :
@@ -177,6 +222,8 @@
 				//Fishbones...
 				//All other codec secondary headers...
 
+				letsGetFishy();
+
 				mIsAnxSetup = true;
 				//addAnnodex_2_0_BOS();
 				//addAllAnxData_2_0_BOS();

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h	2005-01-17 06:31:43 UTC (rev 8765)
@@ -35,11 +35,15 @@
 
 #include <libOOOgg/OggPageInterleaver.h>
 #include "AnxPacketMaker.h"
+#include "AnxMuxFilter.h"
+
+class AnxMuxFilter;
+
 class AnxPageInterleaver
 	:	public OggPageInterleaver
 {
 public:
-	AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor);
+	AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor, AnxMuxFilter* inParentFilter);
 	virtual ~AnxPageInterleaver(void);
 
 	
@@ -55,8 +59,11 @@
 
 	//ANX3:::
 	bool gotAllSecondaryHeaders();
+	void letsGetFishy();
 
 	bool mIsAnxSetup;
+
+	AnxMuxFilter* mParentFilter;
 	
 	unsigned long mVersionMajor;
 	unsigned long mVersionMinor;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -137,6 +137,10 @@
 	return true;
 }
 
+OggPaginatorSettings* OggPaginator::parameters() {
+	return mSettings;
+}
+
 //Keeps packet.
 bool OggPaginator::acceptStampedOggPacket(StampedOggPacket* inOggPacket) 
 {		

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h	2005-01-17 06:31:43 UTC (rev 8765)
@@ -52,6 +52,9 @@
 
 	/// Set the pagination options.
 	bool setParameters(OggPaginatorSettings* inSettings);
+
+	/// Get the pagination options
+	OggPaginatorSettings* parameters();
 	
 	/// Feed your packets in here.
 	virtual bool acceptStampedOggPacket(StampedOggPacket* inOggPacket);

Modified: trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -42,6 +42,22 @@
 FishSkeleton::~FishSkeleton(void)
 {
 }
+
+StampedOggPacket* FishSkeleton::makeCMMLBOS()
+{
+	unsigned char* locPackBuff = new unsigned char[8];
+	locPackBuff[0] = 'C';
+	locPackBuff[1] = 'M';
+	locPackBuff[2] = 'M';
+	locPackBuff[3] = 'L';
+	locPackBuff[4] = 3;
+	locPackBuff[5] = 0;
+	locPackBuff[6] = 0;
+	locPackBuff[7] = 0;
+
+	StampedOggPacket* locPacket = new StampedOggPacket(locPackBuff, 8, false, false, 0, 0, StampedOggPacket::OGG_BOTH);
+	return locPacket;
+}
 OggPage* FishSkeleton::makeFishHeadBOS_3_0	(		unsigned long inSerialNo
 												,	unsigned short inVersionMajor
 												,	unsigned short inVersionMinor
@@ -111,13 +127,115 @@
 	}
 }
 
+OggPage* FishSkeleton::makeFishEOS (unsigned long inSerialNo) {
+	OggPage* retPage = new OggPage();
+	StampedOggPacket* locDudPacket = new StampedOggPacket(NULL, 0, false, false, 0, 0, StampedOggPacket::OGG_BOTH);
+
+
+
+	retPage->header()->setNumPageSegments(1);
+	unsigned char* locSegTable = new unsigned char[1];
+
+	locSegTable[0] = 0;
+	
+
+	retPage->header()->setHeaderFlags(4);
+	retPage->header()->setSegmentTable(locSegTable, 1);
+	retPage->header()->setHeaderSize(28);
+	retPage->header()->setDataSize(0);
+
+	retPage->header()->setStreamSerialNo(inSerialNo);
+	retPage->addPacket(locDudPacket);
+
+	return retPage;
+
+}
+OggPage* FishSkeleton::makeFishBone_3_0_Page (StampedOggPacket* inFishBonePacket, unsigned long inFishStreamSerial)
+{
+			StampedOggPacket* locPack = inFishBonePacket;
+			OggPage* retPage = new OggPage;
+			retPage->header()->setHeaderFlags(0);
+			retPage->header()->setGranulePos((__int64)0);
+			
+			unsigned long locDataSize = locPack->packetSize();
+
+			
+
+			unsigned long locNumSegs = ((locDataSize / 255) + 1);
+
+			unsigned char locLastSeg = locDataSize % 255;
+
+			retPage->header()->setNumPageSegments(locNumSegs);
+			unsigned char* locSegTable = new unsigned char[locNumSegs];
+
+			for (int i = 0; i < locNumSegs - 1; i++) {
+				locSegTable[i] = 255;
+			}
+
+			locSegTable[locNumSegs - 1] = locLastSeg;
+			
+			retPage->header()->setSegmentTable(locSegTable, locNumSegs);
+			retPage->header()->setHeaderSize(27 + locNumSegs);
+			retPage->header()->setDataSize(locDataSize);
+
+			retPage->header()->setStreamSerialNo(inFishStreamSerial);
+			retPage->addPacket(locPack);
+
+			
+			return retPage;
+}
+
+
+
+//OggPage* FishSkeleton::makeFishBone_3_0_Page			(		unsigned __int64 inGranuleRateNum
+//														,	unsigned __int64 inGranuleRateDenom
+//														,	unsigned __int64 inBaseGranule
+//														,	unsigned long inNumSecHeaders
+//														,	unsigned long inSerialNo
+//														,	unsigned short inGranuleShift
+//														,	unsigned char inPreroll
+//														,	vector<string> inMessageHeaders
+//														,	unsigned long inFishStreamSerial
+//													)
+//{
+//			StampedOggPacket* locPack = makeFishBone_3_0(inGranuleRateNum, inGranuleRateDenom, inBaseGranule, inNumSecHeaders, inSerialNo, inGranuleShift, inPreroll,inMessageHeaders);
+//			OggPage* retPage = new OggPage;
+//			retPage->header()->setHeaderFlags(0);
+//			retPage->header()->setGranulePos((__int64)0);
+//			
+//			unsigned long locDataSize = locPack->packetSize();
+//
+//			
+//
+//			unsigned long locNumSegs = ((locDataSize / 255) + 1);
+//
+//			unsigned char locLastSeg = locDataSize % 255;
+//
+//			retPage->header()->setNumPageSegments(locNumSegs);
+//			unsigned char* locSegTable = new unsigned char[locNumSegs];
+//
+//			for (int i = 0; i < locNumSegs - 1; i++) {
+//				locSegTable[i] = 255;
+//			}
+//
+//			locSegTable[locNumSegs - 1] = locLastSeg;
+//			
+//			retPage->header()->setSegmentTable(locSegTable, locNumSegs);
+//			retPage->header()->setHeaderSize(27 + locNumSegs);
+//			retPage->header()->setDataSize(locDataSize);
+//
+//			retPage->header()->setStreamSerialNo(inFishStreamSerial);
+//			retPage->addPacket(locPack);
+//
+//			return retPage;
+//}
 StampedOggPacket* FishSkeleton::makeFishBone_3_0	(		unsigned __int64 inGranuleRateNum
-														,	unsigned __int64 inGranuleDenom
+														,	unsigned __int64 inGranuleRateDenom
 														,	unsigned __int64 inBaseGranule
 														,	unsigned long inNumSecHeaders
 														,	unsigned long inSerialNo
-														,	unsigned short inGranuleShift
-														,	unsigned char inPreroll
+														,	unsigned char inGranuleShift
+														,	unsigned long inPreroll
 														,	vector<string> inMessageHeaders
 													) 
 {
@@ -133,5 +251,63 @@
 	//	48	-	48		:	Granule shift
 	//	49	-	51		:	*** PADDING ***
 	//	52	-			:	Message Headers
-	return NULL;
+
+
+
+		unsigned long locPacketSize = 52;  //Base header size
+		for (size_t i = 0; i < inMessageHeaders.size(); i++) {
+			//2 is the crlf
+			locPacketSize += (unsigned long)(inMessageHeaders[i].size() + 2);
+		}
+
+		//terminating crlf
+		locPacketSize += 2;
+
+		unsigned char* locBuff = new unsigned char[locPacketSize];
+
+		locBuff[0] = 'f';
+		locBuff[1] = 'i';
+		locBuff[2] = 's';
+		locBuff[3] = 'b';
+		locBuff[4] = 'o';
+		locBuff[5] = 'n';
+		locBuff[6] = 'e';
+		locBuff[7] = 0;
+
+		iLE_Math::ULongToCharArr(44, locBuff + 8);
+		iLE_Math::ULongToCharArr(inSerialNo, locBuff + 12);
+		iLE_Math::ULongToCharArr(inNumSecHeaders, locBuff + 16);
+
+		iLE_Math::Int64ToCharArr(inGranuleRateNum, locBuff + 20);
+		iLE_Math::Int64ToCharArr(inGranuleRateDenom, locBuff + 28);
+
+		iLE_Math::Int64ToCharArr(inBaseGranule, locBuff + 36);
+		iLE_Math::ULongToCharArr(inPreroll, locBuff + 44);
+
+		locBuff[48] = inGranuleShift;
+		locBuff[49] = 0;
+		locBuff[50] = 0;
+		locBuff[51] = 0;
+
+		
+
+		
+		unsigned long locUpto = 52;
+		for (size_t i = 0; i < inMessageHeaders.size(); i++) {
+			memcpy((void*)(locBuff + locUpto), (const void*)(inMessageHeaders[i].c_str()), inMessageHeaders[i].size());
+			locUpto += (unsigned long)(inMessageHeaders[i].size());
+			//TODO::: How terminated ??
+			locBuff[locUpto++] = '\r';	
+			locBuff[locUpto++] = '\n';
+		}
+
+		locBuff[locUpto++] = '\r';
+		locBuff[locUpto++] = '\n';
+		
+		StampedOggPacket* locPack = new StampedOggPacket(locBuff, locPacketSize, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+		return locPack;
+
+
+
+
 }
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.h	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.h	2005-01-17 06:31:43 UTC (rev 8765)
@@ -53,12 +53,27 @@
 											);
 
 	static StampedOggPacket* makeFishBone_3_0		(		unsigned __int64 inGranuleRateNum
-														,	unsigned __int64 inGranuleDenom
+														,	unsigned __int64 inGranuleRateDenom
 														,	unsigned __int64 inBaseGranule
 														,	unsigned long inNumSecHeaders
 														,	unsigned long inSerialNo
-														,	unsigned short inGranuleShift
-														,	unsigned char inPreroll
+														,	unsigned char inGranuleShift
+														,	unsigned long inPreroll
 														,	vector<string> inMessageHeaders
 													);
+
+	//static OggPage* makeFishBone_3_0_Page			(		unsigned __int64 inGranuleRateNum
+	//													,	unsigned __int64 inGranuleRateDenom
+	//													,	unsigned __int64 inBaseGranule
+	//													,	unsigned long inNumSecHeaders
+	//													,	unsigned long inSerialNo
+	//													,	unsigned short inGranuleShift
+	//													,	unsigned char inPreroll
+	//													,	vector<string> inMessageHeaders
+	//													,	unsigned long inFishStreamSerial
+	//												);
+
+	static OggPage* makeFishEOS (unsigned long inSerialNo);
+	static OggPage* makeFishBone_3_0_Page			(StampedOggPacket* inFishBonePacket, unsigned long inFishStreamSerial);
+	static StampedOggPacket* makeCMMLBOS();
 };

Modified: trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.cpp	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.cpp	2005-01-17 06:31:43 UTC (rev 8765)
@@ -3,34 +3,20 @@
 
 #include "stdafx.h"
 #include "libAnxHelper.h"
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-					 )
-{
-	switch (ul_reason_for_call)
-	{
-	case DLL_PROCESS_ATTACH:
-	case DLL_THREAD_ATTACH:
-	case DLL_THREAD_DETACH:
-	case DLL_PROCESS_DETACH:
-		break;
-	}
-    return TRUE;
-}
+//BOOL APIENTRY DllMain( HANDLE hModule, 
+//                       DWORD  ul_reason_for_call, 
+//                       LPVOID lpReserved
+//					 )
+//{
+//	switch (ul_reason_for_call)
+//	{
+//	case DLL_PROCESS_ATTACH:
+//	case DLL_THREAD_ATTACH:
+//	case DLL_THREAD_DETACH:
+//	case DLL_PROCESS_DETACH:
+//		break;
+//	}
+//    return TRUE;
+//}
 
-// This is an example of an exported variable
-LIBANXHELPER_API int nlibAnxHelper=0;
 
-// This is an example of an exported function.
-LIBANXHELPER_API int fnlibAnxHelper(void)
-{
-	return 42;
-}
-
-// This is the constructor of a class that has been exported.
-// see libAnxHelper.h for the class definition
-ClibAnxHelper::ClibAnxHelper()
-{ 
-	return; 
-}

Modified: trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.h	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.h	2005-01-17 06:31:43 UTC (rev 8765)
@@ -10,13 +10,3 @@
 #define LIBANXHELPER_API __declspec(dllimport)
 #endif
 
-// This class is exported from the libAnxHelper.dll
-class LIBANXHELPER_API ClibAnxHelper {
-public:
-	ClibAnxHelper(void);
-	// TODO: add your methods here.
-};
-
-extern LIBANXHELPER_API int nlibAnxHelper;
-
-LIBANXHELPER_API int fnlibAnxHelper(void);

Modified: trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.vcproj
===================================================================
--- trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.vcproj	2005-01-16 18:47:32 UTC (rev 8764)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/libAnxHelper.vcproj	2005-01-17 06:31:43 UTC (rev 8765)
@@ -14,7 +14,7 @@
 			Name="Debug|Win32"
 			OutputDirectory="Debug"
 			IntermediateDirectory="Debug"
-			ConfigurationType="2"
+			ConfigurationType="4"
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -25,21 +25,14 @@
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="3"
-				WarningLevel="3"
+				WarningLevel="4"
 				Detect64BitPortabilityProblems="TRUE"
 				DebugInformationFormat="4"
 				CallingConvention="2"/>
 			<Tool
 				Name="VCCustomBuildTool"/>
 			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/libAnxHelper.dll"
-				LinkIncremental="2"
-				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/libAnxHelper.pdb"
-				SubSystem="2"
-				ImportLibrary="$(OutDir)/libAnxHelper.lib"
-				TargetMachine="1"/>
+				Name="VCLibrarianTool"/>
 			<Tool
 				Name="VCMIDLTool"/>
 			<Tool
@@ -55,8 +48,6 @@
 			<Tool
 				Name="VCXMLDataGeneratorTool"/>
 			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
 				Name="VCManagedWrapperGeneratorTool"/>
 			<Tool
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
@@ -65,7 +56,7 @@
 			Name="Release|Win32"
 			OutputDirectory="Release"
 			IntermediateDirectory="Release"
-			ConfigurationType="2"
+			ConfigurationType="4"
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -80,15 +71,7 @@
 			<Tool
 				Name="VCCustomBuildTool"/>
 			<Tool
-				Name="VCLinkerTool"
-				OutputFile="$(OutDir)/libAnxHelper.dll"
-				LinkIncremental="1"
-				GenerateDebugInformation="TRUE"
-				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				ImportLibrary="$(OutDir)/libAnxHelper.lib"
-				TargetMachine="1"/>
+				Name="VCLibrarianTool"/>
 			<Tool
 				Name="VCMIDLTool"/>
 			<Tool
@@ -104,8 +87,6 @@
 			<Tool
 				Name="VCXMLDataGeneratorTool"/>
 			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
 				Name="VCManagedWrapperGeneratorTool"/>
 			<Tool
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>



More information about the commits mailing list