2001-03-22 01:55:53 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
#include "guids.h"
|
|
|
|
#include "interfaces.h"
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
#include "DS_AudioDecoder.h"
|
2001-10-04 11:56:12 +00:00
|
|
|
#include "wine/winerror.h"
|
|
|
|
#include "libwin32.h"
|
2001-08-16 00:50:02 +00:00
|
|
|
//#include <cpuinfo.h>
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-10-04 11:56:12 +00:00
|
|
|
//#include <unistd.h>
|
|
|
|
//#include <fcntl.h>
|
|
|
|
//#include <errno.h>
|
|
|
|
//#include <sys/types.h>
|
|
|
|
//#include <sys/mman.h>
|
|
|
|
//#include <cstdio>
|
|
|
|
//#include <iostream>
|
|
|
|
//#include <strstream>
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
#include "DS_AudioDec.h"
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-10-04 00:07:15 +00:00
|
|
|
#include "ldt_keeper.h"
|
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
// DS_Decoder(const CodecInfo& info, const WAVEFORMATEX*);
|
|
|
|
// virtual ~DS_Decoder();
|
|
|
|
// virtual int Convert(const void*, size_t, void*, size_t, size_t*, size_t*);
|
|
|
|
// virtual int GetSrcSize(int);
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
static void* _handle;
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
extern "C" int DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf){
|
2001-03-22 01:55:53 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
Setup_LDT_Keeper();
|
2001-10-04 00:07:15 +00:00
|
|
|
Setup_FS_Segment();
|
2001-08-16 00:50:02 +00:00
|
|
|
|
|
|
|
CodecInfo ci;
|
|
|
|
ci.dll=dllname;
|
|
|
|
ci.guid=*guid;
|
|
|
|
|
|
|
|
DS_AudioDecoder* dec=new DS_AudioDecoder(ci, wf);
|
|
|
|
_handle=(void*)dec;
|
2001-03-22 01:55:53 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void DS_AudioDecoder_Close(){
|
|
|
|
}
|
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
extern "C" int DS_AudioDecoder_GetSrcSize(int dest_size){
|
|
|
|
DS_AudioDecoder* dec=(DS_AudioDecoder*)_handle;
|
|
|
|
return dec->GetSrcSize(dest_size);
|
2001-03-22 01:55:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" int DS_AudioDecoder_Convert(unsigned char* in_data, unsigned in_size,
|
|
|
|
unsigned char* out_data, unsigned out_size,
|
2001-08-16 00:50:02 +00:00
|
|
|
unsigned* size_read, unsigned* size_written){
|
|
|
|
DS_AudioDecoder* dec=(DS_AudioDecoder*)_handle;
|
2001-10-04 00:07:15 +00:00
|
|
|
Setup_FS_Segment();
|
2001-08-16 00:50:02 +00:00
|
|
|
return dec->Convert( (void*)in_data,(size_t)in_size,
|
|
|
|
(void*)out_data,(size_t)out_size,
|
|
|
|
(size_t*)size_read, (size_t*)size_written );
|
2001-03-22 01:55:53 +00:00
|
|
|
}
|
|
|
|
|