[xiph-commits] r11868 - trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sat Sep 30 05:30:35 PDT 2006


Author: illiminable
Date: 2006-09-30 05:30:19 -0700 (Sat, 30 Sep 2006)
New Revision: 11868

Modified:
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h
Log:
* Tidy up some code in the vorbis encde filter

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -37,9 +37,9 @@
 CFactoryTemplate g_Templates[] = 
 {
     { 
-		L"Vorbis Encode Filter",						// Name
-	    &CLSID_VorbisEncodeFilter,            // CLSID
-	    VorbisEncodeFilter::CreateInstance,	// Method to create an instance of MyComponent
+		L"Vorbis Encode Filter",				// Name
+	    &CLSID_VorbisEncodeFilter,              // CLSID
+	    VorbisEncodeFilter::CreateInstance,	    // Method to create an instance of MyComponent
         NULL,									// Initialization function
         NULL									// Set-up information (for filters)
     }
@@ -68,9 +68,11 @@
 
 VorbisEncodeFilter::~VorbisEncodeFilter(void)
 {
+
 }
 
-STDMETHODIMP VorbisEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+STDMETHODIMP VorbisEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) 
+{
 	if (riid == IID_IVorbisEncodeSettings) {
 		*ppv = (IVorbisEncodeSettings*)this;
 		((IUnknown*)*ppv)->AddRef();
@@ -78,6 +80,7 @@
 	}
 	return AbstractTransformFilter::NonDelegatingQueryInterface(riid, ppv);
 }
+
 bool VorbisEncodeFilter::ConstructPins() 
 {
 	//Inputs Audio / PCM / WaveFormatEx
@@ -113,12 +116,14 @@
 }
 
 
-STDMETHODIMP_(signed char) VorbisEncodeFilter::quality() {
+STDMETHODIMP_(signed char) VorbisEncodeFilter::quality() 
+{
 	return (signed char)( ((VorbisEncodeInputPin*)mInputPin)->mVorbisQuality * 100 );
 }
 
 
-STDMETHODIMP_(bool) VorbisEncodeFilter::setQuality(signed char inQuality) {
+STDMETHODIMP_(bool) VorbisEncodeFilter::setQuality(signed char inQuality) 
+{
 	
 	if ((inQuality >= 0) && (inQuality < 100)) {
 		
@@ -129,4 +134,4 @@
 		
 		return false;
 	}
-}
\ No newline at end of file
+}

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -69,16 +69,10 @@
 	/// Set the quality for vorbis encoding, between 0 and 99 inclusive (equiv to 0.0 to 0.99)
 	virtual STDMETHODIMP_(bool) setQuality(signed char inQuality);
 
-
 protected:
-
 	//Implementation of pure virtuals from AbstractTransformFilter
 	virtual bool ConstructPins();
 
 	//Member data
 	sVorbisFormatBlock mVorbisFormatBlock;
-
-
-	
 };
-

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -29,13 +29,19 @@
 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //===========================================================================
 
-
-
 #include "stdafx.h"
 #include "VorbisEncodeInputPin.h"
 
-VorbisEncodeInputPin::VorbisEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
-	:	AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("VorbisEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
+VorbisEncodeInputPin::VorbisEncodeInputPin(     AbstractTransformFilter* inParentFilter
+                                            ,   CCritSec* inFilterLock
+                                            ,   AbstractTransformOutputPin* inOutputPin
+                                            ,   vector<CMediaType*> inAcceptableMediaTypes)
+	:	AbstractTransformInputPin(      inParentFilter
+                                    ,   inFilterLock
+                                    ,   inOutputPin
+                                    ,   NAME("VorbisEncodeInputPin")
+                                    ,   L"PCM In"
+                                    ,   inAcceptableMediaTypes)
 	,	mFishSound(NULL)
 	,	mWaveFormat(NULL)
 	,	mUptoFrame(0)
@@ -78,7 +84,9 @@
 	}
 	return locErr;
 }
-bool VorbisEncodeInputPin::ConstructCodec() {
+
+bool VorbisEncodeInputPin::ConstructCodec() 
+{
 	mFishInfo.channels = mWaveFormat->nChannels;
 	mFishInfo.format = FISH_SOUND_VORBIS;
 	mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
@@ -174,7 +182,8 @@
 }
 
 
-HRESULT VorbisEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+HRESULT VorbisEncodeInputPin::SetMediaType(const CMediaType* inMediaType) 
+{
 	if (	(inMediaType->subtype == MEDIASUBTYPE_PCM) &&
 			(inMediaType->formattype == FORMAT_WaveFormatEx)) {
 
@@ -190,5 +199,4 @@
 
 	return CBaseInputPin::SetMediaType(inMediaType);
 
-	
 }

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -46,12 +46,18 @@
 	:	public AbstractTransformInputPin
 {
 public:
-	VorbisEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+    friend class VorbisEncodeFilter;
+
+	VorbisEncodeInputPin(       AbstractTransformFilter* inParentFilter
+                            ,   CCritSec* inFilterLock
+                            ,   AbstractTransformOutputPin* inOutputPin
+                            ,   vector<CMediaType*> inAcceptableMediaTypes);
 	virtual ~VorbisEncodeInputPin(void);
 
-	friend class VorbisEncodeFilter;
-
-	static int __cdecl VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+	static int __cdecl VorbisEncoded (      FishSound* inFishSound
+                                        ,   unsigned char* inPacketData
+                                        ,   long inNumBytes
+                                        ,   void* inThisPointer);
 	
 	virtual HRESULT SetMediaType(const CMediaType* inMediaType);
 
@@ -62,7 +68,6 @@
 	virtual bool ConstructCodec();
 	virtual void DestroyCodec();
 
-
 	//Member data
 	HRESULT mHR;
 	bool mBegun;
@@ -76,7 +81,5 @@
 	float mVorbisQuality;
 
 	fstream debugLog;
-
 	
 };
-

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -29,17 +29,26 @@
 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //===========================================================================
 
-
 #include "stdafx.h"
 #include "VorbisEncodeOutputPin.h"
 
-VorbisEncodeOutputPin::VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
-	:	AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"Vorbis Out", 65536, 5, inAcceptableMediaTypes)
+VorbisEncodeOutputPin::VorbisEncodeOutputPin(       VorbisEncodeFilter* inParentFilter
+                                                ,   CCritSec* inFilterLock
+                                                ,   vector<CMediaType*> inAcceptableMediaTypes)
+	:	AbstractTransformOutputPin(     inParentFilter
+                                    ,   inFilterLock
+                                    ,   NAME("VorbisDecodeOutputPin")
+                                    ,   L"Vorbis Out"
+                                    ,   65536
+                                    ,   5
+                                    ,   inAcceptableMediaTypes)
 {
+
 }
 
 VorbisEncodeOutputPin::~VorbisEncodeOutputPin(void)
 {
+
 }
 
 HRESULT VorbisEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
@@ -54,4 +63,3 @@
         return S_FALSE;
 	}
 }
-

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -38,48 +38,18 @@
 struct sVorbisFormatBlock;
 
 class VorbisEncodeOutputPin
-	:	public	AbstractTransformOutputPin
+	:	public AbstractTransformOutputPin
 {
 public:
 
 	friend class VorbisEncodeInputPin;
 
-	VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptabletMediaTypes);
+	VorbisEncodeOutputPin(      VorbisEncodeFilter* inParentFilter
+                            ,   CCritSec* inFilterLock
+                            ,   vector<CMediaType*> inAcceptabletMediaTypes);
 	virtual ~VorbisEncodeOutputPin(void);
 
-	//PURE VIRTUAL IMPLEMENTATION
-	//virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
-	//virtual unsigned long FormatBufferSize();
-
-
 protected:
 	virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
 	
 };
-
-
-//Old impl
-//*********************************************
-//#pragma once
-//
-//#include "vorbisencoderdllstuff.h"
-//#include "AbstractAudioEncodeOutputPin.h"
-//
-//class VorbisEncodeFilter;
-//struct sVorbisFormatBlock;
-//
-//class VorbisEncodeOutputPin
-//	:	public	AbstractAudioEncodeOutputPin
-//{
-//public:
-//	VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter, CCritSec* inFilterLock, CMediaType* inOutputMediaType);
-//	virtual ~VorbisEncodeOutputPin(void);
-//
-//	//PURE VIRTUAL IMPLEMENTATION
-//	virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
-//	virtual unsigned long FormatBufferSize();
-//
-//
-//protected:
-//	
-//};

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h	2006-09-30 12:01:27 UTC (rev 11867)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h	2006-09-30 12:30:19 UTC (rev 11868)
@@ -1,5 +1,5 @@
 //===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2003-2006 Zentaro Kavanagh
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -31,14 +31,6 @@
 
 #pragma once
 
-//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-//#pragma message("----> Exporting from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllimport)
-//#endif
-
 struct sVorbisFormatBlock {
 	unsigned long vorbisVersion;
 	unsigned long samplesPerSec;
@@ -61,9 +53,6 @@
 #define LIBOOOGG_API __declspec(dllimport)
 #endif
 
-//// {05A1D945-A794-44ef-B41A-2F851A117155}
-//DEFINE_GUID(CLSID_VorbisDecodeFilter, 
-//0x5a1d945, 0xa794, 0x44ef, 0xb4, 0x1a, 0x2f, 0x85, 0x1a, 0x11, 0x71, 0x55);
 
 // {5C94FE86-B93B-467f-BFC3-BD6C91416F9B}
 DEFINE_GUID(CLSID_VorbisEncodeFilter, 
@@ -128,5 +117,3 @@
         VorbisEncodePinReg
 		
 };
-	   
-



More information about the commits mailing list