[xiph-commits] r17349 - in trunk/oggdsf/src/lib/codecs: flac/filters/dsfFLACEncoder speex/filters/dsfSpeexEncoder theora/filters/dsfTheoraEncoder vorbis/filters/dsfVorbisEncoder webm/webmdshow/vp8encoder

cristianadam at svn.xiph.org cristianadam at svn.xiph.org
Mon Jul 26 15:33:51 PDT 2010


Author: cristianadam
Date: 2010-07-26 15:33:51 -0700 (Mon, 26 Jul 2010)
New Revision: 17349

Modified:
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp
   trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
   trunk/oggdsf/src/lib/codecs/webm/webmdshow/vp8encoder/dllentry.cpp
Log:
Fixed multiple encoder usage in the same filter graph.
Added theora, vp8 encoder to directshow video encoder category, vorbis, flac, speex to directshow audio encoder category.

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp	2010-07-26 21:53:31 UTC (rev 17348)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp	2010-07-26 22:33:51 UTC (rev 17349)
@@ -60,6 +60,15 @@
         &FLACEncodeFilterReg								// Pointer to filter information.
     );
 
+    hr = locFilterMapper->RegisterFilter(
+        CLSID_FLACEncodeFilter,						// Filter CLSID. 
+        L"Xiph.Org FLAC Encoder",					// Filter name.
+        NULL,										// Device moniker. 
+        &CLSID_AudioCompressorCategory,				// Direct Show general category
+        NULL,							// Instance data. ???????
+        &FLACEncodeFilterReg								// Pointer to filter information.
+        );
+
     locFilterMapper->Release();
 
     return hr;
@@ -85,6 +94,8 @@
 	}
 
     hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, NULL, CLSID_FLACEncodeFilter);
+    hr = locFilterMapper->UnregisterFilter(&CLSID_AudioCompressorCategory, NULL, CLSID_FLACEncodeFilter);
+    
     locFilterMapper->Release();
     return hr;
 

Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp	2010-07-26 21:53:31 UTC (rev 17348)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp	2010-07-26 22:33:51 UTC (rev 17349)
@@ -63,6 +63,15 @@
         &SpeexEncodeFilterReg								// Pointer to filter information.
     );
 
+    hr = locFilterMapper->RegisterFilter(
+        CLSID_SpeexEncodeFilter,						// Filter CLSID. 
+        L"Xiph.Org Speex Encoder",							// Filter name.
+        NULL,										// Device moniker. 
+        &CLSID_AudioCompressorCategory,				// Direct Show general category
+        NULL,							// Instance data. ???????
+        &SpeexEncodeFilterReg								// Pointer to filter information.
+        );
+
     locFilterMapper->Release();
 
     return hr;
@@ -89,8 +98,8 @@
 	
 
     hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, NULL, CLSID_SpeexEncodeFilter);
+    hr = locFilterMapper->UnregisterFilter(&CLSID_AudioCompressorCategory, NULL, CLSID_SpeexEncodeFilter);
 
-
 	//
     locFilterMapper->Release();
     return hr;

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp	2010-07-26 21:53:31 UTC (rev 17348)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp	2010-07-26 22:33:51 UTC (rev 17349)
@@ -623,7 +623,7 @@
     //Blue Green Red Blue Green Red.
     unsigned long numPixels = inNumBytes / 3;
 
-    static std::vector<unsigned char> ayuvBuf;
+    std::vector<unsigned char> ayuvBuf;
     ayuvBuf.resize(numPixels * 4);
 
 
@@ -701,7 +701,7 @@
 
 long TheoraEncodeInputPin::encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes) 
 {
-	static std::vector<unsigned char> ayuvBuf;
+	std::vector<unsigned char> ayuvBuf;
     ayuvBuf.resize(inNumBytes);
 
 	//Scaled by factor of 65536 to integerise.

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp	2010-07-26 21:53:31 UTC (rev 17348)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp	2010-07-26 22:33:51 UTC (rev 17349)
@@ -65,6 +65,16 @@
         &TheoraEncodeFilterReg								// Pointer to filter information.
     );
 
+    hr = locFilterMapper->RegisterFilter(
+        CLSID_TheoraEncodeFilter,						// Filter CLSID. 
+        L"Xiph.Org Theora Encoder",							// Filter name.
+        NULL,										// Device moniker. 
+        &CLSID_VideoCompressorCategory,				// Direct Show general category
+        NULL,							// Instance data. ???????
+        &TheoraEncodeFilterReg								// Pointer to filter information.
+        );
+    
+
     locFilterMapper->Release();
 
     return hr;
@@ -91,8 +101,8 @@
 	
 
     hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, NULL, CLSID_TheoraEncodeFilter);
+    hr = locFilterMapper->UnregisterFilter(&CLSID_VideoCompressorCategory, NULL, CLSID_TheoraEncodeFilter);
 
-
 	//
     locFilterMapper->Release();
     return hr;

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp	2010-07-26 21:53:31 UTC (rev 17348)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp	2010-07-26 22:33:51 UTC (rev 17349)
@@ -64,6 +64,15 @@
         &VorbisEncodeFilterReg								// Pointer to filter information.
     );
 
+    hr = locFilterMapper->RegisterFilter(
+        CLSID_VorbisEncodeFilter,						// Filter CLSID. 
+        L"Xiph.Org Vorbis Encoder",						// Filter name.
+        NULL,										// Device moniker. 
+        &CLSID_AudioCompressorCategory,				// Direct Show general category
+        NULL,							// Instance data. ???????
+        &VorbisEncodeFilterReg								// Pointer to filter information.
+        );
+
     locFilterMapper->Release();
 
     return hr;
@@ -90,6 +99,7 @@
 	
 
     hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, NULL, CLSID_VorbisEncodeFilter);
+    hr = locFilterMapper->UnregisterFilter(&CLSID_AudioCompressorCategory, NULL, CLSID_VorbisEncodeFilter);
 
 
 	//

Modified: trunk/oggdsf/src/lib/codecs/webm/webmdshow/vp8encoder/dllentry.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/webm/webmdshow/vp8encoder/dllentry.cpp	2010-07-26 21:53:31 UTC (rev 17348)
+++ trunk/oggdsf/src/lib/codecs/webm/webmdshow/vp8encoder/dllentry.cpp	2010-07-26 22:33:51 UTC (rev 17349)
@@ -85,6 +85,11 @@
                     0,
                     CLSID_VP8Encoder);
 
+    hr = pMapper->UnregisterFilter(
+            &CLSID_VideoCompressorCategory,
+            0,
+            CLSID_VP8Encoder);
+
     //TODO
     //assert(SUCCEEDED(hr));
 
@@ -201,5 +206,13 @@
             0,
             &filter);
 
+    hr = pMapper->RegisterFilter(
+            CLSID_VP8Encoder,
+            friendlyname,
+            0,
+            &CLSID_VideoCompressorCategory,
+            0,
+            &filter);
+
     return hr;
 }



More information about the commits mailing list