aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-16 18:27:03 +0000
committerGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-16 18:27:03 +0000
commite3663040558f9e2999f210f496ed9d010579c1d8 (patch)
tree7ead217f476c37aab53b5d674977555af7259b8c /loader
parent970f3c2f478ffd822674af1746b2abf2f044bb7c (diff)
error handling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1559 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/dshow/libwin32.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/loader/dshow/libwin32.h b/loader/dshow/libwin32.h
index 26a3fbc792..592fe9d454 100644
--- a/loader/dshow/libwin32.h
+++ b/loader/dshow/libwin32.h
@@ -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 <wine/mmreg.h>
#include <wine/winreg.h>
#include <wine/vfw.h>
#include <com.h>
+#include <stdarg.h>
#include <string>
+#include <stdio.h>
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 @@ struct IVideoDecoder
}
virtual ~IVideoDecoder(){};
- virtual void StartInternal()=0;
- virtual void StopInternal()=0;
+ // 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;
const CodecInfo& record;
DecodingMode m_Mode; // should we do precaching (or even change Quality on the fly)