# HG changeset patch # User arpi # Date 997986423 0 # Node ID 261f5fd2c909ffa256aaeeae3d86fc54b73ca372 # Parent 97767a45c03d135a9230186d0e8940bbc4a5c8a8 error handling diff -r 97767a45c03d -r 261f5fd2c909 loader/dshow/libwin32.h --- a/loader/dshow/libwin32.h Thu Aug 16 16:43:22 2001 +0000 +++ b/loader/dshow/libwin32.h Thu Aug 16 18:27:03 2001 +0000 @@ -26,17 +26,28 @@ #else // code for mplayer team -#define FATAL(a) // you don't need exception - if you want - just fill more code +//#define FATAL(a) // you don't need exception - if you want - just fill more code +#define FATAL(X...) FatalError(__MODULE__,__FILE__,__LINE__,X) #include #include #include #include +#include #include +#include typedef unsigned int fourcc_t; + struct FatalError { - FatalError(); + FatalError(const char* mod, const char* f, int l, const char* desc,...) + { + printf("FATAL: module: %s source: %s line %d ", mod, f, l); + va_list va; + va_start(va, desc); + vprintf(desc, va); + va_end(va); + } void PrintAll() {} }; @@ -277,10 +288,15 @@ } virtual ~IVideoDecoder(){}; + // use this one + int Decode(void* src, size_t size, int is_keyframe, CImage* pImage) + { return DecodeInternal(src, size, is_keyframe, pImage); } + void Stop(){ StopInternal(); m_State = STOP;} + void Start(){StartInternal(); m_State = START;} + protected: + virtual int DecodeInternal(void* src, size_t size, int is_keyframe, CImage* pImage) = 0; virtual void StartInternal()=0; virtual void StopInternal()=0; - void Stop(){ StopInternal(); m_State = STOP;} - void Start(){StartInternal(); m_State = START;} const CodecInfo& record; DecodingMode m_Mode; // should we do precaching (or even change Quality on the fly)