-
Creation of a Codec DLL that drives other codec DLL's
Hi Spoon (and others),
I'm trying to create a codec which behaves a little like the Audio CD "codec"
and sends data to be converted through to the chosen "sub-codec".
I've created a C++ header file to declare the "sub-codec" DLL functions and
added code to open the "sub-codec" DLL. Creating the codec object seems
to work with this piece of code (a converted file gets created on the hard
disk with file header):
CLWAVEOUT::CLWAVEOUT (char *Filename, ENCompressionOpenResult &ReturnError, WAVEFORMATEX *WFXOutputFormat)
{
if (!LoadCodecDll())
{
ReturnError = CORCodecError;
return;
}
extCreateNewCompressionObject(Filename,ReturnError ,WFXOutputFormat);
}
But, the following piece of code is stumping me:
//---------------------------------------------------------------------------
// A new data block has arrived (pData is a pointer to a buffer passed
// out from the call Service)
//---------------------------------------------------------------------------
void CLWAVEOUT::ANewDataBlockArrived (char *pData, DWORD DataLength, bool IsEOF, ENCompressBlockResult &Result)
{
extANewDataBlockArrived (????,pData,DataLength,IsEOF,Result);
}
The function extANewDataBlockArrived expects a "void *Output" where I
placed "????". Anyone know how to deal with this?
Best regards,
Daren.
-
Re: Creation of a Codec DLL that drives other codec DLL's
????? is the compression object, it is the (void *) returned by CreateACompressionObject - you need to pass it to NewDataBlock... and DeleteCompressionObject
-
Re: Creation of a Codec DLL that drives other codec DLL's
A-ha,
So do I need to create the compression object like this?
CLWAVEOUT *pOutput = new extCreateNewCompressionObject(Filename,ReturnError ,WFXOutputFormat);
And then call ANewDataBlockArrived like this?
extANewDataBlockArrived (pOutput,pData,DataLength,IsEOF,Result);
Best regards,
Daren.
-
Re: Creation of a Codec DLL that drives other codec DLL's
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Copyright © illustrate 2024, All rights reserved