[xiph-commits] r8411 - trunk/oggdsf/src/lib/core/directshow/dsfOggDemux

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Wed Dec 15 03:33:23 PST 2004


Author: illiminable
Date: 2004-12-15 03:33:22 -0800 (Wed, 15 Dec 2004)
New Revision: 8411

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
Log:
*Tidy tidy

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp	2004-12-15 10:44:55 UTC (rev 8410)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp	2004-12-15 11:33:22 UTC (rev 8411)
@@ -263,7 +263,7 @@
 	//Close the socket down
 	//Open up a new one to the same place.
 	//Make the partial content request.
-	//debugLog<<"Seeking to "<<inPos<<endl;
+	debugLog<<"Seeking to "<<inPos<<endl;
 	if (mFileCache.readSeek(inPos)) {
 		return inPos;
 	} else {
@@ -275,7 +275,7 @@
 
 void HTTPFileSource::close() {
 	//Killing thread
-	//debugLog<<"HTTPFileSource::close()"<<endl;
+	debugLog<<"HTTPFileSource::close()"<<endl;
 	if (ThreadExists() == TRUE) {
 		//debugLog<<"Calling Thread to EXIT"<<endl;
 		CallWorker(THREAD_EXIT);
@@ -301,7 +301,7 @@
 	//
 	mSeenResponse = false;
 	mLastResponse = "";
-	//debugLog<<"Open: "<<inSourceLocation<<endl;
+	debugLog<<"Open: "<<inSourceLocation<<endl;
 
 	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
 		CAutoLock locLock(mBufferLock);
@@ -355,7 +355,7 @@
 	
 		//debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
 		if ((locSizeBuffed == 0) && mIsEOF) {
-			//debugLog<<"isEOF : It is EOF"<<endl;
+			debugLog<<"isEOF : It is EOF"<<endl;
 			return true;
 		} else {
 			//debugLog<<"isEOF : It's not EOF"<<endl;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-12-15 10:44:55 UTC (rev 8410)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-12-15 11:33:22 UTC (rev 8411)
@@ -115,7 +115,7 @@
 	mDemuxLock = new CCritSec;
 	mStreamLock = new CCritSec;
 	mStreamMapper = new OggStreamMapper(this);
-	//debugLog.open("g:\\logs\\sourcelog.log", ios_base::out | ios_base::ate | ios_base::app);
+	debugLog.open("d:\\zen\\logs\\sourcelog.log", ios_base::out);
 	//debugLog<<"Test..."<<endl;
 	//debugLog.seekp(0, ios_base::end);
 	//debugLog<<"Test2..."<<endl;
@@ -137,7 +137,7 @@
 	mDemuxLock = new CCritSec;
 	mStreamLock = new CCritSec;
 
-	//debugLog.open("g:\\logs\\sourcelog.log", ios_base::out);
+	debugLog.open("d:\\zen\\logs\\anx_base_sourcelog.log", ios_base::out);
 	//When it is derived, it's up to the superclass to set this.
 	//mStreamMapper = new OggStreamMapper(this);
 
@@ -158,7 +158,7 @@
 	mDataSource->close();
 	delete mDataSource;
 
-	//debugLog.close();
+	debugLog.close();
 	
 	//Selete the stream mapper
 	delete mStreamMapper;
@@ -247,7 +247,6 @@
 	}
 
 }
-
 	 
 STDMETHODIMP OggDemuxSourceFilter::CheckCapabilities(DWORD *pCapabilities)
 {
@@ -447,12 +446,17 @@
 
 void OggDemuxSourceFilter::resetStream() {
 	{
+		debugLog<<"Reset stream pre-lock"<<endl;
 		CAutoLock locDemuxLock(mDemuxLock);
 		CAutoLock locSourceLock(mSourceFileLock);
+		debugLog<<"RestStream post-lock"<<endl;
 
 		//Close up the data source
 		mDataSource->clear();
+
+		debugLog<<"Pre close"<<endl;
 		mDataSource->close();
+		debugLog<<"Post close"<<endl;
 
 		//After closing kill the interface
 		delete mDataSource;
@@ -466,7 +470,9 @@
 		//Before opening make the interface
 		mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(mFileName).c_str());
 
+		debugLog<<"Pre open"<<endl;
 		mDataSource->open(StringHelper::toNarrowStr(mFileName).c_str());
+		debugLog<<"Post open"<<endl;
 		mDataSource->seek(mStreamMapper->startOfData());   //Should always be zero for now.
 
 		//TODO::: Should be doing stuff with the demux state here ? or packetiser ?>?
@@ -483,7 +489,7 @@
 {
 	CAutoLock locLock(m_pLock);
 	
-	//debugLog << "Delivering Begin Flush"<<endl;
+	debugLog << "Delivering Begin Flush"<<endl;
 	for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
 		mStreamMapper->getOggStream(i)->getPin()->DeliverBeginFlush();
 		//mStreamMapper->getOggStream(i)->flush();
@@ -491,13 +497,14 @@
 
 	//Should this be here or endflush or neither ?
 	//mOggBuffer.debugWrite("%%%%%% Reset calling from DeliverBegingFlush");
+	debugLog<<"Calling reset stream from begin flush"<<endl;
 	resetStream();
 }
 
 void OggDemuxSourceFilter::DeliverEndFlush() 
 {
 	CAutoLock locLock(m_pLock);
-	//debugLog << "Delivering End Flush"<<endl;
+	debugLog << "Delivering End Flush"<<endl;
 	for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
 		mStreamMapper->getOggStream(i)->flush();
 		mStreamMapper->getOggStream(i)->getPin()->DeliverEndFlush();
@@ -512,12 +519,13 @@
 		
 	}
 	//mOggBuffer.debugWrite("%%%%%% Reset calling from DeliverEOS");
+	debugLog<<"Calling reset stream from DeliverEOS"<<endl;
 	resetStream();
 }
 
 void OggDemuxSourceFilter::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) 
 {
-	//debugLog<<"DeliverNewSegment : Delivering start = "<<tStart<<" end = "<< tStop<<"rate = "<<dRate<<endl;
+	debugLog<<"DeliverNewSegment : Delivering start = "<<tStart<<" end = "<< tStop<<"rate = "<<dRate<<endl;
 	
 	for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
 		mStreamMapper->getOggStream(i)->getPin()->DeliverNewSegment(tStart, tStop, dRate);
@@ -636,7 +644,7 @@
 {
 	const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
 	CAutoLock locLock(m_pLock);
-	//debugLog<<"Run  :  time = "<<tStart<<endl;
+	debugLog<<"Run  :  time = "<<tStart<<endl;
 	//DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
 	return CBaseFilter::Run(tStart);
 	
@@ -645,7 +653,7 @@
 STDMETHODIMP OggDemuxSourceFilter::Pause(void) 
 {
 	CAutoLock locLock(m_pLock);
-	//debugLog << "** Pause called **"<<endl;
+	debugLog << "** Pause called **"<<endl;
 	if (m_State == State_Stopped) {
 		//debugLog << "Was in stopped state... starting thread"<<endl;
 		if (ThreadExists() == FALSE) {
@@ -663,7 +671,7 @@
 STDMETHODIMP OggDemuxSourceFilter::Stop(void) 
 {
 	CAutoLock locLock(m_pLock);
-	//debugLog<<"** Stop Called ** "<<endl;
+	debugLog<<"** Stop Called ** "<<endl;
 	CallWorker(THREAD_EXIT);
 	Close();
 	DeliverBeginFlush();

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h	2004-12-15 10:44:55 UTC (rev 8410)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h	2004-12-15 11:33:22 UTC (rev 8411)
@@ -196,7 +196,7 @@
 	OggStreamMapper* mStreamMapper;
 
 	//DEBUG
-	//fstream debugLog;
+	fstream debugLog;
 
 	
 };

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp	2004-12-15 10:44:55 UTC (rev 8410)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp	2004-12-15 11:33:22 UTC (rev 8411)
@@ -53,7 +53,7 @@
 {
 	//TODO::: Something about this is causing a COM reference leak.
 
-	//debugLog.open("G:\\logs\\sourcefilterpin.log", ios_base::out);
+	debugLog.open("d:\\zen\\logs\\sourcefilterpin.log", ios_base::out);
 	IMediaSeeking* locSeeker = NULL;
 	//if (inAllowSeek) {
 		//debugLog<<"Allowing seek"<<endl;
@@ -73,7 +73,7 @@
 
 OggDemuxSourcePin::~OggDemuxSourcePin(void)
 {
-	//debugLog.close();
+	debugLog.close();
 	
 	delete mDataQueue;
 	mDataQueue = NULL;
@@ -98,15 +98,15 @@
 	IMediaSample* locSample = NULL;
 	REFERENCE_TIME locStart = inPacket->startTime();
 	REFERENCE_TIME locStop = inPacket->endTime();
-	//debugLog<<"Start   : "<<locStart<<endl;
-	//debugLog<<"End     : "<<locStop<<endl;
-	DbgLog((LOG_TRACE, 2, "Getting Buffer in Source Pin..."));
+	debugLog<<"Delivering packet : "<<locStart<< " - "<<locStop<<endl;
+
+
 	HRESULT	locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
 	DbgLog((LOG_TRACE, 2, "* After get Buffer in Source Pin..."));
 	//Error checks
 	if (locHR != S_OK) {
 		//Stopping, fluching or error
-		//debugLog<<"Failure... No buffer"<<endl;
+		debugLog<<"Failure... No buffer"<<endl;
 		return false;
 	}
 
@@ -134,7 +134,7 @@
 		locHR = mDataQueue->Receive(locSample);
 
 		if (locHR != S_OK) {
-			//debugLog << "Failure... Queue rejected sample..."<<endl;
+			debugLog << "Failure... Queue rejected sample..."<<endl;
 			//Stopping ??
 			return false;
 		} else {
@@ -147,6 +147,7 @@
 }
 HRESULT OggDemuxSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
 {
+	debugLog<<"Delivering new segment"<<endl;
 	NewSegment(tStart, tStop, dRate);
 
 	mPartialPacket = NULL;
@@ -163,12 +164,14 @@
 
 HRESULT OggDemuxSourcePin::DeliverEndFlush(void)
 {
+	debugLog<<"Delivering End flush"<<endl;
 	mDataQueue->EndFlush();
     return S_OK;
 }
 
 HRESULT OggDemuxSourcePin::DeliverBeginFlush(void)
 {
+	debugLog<<"Delivering begin flush"<<endl;
 	mPartialPacket = NULL;
 	mDataQueue->BeginFlush();
     return S_OK;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h	2004-12-15 10:44:55 UTC (rev 8410)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h	2004-12-15 11:33:22 UTC (rev 8411)
@@ -90,6 +90,6 @@
 	StampedOggPacket* mPartialPacket;
 	HRESULT mFilterHR;
 	COutputQueue* mDataQueue;
-	//fstream debugLog;
+	fstream debugLog;
 	bool mFirstRun;
 };



More information about the commits mailing list