<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I think I'm passing all the right parameters to avfilter_graph_create_filter, but I still get a return value of -22, which seems to indicate a parameter problem. I'm missing some detail here….<div><br></div><div>Can anyone tell me what's wrong with the call to avfilter_graph_create_filter in the function below? Thanks.</div><div><br></div><div>int filtersetup(){</div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span style="color: #006141"><span class="Apple-tab-span" style="white-space:pre"> </span>AVFilterContext</span> *in_filter_ctx;</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span style="color: #006141"><span class="Apple-tab-span" style="white-space:pre"> </span>AVFilterContext</span> *out_filter_ctx;</div></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><div style="margin: 0px; color: rgb(0, 97, 65); "><span class="Apple-tab-span" style="white-space:pre"> </span>AVFilterGraph<span style="color: #000000"> *graph;</span></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #006141">AVFilter</span> *input_filter, *output_filter;</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #931a68">char</span> *sample_fmts, *sample_rates, *channel_layouts;</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #006141">AVFilterInOut</span> *outputs, *inputs;</div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #931a68">char</span> args[256];</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #931a68">int</span> ret;</div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>outputs = avfilter_inout_alloc();</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>inputs = avfilter_inout_alloc();</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>graph = avfilter_graph_alloc();</div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>input_filter = avfilter_get_by_name(<span style="color: #3933ff">"</span><span style="text-decoration: underline ; color: #3933ff">abuffer</span><span style="color: #3933ff">"</span>);</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>output_filter = avfilter_get_by_name(<span style="color: #3933ff">"</span><span style="text-decoration: underline ; color: #3933ff">abuffersink</span><span style="color: #3933ff">"</span>);</div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>__android_log_print(ANDROID_LOG_INFO, <span style="color: #3933ff">"aphex_dsp"</span>,</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #3933ff">"</span><span style="text-decoration: underline ; color: #3933ff">alloc</span><span style="color: #3933ff">"</span>);</div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>ret = avfilter_graph_create_filter(&in_filter_ctx,</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>input_filter, <span style="color: #3933ff">"</span><span style="text-decoration: underline ; color: #3933ff">src</span><span style="color: #3933ff">"</span>, args, NULL, graph);</div><div style="margin: 0px; min-height: 15px; "><br></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #931a68">if</span> (ret < 0) {</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>// ret = -22</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>__android_log_print(ANDROID_LOG_ERROR, <span style="color: #3933ff">"aphex_dsp"</span>,</div><div style="margin: 0px; color: rgb(57, 51, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span></span>"unable to create input filter: %d"<span style="color: #000000">, ret);</span></div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #931a68">return</span> ret;</div><div style="margin: 0px; "><span class="Apple-tab-span" style="white-space:pre"> </span>}</div></div></div><div>}</div></body></html>