1159b3361Sopenharmony_ci/* 2159b3361Sopenharmony_ci * LAME MP3 encoder for DirectShow 3159b3361Sopenharmony_ci * Interface definition 4159b3361Sopenharmony_ci * 5159b3361Sopenharmony_ci * Copyright (c) 2000-2005 Marie Orlova, Peter Gubanov, Vitaly Ivanov, Elecard Ltd. 6159b3361Sopenharmony_ci * 7159b3361Sopenharmony_ci * This library is free software; you can redistribute it and/or 8159b3361Sopenharmony_ci * modify it under the terms of the GNU Library General Public 9159b3361Sopenharmony_ci * License as published by the Free Software Foundation; either 10159b3361Sopenharmony_ci * version 2 of the License, or (at your option) any later version. 11159b3361Sopenharmony_ci * 12159b3361Sopenharmony_ci * This library is distributed in the hope that it will be useful, 13159b3361Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 14159b3361Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15159b3361Sopenharmony_ci * Library General Public License for more details. 16159b3361Sopenharmony_ci * 17159b3361Sopenharmony_ci * You should have received a copy of the GNU Library General Public 18159b3361Sopenharmony_ci * License along with this library; if not, write to the 19159b3361Sopenharmony_ci * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20159b3361Sopenharmony_ci * Boston, MA 02111-1307, USA. 21159b3361Sopenharmony_ci */ 22159b3361Sopenharmony_ci 23159b3361Sopenharmony_ci// A custom interface to allow the user to modify audio 24159b3361Sopenharmony_ci// encoder properties 25159b3361Sopenharmony_ci#ifndef __IAUDIOPROPERTIES__ 26159b3361Sopenharmony_ci#define __IAUDIOPROPERTIES__ 27159b3361Sopenharmony_ci#ifdef __cplusplus 28159b3361Sopenharmony_ciextern "C" { 29159b3361Sopenharmony_ci#endif 30159b3361Sopenharmony_ci // {ca7e9ef0-1cbe-11d3-8d29-00a0c94bbfee} 31159b3361Sopenharmony_ci DEFINE_GUID(IID_IAudioEncoderProperties, 32159b3361Sopenharmony_ci 0xca7e9ef0, 0x1cbe, 0x11d3, 0x8d, 0x29, 0x00, 0xa0, 0xc9, 0x4b, 0xbf, 0xee); 33159b3361Sopenharmony_ci // 34159b3361Sopenharmony_ci // Configuring MPEG audio encoder parameters with unspecified 35159b3361Sopenharmony_ci // input stream type may lead to misbehaviour and confusing 36159b3361Sopenharmony_ci // results. In most cases the specified parameters will be 37159b3361Sopenharmony_ci // overridden by defaults for the input media type. 38159b3361Sopenharmony_ci // To archive proper results use this interface on the 39159b3361Sopenharmony_ci // audio encoder filter with input pin connected to the valid 40159b3361Sopenharmony_ci // source. 41159b3361Sopenharmony_ci // 42159b3361Sopenharmony_ci DECLARE_INTERFACE_(IAudioEncoderProperties, IUnknown) 43159b3361Sopenharmony_ci { 44159b3361Sopenharmony_ci // Is PES output enabled? Return TRUE or FALSE 45159b3361Sopenharmony_ci STDMETHOD(get_PESOutputEnabled) (THIS_ 46159b3361Sopenharmony_ci DWORD *dwEnabled 47159b3361Sopenharmony_ci ) PURE; 48159b3361Sopenharmony_ci // Enable/disable PES output 49159b3361Sopenharmony_ci STDMETHOD(set_PESOutputEnabled) (THIS_ 50159b3361Sopenharmony_ci DWORD dwEnabled 51159b3361Sopenharmony_ci ) PURE; 52159b3361Sopenharmony_ci // Get target compression bitrate in Kbits/s 53159b3361Sopenharmony_ci STDMETHOD(get_Bitrate) (THIS_ 54159b3361Sopenharmony_ci DWORD *dwBitrate 55159b3361Sopenharmony_ci ) PURE; 56159b3361Sopenharmony_ci // Set target compression bitrate in Kbits/s 57159b3361Sopenharmony_ci // Not all numbers available! See spec for details! 58159b3361Sopenharmony_ci STDMETHOD(set_Bitrate) (THIS_ 59159b3361Sopenharmony_ci DWORD dwBitrate 60159b3361Sopenharmony_ci ) PURE; 61159b3361Sopenharmony_ci // Get variable bitrate flag 62159b3361Sopenharmony_ci STDMETHOD(get_Variable) (THIS_ 63159b3361Sopenharmony_ci DWORD *dwVariable 64159b3361Sopenharmony_ci ) PURE; 65159b3361Sopenharmony_ci // Set variable bitrate flag 66159b3361Sopenharmony_ci STDMETHOD(set_Variable) (THIS_ 67159b3361Sopenharmony_ci DWORD dwVariable 68159b3361Sopenharmony_ci ) PURE; 69159b3361Sopenharmony_ci // Get variable bitrate in Kbits/s 70159b3361Sopenharmony_ci STDMETHOD(get_VariableMin) (THIS_ 71159b3361Sopenharmony_ci DWORD *dwmin 72159b3361Sopenharmony_ci ) PURE; 73159b3361Sopenharmony_ci // Set variable bitrate in Kbits/s 74159b3361Sopenharmony_ci // Not all numbers available! See spec for details! 75159b3361Sopenharmony_ci STDMETHOD(set_VariableMin) (THIS_ 76159b3361Sopenharmony_ci DWORD dwmin 77159b3361Sopenharmony_ci ) PURE; 78159b3361Sopenharmony_ci // Get variable bitrate in Kbits/s 79159b3361Sopenharmony_ci STDMETHOD(get_VariableMax) (THIS_ 80159b3361Sopenharmony_ci DWORD *dwmax 81159b3361Sopenharmony_ci ) PURE; 82159b3361Sopenharmony_ci // Set variable bitrate in Kbits/s 83159b3361Sopenharmony_ci // Not all numbers available! See spec for details! 84159b3361Sopenharmony_ci STDMETHOD(set_VariableMax) (THIS_ 85159b3361Sopenharmony_ci DWORD dwmax 86159b3361Sopenharmony_ci ) PURE; 87159b3361Sopenharmony_ci // Get compression quality 88159b3361Sopenharmony_ci STDMETHOD(get_Quality) (THIS_ 89159b3361Sopenharmony_ci DWORD *dwQuality 90159b3361Sopenharmony_ci ) PURE; 91159b3361Sopenharmony_ci // Set compression quality 92159b3361Sopenharmony_ci // Not all numbers available! See spec for details! 93159b3361Sopenharmony_ci STDMETHOD(set_Quality) (THIS_ 94159b3361Sopenharmony_ci DWORD dwQuality 95159b3361Sopenharmony_ci ) PURE; 96159b3361Sopenharmony_ci // Get VBR quality 97159b3361Sopenharmony_ci STDMETHOD(get_VariableQ) (THIS_ 98159b3361Sopenharmony_ci DWORD *dwVBRq 99159b3361Sopenharmony_ci ) PURE; 100159b3361Sopenharmony_ci // Set VBR quality 101159b3361Sopenharmony_ci // Not all numbers available! See spec for details! 102159b3361Sopenharmony_ci STDMETHOD(set_VariableQ) (THIS_ 103159b3361Sopenharmony_ci DWORD dwVBRq 104159b3361Sopenharmony_ci ) PURE; 105159b3361Sopenharmony_ci // Get source sample rate. Return E_FAIL if input pin 106159b3361Sopenharmony_ci // in not connected. 107159b3361Sopenharmony_ci STDMETHOD(get_SourceSampleRate) (THIS_ 108159b3361Sopenharmony_ci DWORD *dwSampleRate 109159b3361Sopenharmony_ci ) PURE; 110159b3361Sopenharmony_ci // Get source number of channels. Return E_FAIL if 111159b3361Sopenharmony_ci // input pin is not connected. 112159b3361Sopenharmony_ci STDMETHOD(get_SourceChannels) (THIS_ 113159b3361Sopenharmony_ci DWORD *dwChannels 114159b3361Sopenharmony_ci ) PURE; 115159b3361Sopenharmony_ci // Get sample rate for compressed audio bitstream 116159b3361Sopenharmony_ci STDMETHOD(get_SampleRate) (THIS_ 117159b3361Sopenharmony_ci DWORD *dwSampleRate 118159b3361Sopenharmony_ci ) PURE; 119159b3361Sopenharmony_ci // Set sample rate. See genaudio spec for details 120159b3361Sopenharmony_ci STDMETHOD(set_SampleRate) (THIS_ 121159b3361Sopenharmony_ci DWORD dwSampleRate 122159b3361Sopenharmony_ci ) PURE; 123159b3361Sopenharmony_ci // Get channel mode. See genaudio.h for details 124159b3361Sopenharmony_ci STDMETHOD(get_ChannelMode) (THIS_ 125159b3361Sopenharmony_ci DWORD *dwChannelMode 126159b3361Sopenharmony_ci ) PURE; 127159b3361Sopenharmony_ci // Set channel mode 128159b3361Sopenharmony_ci STDMETHOD(set_ChannelMode) (THIS_ 129159b3361Sopenharmony_ci DWORD dwChannelMode 130159b3361Sopenharmony_ci ) PURE; 131159b3361Sopenharmony_ci // Is CRC enabled? 132159b3361Sopenharmony_ci STDMETHOD(get_CRCFlag) (THIS_ 133159b3361Sopenharmony_ci DWORD *dwFlag 134159b3361Sopenharmony_ci ) PURE; 135159b3361Sopenharmony_ci // Enable/disable CRC 136159b3361Sopenharmony_ci STDMETHOD(set_CRCFlag) (THIS_ 137159b3361Sopenharmony_ci DWORD dwFlag 138159b3361Sopenharmony_ci ) PURE; 139159b3361Sopenharmony_ci // Force mono 140159b3361Sopenharmony_ci STDMETHOD(get_ForceMono) (THIS_ 141159b3361Sopenharmony_ci DWORD *dwFlag 142159b3361Sopenharmony_ci ) PURE; 143159b3361Sopenharmony_ci // Force mono 144159b3361Sopenharmony_ci STDMETHOD(set_ForceMono) (THIS_ 145159b3361Sopenharmony_ci DWORD dwFlag 146159b3361Sopenharmony_ci ) PURE; 147159b3361Sopenharmony_ci // Set duration 148159b3361Sopenharmony_ci STDMETHOD(get_SetDuration) (THIS_ 149159b3361Sopenharmony_ci DWORD *dwFlag 150159b3361Sopenharmony_ci ) PURE; 151159b3361Sopenharmony_ci // Set duration 152159b3361Sopenharmony_ci STDMETHOD(set_SetDuration) (THIS_ 153159b3361Sopenharmony_ci DWORD dwFlag 154159b3361Sopenharmony_ci ) PURE; 155159b3361Sopenharmony_ci // Control 'original' flag 156159b3361Sopenharmony_ci STDMETHOD(get_OriginalFlag) (THIS_ 157159b3361Sopenharmony_ci DWORD *dwFlag 158159b3361Sopenharmony_ci ) PURE; 159159b3361Sopenharmony_ci STDMETHOD(set_OriginalFlag) (THIS_ 160159b3361Sopenharmony_ci DWORD dwFlag 161159b3361Sopenharmony_ci ) PURE; 162159b3361Sopenharmony_ci // Control 'copyright' flag 163159b3361Sopenharmony_ci STDMETHOD(get_CopyrightFlag) (THIS_ 164159b3361Sopenharmony_ci DWORD *dwFlag 165159b3361Sopenharmony_ci ) PURE; 166159b3361Sopenharmony_ci STDMETHOD(set_CopyrightFlag) (THIS_ 167159b3361Sopenharmony_ci DWORD dwFlag 168159b3361Sopenharmony_ci ) PURE; 169159b3361Sopenharmony_ci // Control 'Enforce VBR Minimum bitrate' flag 170159b3361Sopenharmony_ci STDMETHOD(get_EnforceVBRmin) (THIS_ 171159b3361Sopenharmony_ci DWORD *dwFlag 172159b3361Sopenharmony_ci ) PURE; 173159b3361Sopenharmony_ci STDMETHOD(set_EnforceVBRmin) (THIS_ 174159b3361Sopenharmony_ci DWORD dwFlag 175159b3361Sopenharmony_ci ) PURE; 176159b3361Sopenharmony_ci // Control 'Voice' flag 177159b3361Sopenharmony_ci STDMETHOD(get_VoiceMode) (THIS_ 178159b3361Sopenharmony_ci DWORD *dwFlag 179159b3361Sopenharmony_ci ) PURE; 180159b3361Sopenharmony_ci STDMETHOD(set_VoiceMode) (THIS_ 181159b3361Sopenharmony_ci DWORD dwFlag 182159b3361Sopenharmony_ci ) PURE; 183159b3361Sopenharmony_ci // Control 'Keep All Frequencies' flag 184159b3361Sopenharmony_ci STDMETHOD(get_KeepAllFreq) (THIS_ 185159b3361Sopenharmony_ci DWORD *dwFlag 186159b3361Sopenharmony_ci ) PURE; 187159b3361Sopenharmony_ci STDMETHOD(set_KeepAllFreq) (THIS_ 188159b3361Sopenharmony_ci DWORD dwFlag 189159b3361Sopenharmony_ci ) PURE; 190159b3361Sopenharmony_ci // Control 'Strict ISO complience' flag 191159b3361Sopenharmony_ci STDMETHOD(get_StrictISO) (THIS_ 192159b3361Sopenharmony_ci DWORD *dwFlag 193159b3361Sopenharmony_ci ) PURE; 194159b3361Sopenharmony_ci STDMETHOD(set_StrictISO) (THIS_ 195159b3361Sopenharmony_ci DWORD dwFlag 196159b3361Sopenharmony_ci ) PURE; 197159b3361Sopenharmony_ci // Control 'Disable short block' flag 198159b3361Sopenharmony_ci STDMETHOD(get_NoShortBlock) (THIS_ 199159b3361Sopenharmony_ci DWORD *dwDisable 200159b3361Sopenharmony_ci ) PURE; 201159b3361Sopenharmony_ci STDMETHOD(set_NoShortBlock) (THIS_ 202159b3361Sopenharmony_ci DWORD dwDisable 203159b3361Sopenharmony_ci ) PURE; 204159b3361Sopenharmony_ci // Control 'Xing VBR Tag' flag 205159b3361Sopenharmony_ci STDMETHOD(get_XingTag) (THIS_ 206159b3361Sopenharmony_ci DWORD *dwXingTag 207159b3361Sopenharmony_ci ) PURE; 208159b3361Sopenharmony_ci STDMETHOD(set_XingTag) (THIS_ 209159b3361Sopenharmony_ci DWORD dwXingTag 210159b3361Sopenharmony_ci ) PURE; 211159b3361Sopenharmony_ci // Control 'Forced mid/ side stereo' flag 212159b3361Sopenharmony_ci STDMETHOD(get_ForceMS) (THIS_ 213159b3361Sopenharmony_ci DWORD *dwFlag 214159b3361Sopenharmony_ci ) PURE; 215159b3361Sopenharmony_ci STDMETHOD(set_ForceMS) (THIS_ 216159b3361Sopenharmony_ci DWORD dwFlag 217159b3361Sopenharmony_ci ) PURE; 218159b3361Sopenharmony_ci // Control 'ModeFixed' flag 219159b3361Sopenharmony_ci STDMETHOD(get_ModeFixed) (THIS_ 220159b3361Sopenharmony_ci DWORD *dwFlag 221159b3361Sopenharmony_ci ) PURE; 222159b3361Sopenharmony_ci STDMETHOD(set_ModeFixed) (THIS_ 223159b3361Sopenharmony_ci DWORD dwFlag 224159b3361Sopenharmony_ci ) PURE; 225159b3361Sopenharmony_ci 226159b3361Sopenharmony_ci //Receive the block of encoder 227159b3361Sopenharmony_ci //configuration parametres 228159b3361Sopenharmony_ci STDMETHOD(get_ParameterBlockSize) (THIS_ 229159b3361Sopenharmony_ci BYTE *pcBlock, DWORD *pdwSize 230159b3361Sopenharmony_ci ) PURE; 231159b3361Sopenharmony_ci // Set encoder configuration parametres 232159b3361Sopenharmony_ci STDMETHOD(set_ParameterBlockSize) (THIS_ 233159b3361Sopenharmony_ci BYTE *pcBlock, DWORD dwSize 234159b3361Sopenharmony_ci ) PURE; 235159b3361Sopenharmony_ci // Set default audio encoder parameters depending 236159b3361Sopenharmony_ci // on current input stream type 237159b3361Sopenharmony_ci STDMETHOD(DefaultAudioEncoderProperties) (THIS_ 238159b3361Sopenharmony_ci ) PURE; 239159b3361Sopenharmony_ci // By default the modified properties are not saved to 240159b3361Sopenharmony_ci // the registry immediately, so the filter needs to be 241159b3361Sopenharmony_ci // forced to do this. Omitting this step may lead to 242159b3361Sopenharmony_ci // misbehavior and confusing results. 243159b3361Sopenharmony_ci STDMETHOD(LoadAudioEncoderPropertiesFromRegistry) (THIS_ 244159b3361Sopenharmony_ci ) PURE; 245159b3361Sopenharmony_ci STDMETHOD(SaveAudioEncoderPropertiesToRegistry) (THIS_ 246159b3361Sopenharmony_ci ) PURE; 247159b3361Sopenharmony_ci // Determine whether the filter can be configured. If this 248159b3361Sopenharmony_ci // function returns E_FAIL then input format hasn't been 249159b3361Sopenharmony_ci // specified and filter behavior is unpredictable. If S_OK, 250159b3361Sopenharmony_ci // the filter could be configured with correct values. 251159b3361Sopenharmony_ci STDMETHOD(InputTypeDefined) (THIS_ 252159b3361Sopenharmony_ci ) PURE; 253159b3361Sopenharmony_ci // Reconnects output pin (crucial for Fraunhofer MPEG Layer-3 Decoder) 254159b3361Sopenharmony_ci STDMETHOD(ApplyChanges) (THIS_ 255159b3361Sopenharmony_ci ) PURE; 256159b3361Sopenharmony_ci 257159b3361Sopenharmony_ci // Allow output sample overlap in terms of DirectShow 258159b3361Sopenharmony_ci // timestamps (i.e. when sample's start time is less 259159b3361Sopenharmony_ci // than previous sample's end time). Avi Mux doesn't like this 260159b3361Sopenharmony_ci STDMETHOD(set_SampleOverlap) (THIS_ 261159b3361Sopenharmony_ci DWORD dwFlag 262159b3361Sopenharmony_ci ) PURE; 263159b3361Sopenharmony_ci STDMETHOD(get_SampleOverlap) (THIS_ 264159b3361Sopenharmony_ci DWORD *dwFlag 265159b3361Sopenharmony_ci ) PURE; 266159b3361Sopenharmony_ci }; 267159b3361Sopenharmony_ci#ifdef __cplusplus 268159b3361Sopenharmony_ci} 269159b3361Sopenharmony_ci#endif 270159b3361Sopenharmony_ci#endif // __IAUDIOPROPERTIES__ 271159b3361Sopenharmony_ci 272159b3361Sopenharmony_ci 273159b3361Sopenharmony_ci 274