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

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Fri Dec 31 05:31:41 PST 2004


Author: illiminable
Date: 2004-12-31 05:31:40 -0800 (Fri, 31 Dec 2004)
New Revision: 8564

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxProgress.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h
Log:
* Add the ability to find how many bytes have been written by the muxer.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2004-12-31 09:08:01 UTC (rev 8563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp	2004-12-31 13:31:40 UTC (rev 8564)
@@ -68,14 +68,18 @@
 
 	
 	//Put the annodex BOS out to the file.
+	mBytesWritten += locBOSPage->pageSize();
 	mFileWriter->acceptOggPage(locBOSPage);
 	delete locUTC;
 
 }
 
 void AnxPageInterleaver::addAllAnxData_2_0_BOS() {
+	OggPage* locOggPage = NULL;
 	for (int i = 0; i < mInputStreams.size() - 1; i++) {
-		mFileWriter->acceptOggPage(mInputStreams[i]->popFront());
+		locOggPage = mInputStreams[i]->popFront();
+		mBytesWritten += locOggPage->pageSize();
+		mFileWriter->acceptOggPage(locOggPage);
 		mInputStreams[i]->setNumHeaders(mInputStreams[i]->numHeaders() + 1);
 	}
 
@@ -90,6 +94,7 @@
 	locEOSPage->header()->setHeaderFlags(4);
 	locEOSPage->header()->setHeaderSize(27);
 
+	mBytesWritten += locEOSPage->pageSize();
 	mFileWriter->acceptOggPage(locEOSPage);
 }
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxProgress.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxProgress.h	2004-12-31 09:08:01 UTC (rev 8563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/IOggMuxProgress.h	2004-12-31 13:31:40 UTC (rev 8564)
@@ -11,6 +11,8 @@
 DECLARE_INTERFACE_(IOggMuxProgress, IUnknown) {
 
 	virtual STDMETHODIMP_(LONGLONG) getProgressTime() PURE;
+	virtual STDMETHODIMP_(LONGLONG) getBytesWritten() PURE;
+	
 
 };
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2004-12-31 09:08:01 UTC (rev 8563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp	2004-12-31 13:31:40 UTC (rev 8564)
@@ -100,6 +100,15 @@
 	}
 
 }
+
+STDMETHODIMP_(LONGLONG) OggMuxFilter::getBytesWritten() {
+	if (mInterleaver != NULL) {
+		return mInterleaver->bytesWritten();
+	} else {
+		return -1;
+	}
+
+}
 ULONG OggMuxFilter::GetMiscFlags(void) 
 {
 	debugLog<<"GetMiscflags"<<endl;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h	2004-12-31 09:08:01 UTC (rev 8563)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h	2004-12-31 13:31:40 UTC (rev 8564)
@@ -94,6 +94,7 @@
 
 	//IOggMuxProgress Implementation
 	virtual STDMETHODIMP_(LONGLONG) getProgressTime();
+	virtual STDMETHODIMP_(LONGLONG) getBytesWritten();
 
 
 protected:

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp	2004-12-31 09:08:01 UTC (rev 8563)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp	2004-12-31 13:31:40 UTC (rev 8564)
@@ -35,6 +35,7 @@
 	:	mFileWriter(inFileWriter)
 	,	mNotifier(inNotifier)
 	,	mProgressTime(0)
+	,	mBytesWritten(0)
 {
 	debugLog.open("G:\\logs\\interleaver.log", ios_base::out);
 }
@@ -201,15 +202,24 @@
 			debugLog<<"writeLowest : Writing..."<<endl;
 			mProgressTime = locLowestStream->scaledFrontTime();
 			debugLog<<"writeLowest : Progress Time = "<<mProgressTime<<endl;
-			//TODO::: Handle case where the popped page is a null pointer.
-			mFileWriter->acceptOggPage(locLowestStream->popFront());		//Gives away page
+
+			OggPage* locPageToWrite = locLowestStream->popFront();
+			mBytesWritten += locPageToWrite->pageSize();
+			//TODO::: Handle case where the popped page is a null pointer. Can it even happen ?? There should never be a null pointer.
+			mFileWriter->acceptOggPage(locPageToWrite);		//Gives away page
 		}
 
 }
 
-LOOG_INT64 OggPageInterleaver::progressTime() {
+LOOG_INT64 OggPageInterleaver::progressTime() 
+{
 	return mProgressTime;
 }
+
+LOOG_INT64 OggPageInterleaver::bytesWritten()
+{
+	return mBytesWritten;
+}
 bool OggPageInterleaver::isProcessable() {
 	bool retVal = true;
 	//ASSERT(mInputStreams.size() >= 1)

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h	2004-12-31 09:08:01 UTC (rev 8563)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h	2004-12-31 13:31:40 UTC (rev 8564)
@@ -55,6 +55,7 @@
 	virtual bool isAllEmpty();
 
 	virtual LOOG_INT64 progressTime();
+	virtual LOOG_INT64 bytesWritten();
 
 	//INotifyArrival Implementation
 	virtual void notifyArrival();
@@ -64,6 +65,7 @@
 	IOggCallback* mFileWriter;		//TODO::: Shuoldn't be called filewriter.
 	INotifyComplete* mNotifier;
 
+	LOOG_INT64 mBytesWritten;
 	LOOG_INT64 mProgressTime;
 	//DEBUG ONLY
 	fstream debugLog;



More information about the commits mailing list