[pulseaudio-discuss] Few questions about PA API

Lukasz M lukasz.m.luki at gmail.com
Mon Apr 14 05:35:11 PDT 2014


On 14 April 2014 09:42, Tanu Kaskinen <tanu.kaskinen at linux.intel.com> wrote:

> On Mon, 2014-04-14 at 01:16 +0200, Lukasz Marek wrote:
> > Hi,
> >
> > I hope this is correct list for general questions about PulseAudio
> > development. I devel some stuff for FFmpeg project and I want to update
> > pulse output device. I have few questions:
> >
> > - Is this possible to detect that mute/volume for sink input has changed
> > without calling pa_context_get_sink_input_info periodically?
> > I saw some commits recently that seems to add this, but ubuntu still use
> > 4.0 for example, so probably not, but I still wanted to ask about it.
>
> You can get notifications about sink input changes with the subscription
> API: http://freedesktop.org/software/pulseaudio/doxygen/subscribe.html
>
> The API will tell you only that something changed (not necessarily
> volume/mute), so when you get a change event for a sink input that you
> are interested in, you then call pa_context_get_sink_input_info().


Looks like something I needed. Thanks.



>  > - pa_stream_write has parameter pa_free_cb_t to provide zero-copy.
> > Unfortunately it doesn't accept user data, in case of FFmpeg, the buffer
> > is inside AVBuffer, AVPacket, or AVFrame (AVBuffer technically).
> > Each of them contains a variable with a buffer that should be passed to
> > pa_stream_write, but free function should unref this structure, not
> > buffer itself.
> > It cannot be extracted without copying and this zero-copy is hard to
> reach.
> > My question is: do you think it is doable/acceptable to add other
> > function that would accept userdata for free callback?
> > I know there is pa_stream_begin_write, but this is not suitable neither.
>
> Yes, I think that would be acceptable. I wonder what would be a good
> name for the function. pa_stream_write_with_free_userdata?
>

Maybe:

typedef void (*pa_free_ext_cb_t)(void *p, void *userdata);

pa_stream_write_with_free_ext(...)

I'll try to prepare a patch soon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20140414/61546c4d/attachment.html>


More information about the pulseaudio-discuss mailing list