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 sFLACFormatBlock { 00035 unsigned short numChannels; 00036 unsigned long numBitsPerSample; 00037 unsigned long sampleRate; 00038 00039 }; 00040 00041 #include "AbstractTransformFilter.h" 00042 #include "AbstractTransformInputPin.h" 00043 #include "AbstractTransformOutputPin.h" 00044 #include "FLACEncodeInputPin.h" 00045 #include "FLACEncodeOutputPin.h" 00046 #include "FLACEncodeFilter.h" 00047 00048 #ifdef LIBOOOGG_EXPORTS 00049 #define LIBOOOGG_API __declspec(dllexport) 00050 #else 00051 #define LIBOOOGG_API __declspec(dllimport) 00052 #endif 00053 00054 00056 //DEFINE_GUID(MEDIASUBTYPE_FLAC, 00057 //0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7); 00058 00059 // {2C409DB0-95BF-47ba-B0F5-587256F1EDCF} 00060 DEFINE_GUID(MEDIASUBTYPE_OggFLAC_1_0, 00061 0x2c409db0, 0x95bf, 0x47ba, 0xb0, 0xf5, 0x58, 0x72, 0x56, 0xf1, 0xed, 0xcf); 00062 00063 // {77E3A6A3-2A24-43fa-B929-00747E4B560B} 00064 DEFINE_GUID(CLSID_FLACEncodeFilter, 00065 0x77e3a6a3, 0x2a24, 0x43fa, 0xb9, 0x29, 0x0, 0x74, 0x7e, 0x4b, 0x56, 0xb); 00066 00067 00068 // {1CDC48AC-4C24-4b8b-982B-7007A29D83C4} 00069 DEFINE_GUID(FORMAT_FLAC, 00070 0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4); 00071 00072 00073 00074 00075 const REGPINTYPES FLACEncodeInputTypes = { 00076 &MEDIATYPE_Audio, 00077 &MEDIASUBTYPE_PCM 00078 }; 00079 00080 const REGPINTYPES FLACEncodeOutputTypes = { 00081 &MEDIATYPE_Audio, 00082 &MEDIASUBTYPE_OggFLAC_1_0 00083 }; 00084 00085 const REGFILTERPINS FLACEncodePinReg[] = { 00086 { 00087 L"PCM Input", //Name (obsoleted) 00088 FALSE, //Renders from this pin ?? Not sure about this. 00089 FALSE, //Not 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, //upport two media type 00095 &FLACEncodeInputTypes //Pointer to media type (Audio/FLAC or Audio/FLAC) 00096 } , 00097 00098 { 00099 L"FLAC Output", //Name (obsoleted) 00100 FALSE, //Renders from this pin ?? Not sure about this. 00101 TRUE, //Is an output pin 00102 FALSE, //Cannot have zero instances of this pin 00103 FALSE, //Cannot have more than one instance of this pin 00104 NULL, //Connects to filter (obsoleted) 00105 NULL, //Connects to pin (obsoleted) 00106 1, //Only support one media type 00107 &FLACEncodeOutputTypes //Pointer to media type (Audio/PCM) 00108 00109 } 00110 }; 00111 00112 00113 00114 const REGFILTER2 FLACEncodeFilterReg = { 00115 1, 00116 MERIT_DO_NOT_USE, 00117 2, 00118 FLACEncodePinReg 00119 00120 }; 00121 00122