iaudioprops.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /*
  2. * LAME MP3 encoder for DirectShow
  3. * Interface definition
  4. *
  5. * Copyright (c) 2000-2005 Marie Orlova, Peter Gubanov, Vitaly Ivanov, Elecard Ltd.
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. */
  22. // A custom interface to allow the user to modify audio
  23. // encoder properties
  24. #ifndef __IAUDIOPROPERTIES__
  25. #define __IAUDIOPROPERTIES__
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. // {ca7e9ef0-1cbe-11d3-8d29-00a0c94bbfee}
  30. DEFINE_GUID(IID_IAudioEncoderProperties,
  31. 0xca7e9ef0, 0x1cbe, 0x11d3, 0x8d, 0x29, 0x00, 0xa0, 0xc9, 0x4b, 0xbf, 0xee);
  32. //
  33. // Configuring MPEG audio encoder parameters with unspecified
  34. // input stream type may lead to misbehaviour and confusing
  35. // results. In most cases the specified parameters will be
  36. // overridden by defaults for the input media type.
  37. // To archive proper results use this interface on the
  38. // audio encoder filter with input pin connected to the valid
  39. // source.
  40. //
  41. DECLARE_INTERFACE_(IAudioEncoderProperties, IUnknown)
  42. {
  43. // Is PES output enabled? Return TRUE or FALSE
  44. STDMETHOD(get_PESOutputEnabled) (THIS_
  45. DWORD *dwEnabled
  46. ) PURE;
  47. // Enable/disable PES output
  48. STDMETHOD(set_PESOutputEnabled) (THIS_
  49. DWORD dwEnabled
  50. ) PURE;
  51. // Get target compression bitrate in Kbits/s
  52. STDMETHOD(get_Bitrate) (THIS_
  53. DWORD *dwBitrate
  54. ) PURE;
  55. // Set target compression bitrate in Kbits/s
  56. // Not all numbers available! See spec for details!
  57. STDMETHOD(set_Bitrate) (THIS_
  58. DWORD dwBitrate
  59. ) PURE;
  60. // Get variable bitrate flag
  61. STDMETHOD(get_Variable) (THIS_
  62. DWORD *dwVariable
  63. ) PURE;
  64. // Set variable bitrate flag
  65. STDMETHOD(set_Variable) (THIS_
  66. DWORD dwVariable
  67. ) PURE;
  68. // Get variable bitrate in Kbits/s
  69. STDMETHOD(get_VariableMin) (THIS_
  70. DWORD *dwmin
  71. ) PURE;
  72. // Set variable bitrate in Kbits/s
  73. // Not all numbers available! See spec for details!
  74. STDMETHOD(set_VariableMin) (THIS_
  75. DWORD dwmin
  76. ) PURE;
  77. // Get variable bitrate in Kbits/s
  78. STDMETHOD(get_VariableMax) (THIS_
  79. DWORD *dwmax
  80. ) PURE;
  81. // Set variable bitrate in Kbits/s
  82. // Not all numbers available! See spec for details!
  83. STDMETHOD(set_VariableMax) (THIS_
  84. DWORD dwmax
  85. ) PURE;
  86. // Get compression quality
  87. STDMETHOD(get_Quality) (THIS_
  88. DWORD *dwQuality
  89. ) PURE;
  90. // Set compression quality
  91. // Not all numbers available! See spec for details!
  92. STDMETHOD(set_Quality) (THIS_
  93. DWORD dwQuality
  94. ) PURE;
  95. // Get VBR quality
  96. STDMETHOD(get_VariableQ) (THIS_
  97. DWORD *dwVBRq
  98. ) PURE;
  99. // Set VBR quality
  100. // Not all numbers available! See spec for details!
  101. STDMETHOD(set_VariableQ) (THIS_
  102. DWORD dwVBRq
  103. ) PURE;
  104. // Get source sample rate. Return E_FAIL if input pin
  105. // in not connected.
  106. STDMETHOD(get_SourceSampleRate) (THIS_
  107. DWORD *dwSampleRate
  108. ) PURE;
  109. // Get source number of channels. Return E_FAIL if
  110. // input pin is not connected.
  111. STDMETHOD(get_SourceChannels) (THIS_
  112. DWORD *dwChannels
  113. ) PURE;
  114. // Get sample rate for compressed audio bitstream
  115. STDMETHOD(get_SampleRate) (THIS_
  116. DWORD *dwSampleRate
  117. ) PURE;
  118. // Set sample rate. See genaudio spec for details
  119. STDMETHOD(set_SampleRate) (THIS_
  120. DWORD dwSampleRate
  121. ) PURE;
  122. // Get channel mode. See genaudio.h for details
  123. STDMETHOD(get_ChannelMode) (THIS_
  124. DWORD *dwChannelMode
  125. ) PURE;
  126. // Set channel mode
  127. STDMETHOD(set_ChannelMode) (THIS_
  128. DWORD dwChannelMode
  129. ) PURE;
  130. // Is CRC enabled?
  131. STDMETHOD(get_CRCFlag) (THIS_
  132. DWORD *dwFlag
  133. ) PURE;
  134. // Enable/disable CRC
  135. STDMETHOD(set_CRCFlag) (THIS_
  136. DWORD dwFlag
  137. ) PURE;
  138. // Force mono
  139. STDMETHOD(get_ForceMono) (THIS_
  140. DWORD *dwFlag
  141. ) PURE;
  142. // Force mono
  143. STDMETHOD(set_ForceMono) (THIS_
  144. DWORD dwFlag
  145. ) PURE;
  146. // Set duration
  147. STDMETHOD(get_SetDuration) (THIS_
  148. DWORD *dwFlag
  149. ) PURE;
  150. // Set duration
  151. STDMETHOD(set_SetDuration) (THIS_
  152. DWORD dwFlag
  153. ) PURE;
  154. // Control 'original' flag
  155. STDMETHOD(get_OriginalFlag) (THIS_
  156. DWORD *dwFlag
  157. ) PURE;
  158. STDMETHOD(set_OriginalFlag) (THIS_
  159. DWORD dwFlag
  160. ) PURE;
  161. // Control 'copyright' flag
  162. STDMETHOD(get_CopyrightFlag) (THIS_
  163. DWORD *dwFlag
  164. ) PURE;
  165. STDMETHOD(set_CopyrightFlag) (THIS_
  166. DWORD dwFlag
  167. ) PURE;
  168. // Control 'Enforce VBR Minimum bitrate' flag
  169. STDMETHOD(get_EnforceVBRmin) (THIS_
  170. DWORD *dwFlag
  171. ) PURE;
  172. STDMETHOD(set_EnforceVBRmin) (THIS_
  173. DWORD dwFlag
  174. ) PURE;
  175. // Control 'Voice' flag
  176. STDMETHOD(get_VoiceMode) (THIS_
  177. DWORD *dwFlag
  178. ) PURE;
  179. STDMETHOD(set_VoiceMode) (THIS_
  180. DWORD dwFlag
  181. ) PURE;
  182. // Control 'Keep All Frequencies' flag
  183. STDMETHOD(get_KeepAllFreq) (THIS_
  184. DWORD *dwFlag
  185. ) PURE;
  186. STDMETHOD(set_KeepAllFreq) (THIS_
  187. DWORD dwFlag
  188. ) PURE;
  189. // Control 'Strict ISO complience' flag
  190. STDMETHOD(get_StrictISO) (THIS_
  191. DWORD *dwFlag
  192. ) PURE;
  193. STDMETHOD(set_StrictISO) (THIS_
  194. DWORD dwFlag
  195. ) PURE;
  196. // Control 'Disable short block' flag
  197. STDMETHOD(get_NoShortBlock) (THIS_
  198. DWORD *dwDisable
  199. ) PURE;
  200. STDMETHOD(set_NoShortBlock) (THIS_
  201. DWORD dwDisable
  202. ) PURE;
  203. // Control 'Xing VBR Tag' flag
  204. STDMETHOD(get_XingTag) (THIS_
  205. DWORD *dwXingTag
  206. ) PURE;
  207. STDMETHOD(set_XingTag) (THIS_
  208. DWORD dwXingTag
  209. ) PURE;
  210. // Control 'Forced mid/ side stereo' flag
  211. STDMETHOD(get_ForceMS) (THIS_
  212. DWORD *dwFlag
  213. ) PURE;
  214. STDMETHOD(set_ForceMS) (THIS_
  215. DWORD dwFlag
  216. ) PURE;
  217. // Control 'ModeFixed' flag
  218. STDMETHOD(get_ModeFixed) (THIS_
  219. DWORD *dwFlag
  220. ) PURE;
  221. STDMETHOD(set_ModeFixed) (THIS_
  222. DWORD dwFlag
  223. ) PURE;
  224. //Receive the block of encoder
  225. //configuration parametres
  226. STDMETHOD(get_ParameterBlockSize) (THIS_
  227. BYTE *pcBlock, DWORD *pdwSize
  228. ) PURE;
  229. // Set encoder configuration parametres
  230. STDMETHOD(set_ParameterBlockSize) (THIS_
  231. BYTE *pcBlock, DWORD dwSize
  232. ) PURE;
  233. // Set default audio encoder parameters depending
  234. // on current input stream type
  235. STDMETHOD(DefaultAudioEncoderProperties) (THIS_
  236. ) PURE;
  237. // By default the modified properties are not saved to
  238. // the registry immediately, so the filter needs to be
  239. // forced to do this. Omitting this step may lead to
  240. // misbehavior and confusing results.
  241. STDMETHOD(LoadAudioEncoderPropertiesFromRegistry) (THIS_
  242. ) PURE;
  243. STDMETHOD(SaveAudioEncoderPropertiesToRegistry) (THIS_
  244. ) PURE;
  245. // Determine whether the filter can be configured. If this
  246. // function returns E_FAIL then input format hasn't been
  247. // specified and filter behavior is unpredictable. If S_OK,
  248. // the filter could be configured with correct values.
  249. STDMETHOD(InputTypeDefined) (THIS_
  250. ) PURE;
  251. // Reconnects output pin (crucial for Fraunhofer MPEG Layer-3 Decoder)
  252. STDMETHOD(ApplyChanges) (THIS_
  253. ) PURE;
  254. // Allow output sample overlap in terms of DirectShow
  255. // timestamps (i.e. when sample's start time is less
  256. // than previous sample's end time). Avi Mux doesn't like this
  257. STDMETHOD(set_SampleOverlap) (THIS_
  258. DWORD dwFlag
  259. ) PURE;
  260. STDMETHOD(get_SampleOverlap) (THIS_
  261. DWORD *dwFlag
  262. ) PURE;
  263. };
  264. #ifdef __cplusplus
  265. }
  266. #endif
  267. #endif // __IAUDIOPROPERTIES__