[xiph-commits] r7737 - in trunk/oggdsf/src/lib: codecs/speex/filters/dsfSpeexEncoder codecs/theora/filters/dsfTheoraDecoder codecs/theora/filters/dsfTheoraEncoder core/directshow/dsfAbstractVideoEncoder core/directshow/dsfOggDemux

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Sep 11 00:45:08 PDT 2004


Author: illiminable
Date: 2004-09-11 00:45:08 -0700 (Sat, 11 Sep 2004)
New Revision: 7737

Modified:
   trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
Log:
* Changed a few of the buffers to make them bigger... it was having a cry, when i tried encoding anything bigger than 800*600... this is only a temporary solution though... it should really decide based on resolution so as not to set aside huge swags of memory that will never be used.

Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp	2004-09-11 04:59:13 UTC (rev 7736)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp	2004-09-11 07:45:08 UTC (rev 7737)
@@ -49,10 +49,15 @@
 //PURE VIRTUALS
 long SpeexEncodeInputPin::encodeData(unsigned char* inBuf, long inNumBytes) {
 
-
+	//TODO::: There is a problem when we get 8 bit samples.
+	//=====================================================
 	//debugLog << "encodeData receives : "<<inNumBytes<<" bytes"<<endl;
 	
-	float* locFloatBuf = new float[inNumBytes/2 + (inNumBytes % 2)];
+
+	//************************************ Check this line... the +(inNumBytes%2) is new
+	//Note the 2 is because a float is twice the width of a short.
+	float* locFloatBuf = new float[inNumBytes/2];   // + (inNumBytes % 2)];
+	//************************************ 
 	short locTempShort = 0;
 	float locTempFloat = 0;
 
@@ -151,6 +156,9 @@
 
 			//Add a reference so it isn't deleted en route.
 			//locSample->AddRef();
+			//NO - It alrady has a ref on it.
+
+			//TODO::: Need to propagate error states.
 			HRESULT locHR = locThis->mOutputPin->mDataQueue->Receive(locSample);						//->DownstreamFilter()->Receive(locSample);
 			if (locHR != S_OK) {
 				//locThis->debugLog<<"Sample rejected"<<endl;

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2004-09-11 04:59:13 UTC (rev 7736)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2004-09-11 07:45:08 UTC (rev 7737)
@@ -174,7 +174,7 @@
 
 
 	const unsigned long MIN_BUFFER_SIZE = 16*16;			//What should this be ????
-	const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024;
+	const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024 * 2;
 	const unsigned long MIN_NUM_BUFFERS = 1;
 	const unsigned long DEFAULT_NUM_BUFFERS = 1;
 

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp	2004-09-11 04:59:13 UTC (rev 7736)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp	2004-09-11 07:45:08 UTC (rev 7737)
@@ -102,6 +102,8 @@
 long TheoraEncodeInputPin::encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes) {
 	//Source Buffer all in one buffer
 
+	//YV12 memory layout for directshow
+	//=================================
 	//YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
 	//YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
 	//YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp	2004-09-11 04:59:13 UTC (rev 7736)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp	2004-09-11 07:45:08 UTC (rev 7737)
@@ -66,7 +66,7 @@
 	ALLOCATOR_PROPERTIES locActualAlloc;
 
 	const unsigned long MIN_BUFFER_SIZE = 65536;			//What should this be ????
-	const unsigned long DEFAULT_BUFFER_SIZE = 131072;
+	const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024;
 	const unsigned long MIN_NUM_BUFFERS = 3;
 	const unsigned long DEFAULT_NUM_BUFFERS = 5;
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp	2004-09-11 04:59:13 UTC (rev 7736)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp	2004-09-11 07:45:08 UTC (rev 7737)
@@ -115,6 +115,7 @@
 	BYTE* locBuffer = NULL;
 	locSample->GetPointer(&locBuffer);
 
+	//DbgLog((LOG_TRACE, 2, "* Packet size is %d"));
 	if (locSample->GetSize() >= inPacket->packetSize()) {
 
 		memcpy((void*)locBuffer, (const void*)inPacket->packetData(), inPacket->packetSize());
@@ -131,6 +132,7 @@
 			return true;
 		}
 	} else {
+		DbgLog((LOG_TRACE, 2, "* BUFFER TOO SMALL... FATALITY !!"));
 		throw 0;
 	}
 }

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h	2004-09-11 04:59:13 UTC (rev 7736)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h	2004-09-11 07:45:08 UTC (rev 7737)
@@ -60,8 +60,8 @@
 
 
 	virtual ~OggDemuxSourcePin(void);
-	static const unsigned long BUFFER_SIZE = 65536;			//What should this be ????
-	static const unsigned long NUM_BUFFERS = 100;
+	static const unsigned long BUFFER_SIZE = 1024*512;			//What should this be ????
+	static const unsigned long NUM_BUFFERS = 50;
 
 
 	virtual bool deliverOggPacket(StampedOggPacket* inOggPacket);



More information about the commits mailing list