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 //#include <streams.h> 00034 //#include <pullpin.h> 00035 //#include <initguid.h> 00036 00037 //#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS 00038 //#pragma message("----> Exporting from Abstract Library...") 00039 //#define ABS_AUDIO_DEC_API __declspec(dllexport) 00040 //#else 00041 //#pragma message("<---- Importing from Abstract Library...") 00042 //#define ABS_AUDIO_DEC_API __declspec(dllimport) 00043 //#endif 00044 00045 #ifdef LIBOOOGG_EXPORTS 00046 #define LIBOOOGG_API __declspec(dllexport) 00047 #else 00048 #define LIBOOOGG_API __declspec(dllimport) 00049 #endif 00050 00051 // {7605E26C-DE38-4b82-ADD8-FE2568CC0B25} 00052 DEFINE_GUID(CLSID_SpeexDecodeFilter, 00053 0x7605e26c, 0xde38, 0x4b82, 0xad, 0xd8, 0xfe, 0x25, 0x68, 0xcc, 0xb, 0x25); 00054 00055 // {25A9729D-12F6-420e-BD53-1D631DC217DF} 00056 DEFINE_GUID(MEDIASUBTYPE_Speex, 00057 0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf); 00058 00059 // {78701A27-EFB5-4157-9553-38A7854E3E81} 00060 DEFINE_GUID(FORMAT_Speex, 00061 0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81); 00062 //This structure defines the type of input we accept on the input pin... Stream/Annodex 00063 00064 const REGPINTYPES SpeexDecodeOutputTypes = { 00065 &MEDIATYPE_Audio, 00066 &MEDIASUBTYPE_PCM 00067 }; 00068 00069 const REGPINTYPES SpeexDecodeInputTypes = { 00070 &MEDIATYPE_Audio, 00071 &MEDIASUBTYPE_Speex 00072 }; 00073 const REGFILTERPINS SpeexDecodePinReg[] = { 00074 { 00075 L"Speex Input", //Name (obsoleted) 00076 FALSE, //Renders from this pin ?? Not sure about this. 00077 FALSE, //Not an output pin 00078 FALSE, //Cannot have zero instances of this pin 00079 FALSE, //Cannot have more than one instance of this pin 00080 NULL, //Connects to filter (obsoleted) 00081 NULL, //Connects to pin (obsoleted) 00082 1, //upport two media type 00083 &SpeexDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex) 00084 } , 00085 00086 { 00087 L"PCM Output", //Name (obsoleted) 00088 FALSE, //Renders from this pin ?? Not sure about this. 00089 TRUE, //Is an output pin 00090 FALSE, //Cannot have zero instances of this pin 00091 FALSE, //Cannot have more than one instance of this pin 00092 NULL, //Connects to filter (obsoleted) 00093 NULL, //Connects to pin (obsoleted) 00094 1, //Only support one media type 00095 &SpeexDecodeOutputTypes //Pointer to media type (Audio/PCM) 00096 00097 } 00098 }; 00099 00100 00101 00102 const REGFILTER2 SpeexDecodeFilterReg = { 00103 1, 00104 MERIT_NORMAL, 00105 2, 00106 SpeexDecodePinReg 00107 00108 }; 00109 00110 00111 struct sSpeexFormatBlock { 00112 unsigned long speexVersion; 00113 unsigned long samplesPerSec; 00114 unsigned long minBitsPerSec; 00115 unsigned long avgBitsPerSec; 00116 unsigned long maxBitsPerSec; 00117 unsigned long numChannels; 00118 00119 };