ff_video_data_impl::ff_video_data_impl(AVFramePtr _AVFrame, int _Width, int _Height, dt_pixel_format_t _PixelFormat): m_AVFrame(_AVFrame), m_Width(_Width), m_Height(_Height), m_PixelFormat(_PixelFormat), m_PlanesCount(4) { m_DataSize = avpicture_get_size(DT2FFType(_PixelFormat), _Width, _Height); }
swscale_picture_convert_impl::swscale_picture_convert_impl(int inWidth, int inHeight, dt_pixel_format_t inPixFmt, int outWidth, int outHeight, dt_pixel_format_t outPixFmt, int _Flags) : outputWidth_(outWidth), outputHeight_(outHeight), outputPixelFormat_(DT2FFType(outPixFmt)), inputWidth_ (inWidth), inputHeight_(inHeight), inputPixelFormat_(DT2FFType(inPixFmt)), swsContext_ ( sws_getContext (inWidth, inHeight, DT2FFType(inPixFmt), outWidth, outHeight, DT2FFType(outPixFmt), _Flags, NULL, NULL, NULL), &sws_freeContext), outputFrame_( dt_create_picture(outPixFmt, outWidth, outHeight) ) { if (!swsContext_) { BOOST_THROW_EXCEPTION( picture_convert::error() << boost::errinfo_api_function("sws_getContext") ); } }