title
Products            Buy            Support Forum            Professional            About            Codec Central
 

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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daren
    dBpoweramp Enthusiast
    • Apr 2002
    • 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.
  • Spoon
    Administrator
    • Apr 2002
    • 43898

    #2
    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
    Spoon
    www.dbpoweramp.com

    Comment

    • daren
      dBpoweramp Enthusiast
      • Apr 2002
      • 153

      #3
      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.

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 43898

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

        Yes
        Spoon
        www.dbpoweramp.com

        Comment

        Working...

        ]]>