00001 //=========================================================================== 00002 //Copyright (C) 2003, 2004 Zentaro Kavanagh 00003 // 00004 //Redistribution and use in source and binary forms, with or without 00005 //modification, are permitted provided that the following conditions 00006 //are met: 00007 // 00008 //- Redistributions of source code must retain the above copyright 00009 // notice, this list of conditions and the following disclaimer. 00010 // 00011 //- Redistributions in binary form must reproduce the above copyright 00012 // notice, this list of conditions and the following disclaimer in the 00013 // documentation and/or other materials provided with the distribution. 00014 // 00015 //- Neither the name of Zentaro Kavanagh nor the names of contributors 00016 // may be used to endorse or promote products derived from this software 00017 // without specific prior written permission. 00018 // 00019 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 //``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00022 //PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR 00023 //CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00024 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00025 //PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00026 //PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00027 //LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00028 //NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 //=========================================================================== 00031 00032 #pragma once 00033 00034 struct sSpeexFormatBlock { 00035 unsigned long speexVersion; 00036 unsigned long samplesPerSec; 00037 unsigned long minBitsPerSec; 00038 unsigned long avgBitsPerSec; 00039 unsigned long maxBitsPerSec; 00040 unsigned long numChannels; 00041 00042 }; 00043 #include "AbstractTransformFilter.h" 00044 #include "AbstractTransformInputPin.h" 00045 #include "AbstractTransformOutputPin.h" 00046 #include "SpeexEncodeInputPin.h" 00047 #include "SpeexEncodeOutputPin.h" 00048 #include "SpeexEncodeFilter.h" 00049 00050 #ifdef LIBOOOGG_EXPORTS 00051 #define LIBOOOGG_API __declspec(dllexport) 00052 #else 00053 #define LIBOOOGG_API __declspec(dllimport) 00054 #endif 00055 00056 00057 00058 00059 // {7036C2FE-A209-464c-97AB-95B9260EDBF7} 00060 DEFINE_GUID(CLSID_SpeexEncodeFilter, 00061 0x7036c2fe, 0xa209, 0x464c, 0x97, 0xab, 0x95, 0xb9, 0x26, 0xe, 0xdb, 0xf7); 00062 00063 // {25A9729D-12F6-420e-BD53-1D631DC217DF} 00064 DEFINE_GUID(MEDIASUBTYPE_Speex, 00065 0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf); 00066 00067 // {78701A27-EFB5-4157-9553-38A7854E3E81} 00068 DEFINE_GUID(FORMAT_Speex, 00069 0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81); 00070 //This structure defines the type of input we accept on the input pin... Stream/Annodex 00071 00072 const REGPINTYPES SpeexEncodeInputTypes = { 00073 &MEDIATYPE_Audio, 00074 &MEDIASUBTYPE_PCM 00075 }; 00076 00077 const REGPINTYPES SpeexEncodeOutputTypes = { 00078 &MEDIATYPE_Audio, 00079 &MEDIASUBTYPE_Speex 00080 }; 00081 00082 const REGFILTERPINS SpeexEncodePinReg[] = { 00083 { 00084 L"PCM Input", //Name (obsoleted) 00085 FALSE, //Renders from this pin ?? Not sure about this. 00086 FALSE, //Not an output pin 00087 FALSE, //Cannot have zero instances of this pin 00088 FALSE, //Cannot have more than one instance of this pin 00089 NULL, //Connects to filter (obsoleted) 00090 NULL, //Connects to pin (obsoleted) 00091 1, //upport two media type 00092 &SpeexEncodeInputTypes //Pointer to media type (Audio/Speex or Audio/Speex) 00093 } , 00094 00095 { 00096 L"Speex Output", //Name (obsoleted) 00097 FALSE, //Renders from this pin ?? Not sure about this. 00098 TRUE, //Is an output pin 00099 FALSE, //Cannot have zero instances of this pin 00100 FALSE, //Cannot have more than one instance of this pin 00101 NULL, //Connects to filter (obsoleted) 00102 NULL, //Connects to pin (obsoleted) 00103 1, //Only support one media type 00104 &SpeexEncodeOutputTypes //Pointer to media type (Audio/PCM) 00105 00106 } 00107 }; 00108 00109 00110 00111 const REGFILTER2 SpeexEncodeFilterReg = { 00112 1, 00113 MERIT_DO_NOT_USE, 00114 2, 00115 SpeexEncodePinReg 00116 00117 }; 00118 00119