FilterContext FilterGraph::createFilter(const Filter &filter, const string &filterName, const string &filterArgs, error_code &ec) { clear_if(ec); if (!m_raw || filter.isNull()) { throws_if(ec, Errors::Unallocated); return FilterContext(); } AVFilterContext *ctx = nullptr; int stat = avfilter_graph_create_filter(&ctx, filter.raw(), filterName.c_str(), filterArgs.empty() ? nullptr : filterArgs.c_str(), this, m_raw); if (stat < 0) { throws_if(ec, stat, ffmpeg_category()); return FilterContext(); } return FilterContext(ctx); }