#include <cstring>
#include <boost/exception/all.hpp>
#include <boost/thread.hpp>
+extern "C" {
+#include <libavutil/pixfmt.h>
+}
#include "compose.hpp"
/** @class StringError
{}
};
+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:
mutable boost::mutex _mutex;
};
+
+
#endif
case PIX_FMT_YUV422P:
return size().height;
default:
- assert (false);
+ throw PixelFormatError ("lines()", _pixel_format);
}
return 0;
case PIX_FMT_RGBA:
return 1;
default:
- assert (false);
+ throw PixelFormatError ("components()", _pixel_format);
}
return 0;
pp_format = PP_FORMAT_422;
break;
default:
- assert (false);
+ throw PixelFormatError ("post_process", pixel_format());
}
pp_mode* mode = pp_get_mode_by_name_and_quality (pp.c_str (), PP_QUALITY_MAX);