Description | Hierarchy | Fields | Methods | Properties |
type unaMsAcmCodec = class(unaMsAcmStreamDevice)
This class is wrapper over Windows Multimedia streams API. Create it specifying the driver you wish to use with the stream. You can get list of available drivers from unaMsAcm class instance.
Codec usually takes source (input) stream, converts it into another wave format, and produces destination (output) stream. Before opening the codec you should specify source and destination formats using the setFormat() method. isSrc parameter is true for source format and false for destination. tag and index are specific for selected driver.
For example, Microsoft PCM Converter driver has tag = 1 and index specifies sampling parameters. So, if you specify tag=1, index=1 as source and tag=1, index=9 as destination, codec will convert 8,000 kHz; 8 Bit; stereo PCM stream into 22,050 kHz; 8 Bit; stereo PCM stream. You can easily enumerate all formats supported by specific driver using the unaMsAcmDriver.enumFormats() method.
After setting source and destination formats call the open() method to activate the codec. If you wish to check specified formats conversion is supported by codec, rather than opening it, specify true for query parameter. open() returns MMSYSERR_NOERR if codec was activated successfully. After that you need to feed the source stream using write() method, and periodically check destination stream, calling read() method. When you are finished with codec, destroy it or call the close() method.
constructor create(driver: unaMsAcmDriver; realtime: bool = false; overNum: unsigned = 0; highPriority: bool = false; driverMode: unaAcmCodecDriverMode = unacdm_acm); |
|
function setFormatSuggest(isSrcPCM: bool; const format: WAVEFORMATEX): bool; overload; |
|
function setPcmFormatSuggest(isSrcPCM: bool; pcmFormat: pWAVEFORMATEX; formatTag: unsigned): bool; overload; |
|
function setPcmFormatSuggest(isSrcPCM: bool; samplesPerSec: unsigned = c_defSamplingSamplesPerSec; bitsPerSample: unsigned = c_defSamplingBitsPerSample; numChannels: unsigned = c_defSamplingNumChannels; formatTag: unsigned = 0): bool; overload; |
|
function doClose(timeout: tTimeout = 1): MMRESULT; override; |
|
function doOpen(flags: uint): MMRESULT; override; |
|
function doWrite(buf: pointer; size: unsigned): unsigned; override; |
|
function execute(globalIndex: unsigned): int; override; |
|
function getMasterIsSrc2(): bool; override; |
|
function open2(query: bool = false; timeout: tTimeout = 10003; flags: uint = 0; startDevice: bool = true): MMRESULT; override; |
|
function prepareHeader(header: pointer): MMRESULT; override; |
|
function processNextChunk(): bool; |
|
function unprepareHeader(header: pointer): MMRESULT; override; |
|
procedure BeforeDestruction(); override; |
|
procedure setFormatIndex(isSrc: bool; tag, index: unsigned); |
|
procedure setFormatSuggest(isSrc: bool; desiredDriver: unaMsAcmDriver; tag, index: unsigned; flags: uint = ACM_FORMATSUGGESTF_NCHANNELS + ACM_FORMATSUGGESTF_NSAMPLESPERSEC + ACM_FORMATSUGGESTF_WBITSPERSAMPLE); overload; |
|
procedure removeHeader(var header: pointer); override; |
property driver: unaMsAcmDriver read f_driver write setDriver; |
|
property driverLibrary: wString read f_driverLibrary write setDriverLibrary; |
|
property driverMode: unaAcmCodecDriverMode read f_driverMode write f_driverMode; |
|
property dstChunkSize; |
|
property handle; |
|
property oH323codecDesc[index:int]: ppluginCodec_definition read getoH323pluginDesc; |
constructor create(driver: unaMsAcmDriver; realtime: bool = false; overNum: unsigned = 0; highPriority: bool = false; driverMode: unaAcmCodecDriverMode = unacdm_acm); |
|
Creates ACM codec class instance. |
function setFormatSuggest(isSrcPCM: bool; const format: WAVEFORMATEX): bool; overload; |
|
Use this method when you do know non-PCM parameters of source or dest stream. |
function setPcmFormatSuggest(isSrcPCM: bool; pcmFormat: pWAVEFORMATEX; formatTag: unsigned): bool; overload; |
|
Use this method when you do know PCM parameters of source or dest stream. |
function setPcmFormatSuggest(isSrcPCM: bool; samplesPerSec: unsigned = c_defSamplingSamplesPerSec; bitsPerSample: unsigned = c_defSamplingBitsPerSample; numChannels: unsigned = c_defSamplingNumChannels; formatTag: unsigned = 0): bool; overload; |
|
Use this method when you do know PCM parameters of source or dest stream. |
function doClose(timeout: tTimeout = 1): MMRESULT; override; |
|
function doOpen(flags: uint): MMRESULT; override; |
|
function doWrite(buf: pointer; size: unsigned): unsigned; override; |
|
// |
function execute(globalIndex: unsigned): int; override; |
|
function getMasterIsSrc2(): bool; override; |
|
Returns true. |
function open2(query: bool = false; timeout: tTimeout = 10003; flags: uint = 0; startDevice: bool = true): MMRESULT; override; |
|
function prepareHeader(header: pointer): MMRESULT; override; |
|
function processNextChunk(): bool; |
|
function unprepareHeader(header: pointer): MMRESULT; override; |
|
procedure BeforeDestruction(); override; |
|
procedure setFormatIndex(isSrc: bool; tag, index: unsigned); |
|
Sets the source or destination format for codec. |
procedure setFormatSuggest(isSrc: bool; desiredDriver: unaMsAcmDriver; tag, index: unsigned; flags: uint = ACM_FORMATSUGGESTF_NCHANNELS + ACM_FORMATSUGGESTF_NSAMPLESPERSEC + ACM_FORMATSUGGESTF_WBITSPERSAMPLE); overload; |
|
Use this method when you do not know the exact format supported by the codec, but do know the driver, tag and index of the desired format. |
procedure removeHeader(var header: pointer); override; |
|
property driver: unaMsAcmDriver read f_driver write setDriver; |
|
Returns the driver used to perform the codec job. |
property driverLibrary: wString read f_driverLibrary write setDriverLibrary; |
|
Specifies library file (DLL) for a driver. Not used with ACM codecs, where you should specify driver directly instead. |
property driverMode: unaAcmCodecDriverMode read f_driverMode write f_driverMode; |
|
Specifies driver mode: ACM, installable or internal. |
property dstChunkSize; |
|
Since codec is input/output device, we need to have second chunk of data. |
property handle; |
|
WinAPI ACM handle |
property oH323codecDesc[index:int]: ppluginCodec_definition read getoH323pluginDesc; |
|
H323 Codec description |
(c) 2012 Lake of Soft