189
|
1
|
|
2 #include "guids.h"
|
|
3 #include "interfaces.h"
|
1545
|
4
|
|
5 #include "DS_AudioDecoder.h"
|
2072
|
6 #include "wine/winerror.h"
|
|
7 #include "libwin32.h"
|
1545
|
8 //#include <cpuinfo.h>
|
189
|
9
|
2072
|
10 //#include <unistd.h>
|
|
11 //#include <fcntl.h>
|
|
12 //#include <errno.h>
|
|
13 //#include <sys/types.h>
|
|
14 //#include <sys/mman.h>
|
|
15 //#include <cstdio>
|
|
16 //#include <iostream>
|
|
17 //#include <strstream>
|
189
|
18
|
|
19 #include "DS_AudioDec.h"
|
|
20
|
2067
|
21 #include "ldt_keeper.h"
|
|
22
|
1545
|
23 // DS_Decoder(const CodecInfo& info, const WAVEFORMATEX*);
|
|
24 // virtual ~DS_Decoder();
|
|
25 // virtual int Convert(const void*, size_t, void*, size_t, size_t*, size_t*);
|
|
26 // virtual int GetSrcSize(int);
|
189
|
27
|
1545
|
28 static void* _handle;
|
189
|
29
|
1545
|
30 extern "C" int DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf){
|
|
31
|
|
32 Setup_LDT_Keeper();
|
2067
|
33 Setup_FS_Segment();
|
189
|
34
|
1545
|
35 CodecInfo ci;
|
|
36 ci.dll=dllname;
|
|
37 ci.guid=*guid;
|
189
|
38
|
1545
|
39 DS_AudioDecoder* dec=new DS_AudioDecoder(ci, wf);
|
|
40 _handle=(void*)dec;
|
189
|
41
|
|
42 return 0;
|
|
43 }
|
|
44
|
|
45 extern "C" void DS_AudioDecoder_Close(){
|
|
46 }
|
|
47
|
1545
|
48 extern "C" int DS_AudioDecoder_GetSrcSize(int dest_size){
|
|
49 DS_AudioDecoder* dec=(DS_AudioDecoder*)_handle;
|
|
50 return dec->GetSrcSize(dest_size);
|
189
|
51 }
|
|
52
|
|
53 extern "C" int DS_AudioDecoder_Convert(unsigned char* in_data, unsigned in_size,
|
|
54 unsigned char* out_data, unsigned out_size,
|
1545
|
55 unsigned* size_read, unsigned* size_written){
|
|
56 DS_AudioDecoder* dec=(DS_AudioDecoder*)_handle;
|
2067
|
57 Setup_FS_Segment();
|
1545
|
58 return dec->Convert( (void*)in_data,(size_t)in_size,
|
|
59 (void*)out_data,(size_t)out_size,
|
|
60 (size_t*)size_read, (size_t*)size_written );
|
189
|
61 }
|
|
62
|