PDA

View Full Version : Interfacing with ssrc.dll


sh0dan
21st November 2003, 12:01
I am attempting to interface with DSP-Guru's SSRC.dll, but I've run into some problems.

1) DELIVER function.
ssrc.h (http://cultact-server.novi.dk/kpo/avisynth/ssrc.h) Defines a callback funtion that should recieve the data. Is there any way that this function could be a class member?

If I attempt to make it a member of the SSRC-class the compiler throws:

D:\dev\avisynth2\avisynth\ssrc-convert.cpp(81) : error C2664: 'init_ssrc' : cannot convert parameter 4 from 'void (float *,unsigned int)' to 'void (__cdecl *)(float *,unsigned int)'
None of the functions with this name in scope match the target type

If the function is not a member (as you can see in ssrc-convert.cpp (http://cultact-server.novi.dk/kpo/avisynth/ssrc-convert.cpp)) it compiles.

2) What is the "int** ENDING" in init_ssrc supposed to be?

3) Why is the result in getting back from SSRC amplified by a factor 10000000 (or something similar).

DSPguru
21st November 2003, 15:07
1. have no idea. i never write in c++. anyhow, you might want to add "extern c" to the function declerations.
2. ssrc has a local variable called 'ending' that '1' tells the resampler if this is the last processed block.
on init, the function will export a pointer to this variable, so that the calling program can alter the value of 'ending'.
3. you probably ran into a transient at the start of the processing. try to process a bigger file and see if there's a real gain assertion on the whole processed output.

sh0dan
21st November 2003, 15:25
@DspGuru:

1) It works - however it will disallow me from creating multiple instances. I'll try thinking of a workaround.

2) ok - I just wondered since it was a double reference.

3) Strange - it only happened in debug mode, but it went away once i redefined NDEBUG.

:thanks:

I hope I'll be able to bug you again in the near future.

Is downsampling the only supported mode?

DSPguru
22nd November 2003, 09:30
upsampling should be supported as well.
regarding the c++ integration, you might wanna consider using the ssrc class that can be found in the fb2k sdk. it's the same as ssrc/ssrc.dll, but has an oo structure.