[xiph-commits] r7445 - in trunk/oggdsf: docs

illiminable at motherfish-iii.xiph.org illiminable
Thu Aug 5 19:06:23 PDT 2004


src/lib/core/directshow/dsfAbstractAudioDecoder
src/lib/core/directshow/dsfOggDemux src/lib/core/ogg/libOOOgg
Message-ID: <E1Bsu7j-0001kV-Vx at motherfish-III>

Author: illiminable
Date: Thu Aug  5 19:06:23 2004
New Revision: 7445

Added:
trunk/oggdsf/docs/packet_overhead.txt
Modified:
trunk/oggdsf/docs/TODO.txt
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
Log:
* More changes for new packetising.

Modified: trunk/oggdsf/docs/TODO.txt
===================================================================
--- trunk/oggdsf/docs/TODO.txt	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/docs/TODO.txt	2004-08-01 07:02:18 UTC (rev 7445)
@@ -18,7 +18,7 @@

# DON'T try to stop a FLAC stream. It crashes. Running to the end is ok.
# FLAC will make media player do the error sound or crash on exit
-# Only plays FLAC with 16 bit 2 channel 44100Hz settings. Still hardcoded.
+
# Only plays Ogg encapsulated FLAC. Won't play normal FLAC files.

NEW
@@ -26,6 +26,7 @@
* Add get and set functions for the format block to flac encoder like in the others. Get rid of the mecpy.
* Need to check sound buffers are empty when stop/start.
* Need to check code at ends of streams. A seek here stops all audio until stop/start.
+* Check directshow apis for flushing.

NOT BUG
=======
@@ -38,13 +39,11 @@
* Fix flac decoder
* Add seeking to annodex
# Duration is wrong for all files except speex, vorbis and theora... doesn't affect playback
+* CMML Application interface
+* Annodex seeking

-
NEXT FEATURES
=============
-* CMML Application interface
-* Annodex seeking
-
* Raw flac support
* Annodex Muxer
* WMP Ripping plug-in for vorbis and flac.
@@ -53,4 +52,5 @@
====
* flac encoder
* Add application cmml interface
-# Seeking in theora occasionally seg faults (Ithink)
\ No newline at end of file
+# Seeking in theora occasionally seg faults (Ithink)
+# Only plays FLAC with 16 bit 2 channel 44100Hz settings. Still hardcoded.
\ No newline at end of file

Added: trunk/oggdsf/docs/packet_overhead.txt
===================================================================
--- trunk/oggdsf/docs/packet_overhead.txt	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/docs/packet_overhead.txt	2004-08-01 07:02:18 UTC (rev 7445)
@@ -0,0 +1,5 @@
+0 		- 0     * 0
+1-254 		- 1     * 3937 to 1000000 Bpmil  1/x for (1 <= x <= 254)
+255-509		- 2	* 3929 to 7843 Bpmil     2/x for (255 <= x <= 509)
+510-764         - 3	*
+765-1019        - 4
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp	2004-08-01 07:02:18 UTC (rev 7445)
@@ -105,6 +105,8 @@
if (locHR != S_OK) {
return locHR;
}
+
+	//Need to save this pointer to decommit in destructor.

locHR = inAllocator->Commit();


Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-08-01 07:02:18 UTC (rev 7445)
@@ -285,38 +285,27 @@
DeliverBeginFlush();

//debugLog<<"       : Begin flush Delviered."<<endl;
-		//debugLog<<"       : Delivering new segemnt"<<endl;

-
-		//FIX ATTEMPT::: Part of time stamping fixes.. we don't use absolute times any more... this is out !
-		//IReferenceClock* locRefClock = NULL;
-		//HRESULT locHR = GetSyncSource(&locRefClock);
-
-		//LONGLONG locCurrentTime;
-		//locRefClock->GetTime(&locCurrentTime);
-		//DeliverNewSegment(locCurrentTime, locCurrentTime + mSeekTable->fileDuration(), 1.0);
-
-		//END FIX
-
-
-		//debugLog<<"       : NewSegment Delviered."<<endl;
+		//Find the byte position for this time.
unsigned long locStartPos = mSeekTable->getStartPos(*pCurrent);
bool locSendExcess = false;
+
+		//FIX::: This code needs to be removed, and handle start seek case.
if (locStartPos == mStreamMapper->startOfData()) {
locSendExcess = true;
}
-		//debugLog<<"       : Seeking to position "<<mSeekTable->getStartPos(*pCurrent)<<endl;
-		{
-			//Unneeded... this is done in deliver begin flush
-			//CAutoLock locDemuxLock(mDemuxLock);
-			//mOggBuffer.debugWrite("%%%%%% Clear calling from SetPos");
-			//mOggBuffer.clearData();
-		}
-
-		//debugLog << "Setting GranPos : "<<mSeekTable->getRealStartPos()<<endl;
+
+
+		//We have to save this here now... since time can't be reverted to granule pos in all cases
+		// we have to use granule pos timestamps in order for downstream codecs to work.
+		// Because of this we can't factor time bases after seeking into the sample times.
+		*pCurrent	= mSeekTimeBase
+					= mSeekTable->getRealStartPos();
+
+
for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
-			mStreamMapper->getOggStream(i)->setSendExcess(locSendExcess);
-			mStreamMapper->getOggStream(i)->setLastEndGranPos(mSeekTable->getRealStartPos());
+			mStreamMapper->getOggStream(i)->setSendExcess(locSendExcess);		//Not needed
+			mStreamMapper->getOggStream(i)->setLastEndGranPos(*pCurrent);
}
{
CAutoLock locStreamLock(mStreamLock);
@@ -326,20 +315,10 @@
DeliverNewSegment(*pCurrent, *pCurrent + mSeekTable->fileDuration(), 1.0);
}

-		//SOURCE ABSTRACTION::: seek
-		//mSourceFile.seekg(mSeekTable->getStartPos(*pCurrent), ios_base::beg);
+
+		mDataSource->seek(locStartPos);
//
-		mDataSource->seek(mSeekTable->getStartPos(*pCurrent));
-		//

-		//We have to save this here now... since time can't be reverted to granule pos in all cases
-		// we have to use granule pos timestamps in order for downstream codecs to work.
-		// Because of this we can't factor time bases after seeking into the sample times.
-		// So this is a big fat hack so that theora's crazy ass time scheme can work in directshow.
-		// We save the actual seek position as we do a seek and we misuse the MediaTime fields in the
-		// samples to send the time base. Theora 1, Compatability 0.
-		*pCurrent	= mSeekTimeBase
-					= mSeekTable->getRealStartPos();


//debugLog<<"       : Seek complete."<<endl;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp	2004-08-01 07:02:18 UTC (rev 7445)
@@ -159,7 +159,7 @@
//((BasicSeekable*)(inReceivePin))->SetDelegate(this);
//This may cause issue if pins are disconnected and reconnected
//DELETE in DEStructor
-	mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE,100);
+	mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
if (FAILED(mFilterHR)) {
mFilterHR = mFilterHR;
}

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h	2004-08-01 07:02:18 UTC (rev 7445)
@@ -61,7 +61,7 @@

virtual ~OggDemuxSourcePin(void);
static const unsigned long BUFFER_SIZE = 80000;			//What should this be ????
-	static const unsigned long NUM_BUFFERS = 100;
+	static const unsigned long NUM_BUFFERS = 10;


virtual bool deliverOggPacket(StampedOggPacket* inOggPacket);

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp	2004-08-01 07:02:18 UTC (rev 7445)
@@ -34,6 +34,7 @@

OggDataBuffer::OggDataBuffer(void)
:	mBuffer(NULL)
+	,	mPrevGranPos(0)
{
mBuffer = new CircularBuffer(MAX_OGG_PAGE_SIZE);

@@ -46,6 +47,7 @@
//Debug only
OggDataBuffer::OggDataBuffer(bool x)
:	mBuffer(NULL)
+	,	mPrevGranPos(0)
{
mBuffer = new CircularBuffer(MAX_OGG_PAGE_SIZE);

@@ -267,7 +269,7 @@


bool locIsFirstPacket = true;
-
+	__int64 locPrevGranPos = 0;
for (unsigned long i = 0; i < locNumSegs; i++) {
//Packet sums the lacing values of the segment table.
locCurrPackSize += locSegTable[i];
@@ -309,7 +311,10 @@
// lacing value is not equal to 255.
//ERROR CHECK:::
bool locIsContinuation = false;
+
if (locIsFirstPacket) {
+				locPrevGranPos = mPrevGranPos;
+				mPrevGranPos = pendingPage->header()->GranulePos();
locIsFirstPacket = false;
//First packet, check if the continuation flag is set.
if ((pendingPage->header()->HeaderFlags() & 1) == 1) {
@@ -318,7 +323,7 @@
}
}

-			pendingPage->addPacket( new StampedOggPacket(locBuff, locCurrPackSize, (locSegTable[i] == 255), locIsContinuation, 0, pendingPage->header()->GranulePos(), StampedOggPacket::OGG_END_ONLY ) );
+			pendingPage->addPacket( new StampedOggPacket(locBuff, locCurrPackSize, (locSegTable[i] == 255), locIsContinuation, locPrevGranPos, pendingPage->header()->GranulePos(), StampedOggPacket::OGG_BOTH ) );

//Reset the packet size counter.
locCurrPackSize = 0;
@@ -347,7 +352,7 @@
}
void OggDataBuffer::clearData() {
mBuffer->reset();
-
+	mPrevGranPos = 0;
//debugLog<<"ClearData : Transition back to AWAITING_BASE_HEADER"<<endl;



Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h	2004-08-01 03:41:14 UTC (rev 7444)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h	2004-08-01 07:02:18 UTC (rev 7445)
@@ -108,6 +108,7 @@
unsigned long mNumBytesNeeded;
eState mState;
OggPage* pendingPage;
+	__int64 mPrevGranPos;

//Callback pointers
IOggCallback* mVirtualCallback;



More information about the commits mailing list