[Mplayer-cvslog] CVS: main/loader/DirectShow DS_VideoDec.cpp,1.17,1.18 DS_VideoDec.h,1.2,1.3 DS_AudioDec.cpp,1.7,1.8 DS_AudioDec.h,1.1,1.2
Arpi of Ize
arpi at mplayer.dev.hu
Mon Dec 10 21:10:57 CET 2001
Update of /cvsroot/mplayer/main/loader/DirectShow
In directory mplayer:/var/tmp.root/cvs-serv21768
Modified Files:
DS_VideoDec.cpp DS_VideoDec.h DS_AudioDec.cpp DS_AudioDec.h
Log Message:
wrapper API is more similar to new C version
Index: DS_VideoDec.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/loader/DirectShow/DS_VideoDec.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DS_VideoDec.cpp 4 Oct 2001 11:56:12 -0000 1.17
+++ DS_VideoDec.cpp 10 Dec 2001 20:10:53 -0000 1.18
@@ -23,10 +23,7 @@
#include "ldt_keeper.h"
-static void* _handle; // will be parameter later...
-static char** _d_ptr; // will be parameter later...
-
-extern "C" int DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEADER* format, int flip,char** d_ptr){
+extern "C" void* DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEADER* format, int flip){
Setup_LDT_Keeper();
@@ -36,52 +33,45 @@
try {
DS_VideoDecoder* dec=new DS_VideoDecoder(ci, *format, flip);
- _d_ptr=d_ptr;
- _handle=(void*)dec;
- return 0;
+ return (void*)dec;
} catch (FatalError &e) { }
- _handle=NULL;
- return -1;
-
+ return NULL;
}
-extern "C" void DS_VideoDecoder_Start(){
+extern "C" void DS_VideoDecoder_StartInternal(void* _handle){
DS_VideoDecoder* dec=(DS_VideoDecoder*) _handle;
dec->Start();
}
-extern "C" void DS_VideoDecoder_Stop(){
+extern "C" void DS_VideoDecoder_Stop(void* _handle){
DS_VideoDecoder* dec=(DS_VideoDecoder*) _handle;
dec->Stop();
}
-extern "C" void DS_VideoDecoder_Restart(){
-}
-
-extern "C" void DS_VideoDecoder_Close(){
+extern "C" void DS_VideoDecoder_Destroy(void* _handle){
DS_VideoDecoder* dec=(DS_VideoDecoder*) _handle;
_handle=NULL;
delete dec;
}
-extern "C" int DS_VideoDecoder_DecodeFrame(char* src, int size, int is_keyframe, int render){
+extern "C" int DS_VideoDecoder_DecodeInternal(void* _handle, char* src, int size, int is_keyframe, char* dest){
DS_VideoDecoder* dec=(DS_VideoDecoder*) _handle;
CImage image;
- image.ptr=*_d_ptr;
+ image.ptr=dest;
return dec->Decode((void*)src,(size_t)size,is_keyframe,&image);
}
-extern "C" int DS_VideoDecoder_SetDestFmt(int bits, int csp){
+extern "C" int DS_VideoDecoder_SetDestFmt(void* _handle, int bits, int csp){
DS_VideoDecoder* dec=(DS_VideoDecoder*) _handle;
return dec->SetDestFmt(bits,(fourcc_t)csp);
}
-extern "C" int DS_SetValue_DivX(char* name, int value){
+extern "C" int DS_VideoDecoder_SetValue(void* _handle, char* name, int value){
DS_VideoDecoder* dec=(DS_VideoDecoder*) _handle;
/* This printf is annoying with autoquality, *
* should be moved into players code - atmos */
- //printf("DS_SetValue_DivX(%s),%d)\n",name,value);
+ //printf("DS_VideoDecoder_SetValue(%s),%d)\n",name,value);
return (int) dec->SetValue(name,value);
}
Index: DS_VideoDec.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/DirectShow/DS_VideoDec.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DS_VideoDec.h 20 Mar 2001 21:12:37 -0000 1.2
+++ DS_VideoDec.h 10 Dec 2001 20:10:53 -0000 1.3
@@ -10,21 +10,19 @@
extern "C" {
#endif /* defined(__cplusplus) */
-int DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEADER* format, int flip,char** d_ptr);
+void* DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEADER* format, int flip);
-void DS_VideoDecoder_Start();
+void DS_VideoDecoder_StartInternal(void* _handle);
-void DS_VideoDecoder_Stop();
+void DS_VideoDecoder_Stop(void* _handle);
-void DS_VideoDecoder_Restart();
+void DS_VideoDecoder_Destroy(void* _handle);
-void DS_VideoDecoder_Close();
+int DS_VideoDecoder_DecodeInternal(void* _handle, char* src, int size, int is_keyframe, char* dest);
-int DS_VideoDecoder_DecodeFrame(char* src, int size, int is_keyframe, int render);
+int DS_VideoDecoder_SetDestFmt(void* _handle, int bits, int csp);
-int DS_VideoDecoder_SetDestFmt(int bits, int csp);
-
-int DS_SetValue_DivX(char* name, int value);
+int DS_VideoDecoder_SetValue(void* _handle, char* name, int value);
int DS_SetAttr_DivX(char* attribute, int value);
#ifdef __cplusplus
Index: DS_AudioDec.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/loader/DirectShow/DS_AudioDec.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DS_AudioDec.cpp 4 Oct 2001 11:56:12 -0000 1.7
+++ DS_AudioDec.cpp 10 Dec 2001 20:10:53 -0000 1.8
@@ -25,9 +25,7 @@
// virtual int Convert(const void*, size_t, void*, size_t, size_t*, size_t*);
// virtual int GetSrcSize(int);
-static void* _handle;
-
-extern "C" int DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf){
+extern "C" void* DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf){
Setup_LDT_Keeper();
Setup_FS_Segment();
@@ -37,20 +35,20 @@
ci.guid=*guid;
DS_AudioDecoder* dec=new DS_AudioDecoder(ci, wf);
- _handle=(void*)dec;
- return 0;
+ return (void*)dec;
}
-extern "C" void DS_AudioDecoder_Close(){
+extern "C" void DS_AudioDecoder_Close(void* _handle){
}
-extern "C" int DS_AudioDecoder_GetSrcSize(int dest_size){
+extern "C" int DS_AudioDecoder_GetSrcSize(void* _handle, int dest_size){
DS_AudioDecoder* dec=(DS_AudioDecoder*)_handle;
return dec->GetSrcSize(dest_size);
}
-extern "C" int DS_AudioDecoder_Convert(unsigned char* in_data, unsigned in_size,
+extern "C" int DS_AudioDecoder_Convert(void* _handle,
+ unsigned char* in_data, unsigned in_size,
unsigned char* out_data, unsigned out_size,
unsigned* size_read, unsigned* size_written){
DS_AudioDecoder* dec=(DS_AudioDecoder*)_handle;
Index: DS_AudioDec.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/DirectShow/DS_AudioDec.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DS_AudioDec.h 22 Mar 2001 01:55:53 -0000 1.1
+++ DS_AudioDec.h 10 Dec 2001 20:10:53 -0000 1.2
@@ -10,14 +10,15 @@
extern "C" {
#endif /* defined(__cplusplus) */
-int DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf);
+void* DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf);
-void DS_AudioDecoder_Close();
+void DS_AudioDecoder_Close(void* _handle);
-int DS_AudioDecoder_GetSrcSize(int dest_size);
+int DS_AudioDecoder_GetSrcSize(void* _handle, int dest_size);
-int DS_AudioDecoder_Convert(unsigned char* in_data, unsigned in_size,
- unsigned char* out_data, unsigned out_size,
+int DS_AudioDecoder_Convert(void* _handle,
+ unsigned char* in_data, unsigned in_size,
+ unsigned char* out_data, unsigned out_size,
unsigned* size_read, unsigned* size_written);
#ifdef __cplusplus
More information about the MPlayer-cvslog
mailing list