title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Results 1 to 4 of 4

Thread: Creation of a Codec DLL that drives other codec DLL's

  1. #1
    TrinitySoftware
    Join Date
    Apr 2002
    Location
    Huizen, Holland
    Posts
    153

    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.

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    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

  3. #3
    TrinitySoftware
    Join Date
    Apr 2002
    Location
    Huizen, Holland
    Posts
    153

    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.

  4. #4
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Creation of a Codec DLL that drives other codec DLL's

    Yes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •