hi, everyone<br><br>I have some thoughts of the lua audio-filter design, and I need some discussion with someone more familiar with the function interface.<br><br clear="all">like I have pass the filter to the functions: Then the parameters like the "aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf", should be passed by what method ?<br>
<br>The key question is how the parameters should be passed and where to alloc the memory.<br>Thanks! <br><br><br><b>static int vlclua_aout_filter_resample( lua_State * L )<br>{<br> vlc_object_t *p_this = vlclua_get_auout_filter_internal( L );<br>
/******* Enable the filters ********/<br> aout_EnableFilter( VLC_OBJECT(p_this), "resampler",true);<br> <br> p_this->pf_do_work( aout_instance_t * p_aout, aout_filter_t * p_filter,<br> aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf );<br>
<br> <br> <br> return 0;<br>}<br><br><br>static int vlclua_aout_filter_channel_mixer( lua_State * L )<br>{<br> vlc_object_t *p_this = vlclua_get_auout_filter_internal( L );<br> /******* Enable the filters ********/<br>
aout_EnableFilter( VLC_OBJECT(p_this), "channel_mixer",true);<br> <br><br><br><br><br> return 0;<br>}<br><br><br><br>static int vlclua_aout_filter_converter( lua_State * L )<br>{<br> vlc_object_t *p_this = vlclua_get_auout_filter_internal( L );<br>
/******* Enable the filters ********/<br> aout_EnableFilter( VLC_OBJECT(p_this), "converter",true);<br><br><br><br><br><br> return 0;<br>}</b><br><br>-- <br>Xiang Wang<br>Institue Of Acoustics, CAS<br>
<br>