From 2e5b4effbc5e7f7ac74cae541a05d3401c9170b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Feb 2013 21:35:44 +0000 Subject: Throw an exception rather than asserting when unable to handle a pixel format (#65). --- src/lib/exceptions.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib/exceptions.h') 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 #include #include +extern "C" { +#include +} #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 -- cgit v1.2.3