hrydgard/ppsspp — pull request #1979 by oioitff (2013-05-30 09:54:25+00:00)
Title: Add support for new atrac3plus decoder

Here is my way to support the new atrac3plus decoder.

If you want to support a platform, just build a lib with following export functions:

extern "C" void* Atrac3plusDecoder_openContext()
{
return new MaiAT3PlusFrameDecoder;
}

extern "C" int Atrac3plusDecoder_closeContext(void* context)
{
MaiAT3PlusFrameDecoder *frame_decoder =(MaiAT3PlusFrameDecoder*)context;
if (frame_decoder)
delete frame_decoder;
return 0;
}

extern "C" int Atrac3plusDecoder_decodeFrame(void* context, void* inbuf, int inbytes, int* channels, void** outbuf)
{
MaiAT3PlusFrameDecoder *frame_decoder = (MaiAT3PlusFrameDecoder*)context;
return frame_decoder->decodeFrame((Mai_I8*)inbuf, inbytes, channels, (Mai_I16**)outbuf);
}

And then, implement the interface in Core\HW\atrac3plus.cpp.
For static link with the lib, it's really easy. Just import the lib and call those functions.
For dynamic link with the lib, you can follow my win32 example in Core\HW\atrac3plus.cpp.

Here is a dynamic lib I build for win32: https://docs.google.com/file/d/0B1ftGc2t9-dZQ2daRTkwM3NQREE/edit?usp=sharing
Just put it in PPSSPP folder, it will start to work :)