[xiph-commits] r8307 - in trunk/oggdsf/src/lib/core: directshow/dsfAnxMux ogg/libOOOgg

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Mon Nov 29 21:46:57 PST 2004


Author: illiminable
Date: 2004-11-29 21:46:57 -0800 (Mon, 29 Nov 2004)
New Revision: 8307

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/ogg/libOOOgg/OggMuxStream.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
Log:
* Anx mux produces correct packet order, and creates anxdata headers in the streams.
* Anxdata headers currently have an extra crlf in the message header field.
* Mux doesn't ensure there is a cmml stream.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp	2004-11-30 03:46:50 UTC (rev 8306)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp	2004-11-30 05:46:57 UTC (rev 8307)
@@ -2,7 +2,8 @@
 #include ".\anxmuxinputpin.h"
 #include "AnxMuxFilter.h"
 AnxMuxInputPin::AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream)
-:	OggMuxInputPin(inOwningFilter, inFilterLock, inHR, inMuxStream)
+	:	OggMuxInputPin(inOwningFilter, inFilterLock, inHR, inMuxStream)
+	,	mAnxDataPacket(NULL)
 {
 	debugLog.open("g:\\logs\\anxmuxinputpin.log", ios_base::out);
 }
@@ -11,6 +12,26 @@
 {
 }
 
+
+HRESULT AnxMuxInputPin::CompleteConnect(IPin* inReceivePin) {
+	
+	//Set our delegate to the pin that is connecting to us... we'll send them our seek messages.
+	IMediaSeeking* locSeeker = NULL;
+	inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+	SetDelegate(locSeeker);
+	
+	mMuxStream->setIsActive(true);
+
+	HRESULT locHR = mParentFilter->addAnotherPin();
+	if ((locHR == S_OK) && (mAnxDataPacket != NULL)) {
+		mPaginator.acceptStampedOggPacket(mAnxDataPacket);
+		return S_OK;
+	} else {
+		return S_FALSE;
+	}
+}
+
+
 HRESULT AnxMuxInputPin::SetMediaType(const CMediaType* inMediaType) 
 {
 
@@ -87,7 +108,8 @@
 		
 	}
 	if (locWasOK) {
-		mPaginator.acceptStampedOggPacket(AnxPacketMaker::makeAnxData_2_0(2,0, locGranRateNum, locGranRateDenom, locNumHeaders, AnxPacketMaker::makeMessageHeaders(locCodecID)));
+		//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;
 	} else {
 		return S_FALSE;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h	2004-11-30 03:46:50 UTC (rev 8306)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h	2004-11-30 05:46:57 UTC (rev 8307)
@@ -17,9 +17,11 @@
 	AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream);
 	~AnxMuxInputPin(void);
 
-
+	virtual HRESULT CompleteConnect(IPin* inReceivePin);
 	virtual HRESULT SetMediaType(const CMediaType* inMediaType);
 
 protected:
 	fstream debugLog;
+
+	StampedOggPacket* mAnxDataPacket;
 };

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2004-11-30 03:46:50 UTC (rev 8306)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2004-11-30 05:46:57 UTC (rev 8307)
@@ -60,16 +60,20 @@
 }
 
 bool AnxPageInterleaver::gotAllHeaders() {
-	//TODO::: Fill this in.
+	//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 (int i = 0; i < mInputStreams.size(); i++) {
-		locWasAny = true;
-		if ((mInputStreams[i]->peekFront() != NULL) || (!mInputStreams[i]->isActive())) {
-			locIsOK = locIsOK && true;
-		} else {
-			locIsOK = false;
+		if (mInputStreams[i]->isActive()) {
+			locWasAny = true;
+			//if ((mInputStreams[i]->peekFront() != NULL) || (!mInputStreams[i]->isActive())) {
+			if (mInputStreams[i]->numAvail() > 1) {
+			
+				locIsOK = locIsOK && true;
+			} else {
+				locIsOK = false;
+			}
 		}
 	}
 

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp	2004-11-30 03:46:50 UTC (rev 8306)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp	2004-11-30 05:46:57 UTC (rev 8307)
@@ -55,7 +55,9 @@
 __int64 OggMuxStream::granuleDenominator() {
 	return mConvDenominator;
 }
-
+unsigned long OggMuxStream::numAvail() {
+	return mPageQueue.size();
+}
 bool OggMuxStream::acceptOggPage(OggPage* inOggPage) {		//Holds page for later... still needs deleting in destructor
 	mIsEOS = false;
 	mPageQueue.push_back(inOggPage);		//AOP::: Clone not required.

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h	2004-11-30 03:46:50 UTC (rev 8306)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h	2004-11-30 05:46:57 UTC (rev 8307)
@@ -53,6 +53,8 @@
 
 	virtual OggPage* popFront();
 	virtual OggPage* peekFront();
+
+	virtual unsigned long numAvail();
 	
 	virtual __int64 frontTime();
 	virtual __int64 scaledFrontTime();



More information about the commits mailing list