diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-02-23 21:36:08 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-02-23 21:36:08 +0000 |
| commit | c9b733ba0f05c011d6880ffe3aae2a87e292d106 (patch) | |
| tree | f897bc8ea37e16cc10be924aa411089145e8f673 /src/lib/exceptions.h | |
| parent | 5943bde6f1a29c84b3f79710535a41bb98f6ce7d (diff) | |
Throw an exception rather than asserting when unable to handle a pixel format (#65).
Diffstat (limited to 'src/lib/exceptions.h')
| -rw-r--r-- | src/lib/exceptions.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 6de8806e4..277355117 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -28,6 +28,9 @@ #include <cstring> #include <boost/exception/all.hpp> #include <boost/thread.hpp> +extern "C" { +#include <libavutil/pixfmt.h> +} #include "compose.hpp" /** @class StringError @@ -220,6 +223,14 @@ public: {} }; +class PixelFormatError : public StringError +{ +public: + PixelFormatError (std::string o, AVPixelFormat f) + : StringError (String::compose ("Cannot handle pixel format %1 during %2", f, o)) + {} +}; + class ExceptionStore { public: @@ -245,4 +256,6 @@ private: mutable boost::mutex _mutex; }; + + #endif |
