[pulseaudio-discuss] sink-input.c: pa_sink_input_new vs PA_CORE_HOOK_SINK_INPUT_FIXATE

Lennart Poettering lennart at poettering.net
Sun Jun 8 15:58:28 PDT 2008


On Fri, 16.05.08 09:58, Nick Thompson (rextanka at comcast.net) wrote:

Sorry for the late response!

> I'm writing a module to tag streams so that a routing policy can be  
> implemented.  Tanu suggested a mechanism by which I can get called  
> back each time a new sink-input comes in and this mechanism works,  
> however I'm having an issue trying to access the index for the stream.
> 
> The index is not assigned until the end of pa_sink_input_new where the  
> data passed in has been verified.  Long after FIXATE.  Here's a bit of  
> background.
> 
> There are two hooks in pa_sink_input_new (which is implemented in sink- 
> input.c):
> 
> PA_CORE_HOOK_SINK_INPUT_NEW
> PA_CORE_HOOK_SINK_INPUT_FIXATE

You are aware of PA_CORE_HOOK_SINK_INPUT_PUT? It's called when the
sink input is actually made available to the PA system, i.e. after
creation and after the code implementing the sink input actaully
filled in all method pointers.

> 
> Would moving FIXATE towards the end of the routine be appropriate (I  
> suspect that moving it could have undesirable side effects if external  
> hook functions in people's modules  were relying on returning anything  
> other than PA_HOOK_OK, or in further manipulating data.  However  
> manipulating the data after it's been verified is a potentially risky  
> move).

No. FIXATE is there to do fixation of the sink input parameters. What
you really want is the _PUT hook, as far as I understood your problem.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list