[xiph-commits] r8762 - in trunk/oggdsf/src/lib: core/directshow/dsfAnxMux helper/libAnxHelper

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


Author: illiminable
Date: 2005-01-15 20:07:14 -0800 (Sat, 15 Jan 2005)
New Revision: 8762

Modified:
   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/helper/libAnxHelper/FishSkeleton.cpp
   trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.h
Log:
* Update some the helper functions to the latest rev of anx3
* Add a place for the fishbone to live
* A new mux helper so it knows when it has all headers

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp	2005-01-16 03:28:53 UTC (rev 8761)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp	2005-01-16 04:07:14 UTC (rev 8762)
@@ -37,6 +37,7 @@
 AnxMuxInputPin::AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream, unsigned long inAnxVersionMajor, unsigned long inAnxVersionMinor)
 	:	OggMuxInputPin(inOwningFilter, inFilterLock, inHR, inMuxStream)
 	,	mAnxDataPacket(NULL)
+	,	mFishBonePacket(NULL)
 	,	mAnxVersionMajor(inAnxVersionMajor)
 	,	mAnxVersionMinor(inAnxVersionMinor)
 {
@@ -168,9 +169,10 @@
 	}
 	if (locWasOK) {
 		//ANX3::: Need to make our fishbone here.
-		//Save the packet, we'll push it into the stream when the connection is established
 		
+		
 		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));
 		}
         return S_OK;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h	2005-01-16 03:28:53 UTC (rev 8761)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h	2005-01-16 04:07:14 UTC (rev 8762)
@@ -57,6 +57,7 @@
 	fstream debugLog;
 
 	StampedOggPacket* mAnxDataPacket;
+	StampedOggPacket* mFishBonePacket;
 
 	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 03:28:53 UTC (rev 8761)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2005-01-16 04:07:14 UTC (rev 8762)
@@ -119,8 +119,27 @@
 	}
 
 	return locWasAny && locIsOK;
+}
 
-	
+bool AnxPageInterleaver::gotAllSecondaryHeaders() {
+	//TODO::: The isActive needs to be clarified so we don't start empty streams because wasany goes to true
+
+	bool locWasAny = false;
+	bool locIsOK = true;
+	for (size_t i = 0; i < mInputStreams.size(); i++) {
+		if (mInputStreams[i]->isActive()) {
+			
+			//if ((mInputStreams[i]->peekFront() != NULL) || (!mInputStreams[i]->isActive())) {
+			if (mInputStreams[i]->numAvail() >= mInputStreams[i]->numHeaders()) {
+				locWasAny = true;
+				locIsOK = locIsOK && true;
+			} else {
+				locIsOK = false;
+			}
+		}
+	}
+
+	return locWasAny && locIsOK;
 }
 void AnxPageInterleaver::processData()
 {

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h	2005-01-16 03:28:53 UTC (rev 8761)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h	2005-01-16 04:07:14 UTC (rev 8762)
@@ -53,6 +53,9 @@
 	void addAnnodexEOS();
 	bool gotAllHeaders();
 
+	//ANX3:::
+	bool gotAllSecondaryHeaders();
+
 	bool mIsAnxSetup;
 	
 	unsigned long mVersionMajor;

Modified: trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp	2005-01-16 03:28:53 UTC (rev 8761)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.cpp	2005-01-16 04:07:14 UTC (rev 8762)
@@ -45,6 +45,8 @@
 OggPage* FishSkeleton::makeFishHeadBOS_3_0	(		unsigned long inSerialNo
 												,	unsigned short inVersionMajor
 												,	unsigned short inVersionMinor
+												,	unsigned __int64 inPresentTimeNum
+												,	unsigned __int64 inPresentTimeDenom
 												,	unsigned __int64 inTimebaseNum
 												,	unsigned __int64 inTimebaseDenom
 												,	const unsigned char* inUTC
@@ -56,15 +58,17 @@
 	OggPage* retPage = NULL;
 	unsigned char* locSegTable = NULL;
 	switch (inVersionMajor) {
-		case 2:
+		case 3:
 			locBuff = new unsigned char[FishSkeleton::FISHEAD_3_0_PACKET_SIZE];
 
 			//	0	-	7		fishead\0
 			//  8	-   9		Version Major
 			// 10	-  11		Version Minor
-			// 12	-  19		Timebase Num
-			// 20	-  27		Timebase Denom
-			// 28	=  48		UTC
+			// 12	-  19		Presentation Num
+			// 20	-  27		Presentation Denom
+			// 28	-  35		Basetime Num
+			// 36	-  43	
+			// 44	-  63		UTC
 			locBuff[0] = 'f';
 			locBuff[1] = 'i';
 			locBuff[2] = 's';
@@ -75,10 +79,12 @@
 			locBuff[7] = 0;
 			iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
 			iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
-			iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
-			iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
+			iLE_Math::Int64ToCharArr(inPresentTimeNum, locBuff + 12);
+			iLE_Math::Int64ToCharArr(inPresentTimeDenom, locBuff + 20);
+			iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 28);
+			iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 36);
 			for (int i = 0; i < 20; i++) {
-				locBuff[28 + i] = inUTC[i];
+				locBuff[44 + i] = inUTC[i];
 			}
 			
 			locPack = new StampedOggPacket(locBuff, FishSkeleton::FISHEAD_3_0_PACKET_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
@@ -107,10 +113,25 @@
 
 StampedOggPacket* FishSkeleton::makeFishBone_3_0	(		unsigned __int64 inGranuleRateNum
 														,	unsigned __int64 inGranuleDenom
+														,	unsigned __int64 inBaseGranule
 														,	unsigned long inNumSecHeaders
+														,	unsigned long inSerialNo
 														,	unsigned short inGranuleShift
+														,	unsigned char inPreroll
 														,	vector<string> inMessageHeaders
 													) 
 {
+
+	//	0	-	7		:	fisbone/0
+	//	8	-	11		:	Bytes to message headers
+	//	12	-	15		:	Serial NO
+	//	16	-	19		:	Num Headers
+	//	20	-	27		:	Granule Numerator
+	//	28	-	35		:	Granule Denominator
+	//	36	-	43		:	Base granule
+	//	44	-	47		:	Preroll
+	//	48	-	48		:	Granule shift
+	//	49	-	51		:	*** PADDING ***
+	//	52	-			:	Message Headers
 	return NULL;
 }
\ 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 03:28:53 UTC (rev 8761)
+++ trunk/oggdsf/src/lib/helper/libAnxHelper/FishSkeleton.h	2005-01-16 04:07:14 UTC (rev 8762)
@@ -40,19 +40,25 @@
 	FishSkeleton(void);
 	~FishSkeleton(void);
 
-	static const int FISHEAD_3_0_PACKET_SIZE = 48;
-	static OggPage* makeFishHeadBOS_3_0	(			unsigned long inSerialNo
+	static const int FISHEAD_3_0_PACKET_SIZE = 64;
+	static OggPage* makeFishHeadBOS_3_0		(		unsigned long inSerialNo
 												,	unsigned short inVersionMajor
 												,	unsigned short inVersionMinor
+												,	unsigned __int64 inPresentTimeNum
+												,	unsigned __int64 inPresentTimeDenom
 												,	unsigned __int64 inTimebaseNum
 												,	unsigned __int64 inTimebaseDenom
 												,	const unsigned char* inUTC
+														
 											);
 
-	static StampedOggPacket* makeFishBone_3_0	(	unsigned __int64 inGranuleRateNum
-												,	unsigned __int64 inGranuleDenom
-												,	unsigned long inNumSecHeaders
-												,	unsigned short inGranuleShift
-												,	vector<string> inMessageHeaders
-											);
+	static StampedOggPacket* makeFishBone_3_0		(		unsigned __int64 inGranuleRateNum
+														,	unsigned __int64 inGranuleDenom
+														,	unsigned __int64 inBaseGranule
+														,	unsigned long inNumSecHeaders
+														,	unsigned long inSerialNo
+														,	unsigned short inGranuleShift
+														,	unsigned char inPreroll
+														,	vector<string> inMessageHeaders
+													);
 };



More information about the commits mailing list