[pulseaudio-discuss] understanding PA cork/uncorking scenarios
Himanshu Chug
himanshu.chug at gmail.com
Thu Jun 16 00:24:40 PDT 2011
Hi
I am trying to understand how the corking/uncorking events reach from PA
module to PA applications/clients e.g gst-launch
Say, we are corking the playback stream in module-cork-music-on-phone by
calling :
apply_cork(struct userdata *u, pa_sink *s, pa_sink_input *ignore, pa_bool_t
cork)
pa_sink_input_send_event(ignore, PA_STREAM_EVENT_REQUEST_CORK, NULL);
(in sink-input.c)
(pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_SEND_EVENT],
&hook_data) (function then fire an hook)
sink_input_send_event_hook_cb( pa_core *c,
pa_sink_input_send_event_hook_data *data, struct userdata *u) ( in
module-x11-cork-request, passing *data that contains cork event)
now inside sink_input_send_event_hook_cb( ) ( in module-x11-cork-request )
there is an if-else check
if (pa_streq(data->event, PA_STREAM_EVENT_REQUEST_CORK))
sym = XF86XK_AudioPause;
else if (pa_streq(data->event, PA_STREAM_EVENT_REQUEST_UNCORK))
sym = XF86XK_AudioPlay;
else
return PA_HOOK_OK;
further the same function is calling
XTestFakeKeyEvent(display, code, True, CurrentTime);
XSync(display, False);
But it is not clear to me how the Cork/Uncork events then reach to PA client
(say pulsesink or Gst-launch) and then where gst listens to these events and
pause / resume gst pipeline accordingly ?
Is pulsesink involved here somehow ? I can see
gst_pulsering_stream_event_cb( ) function (inside pulsesink.c) handling
PA_STREAM_EVENT_REQUEST_CORK but currently it is under #ifdef
HAVE_PULSE_0_9_15 flag and disabled.
Thanks in advance,
Best Regards,
Himanshu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20110616/59ec89a1/attachment.htm>
More information about the pulseaudio-discuss
mailing list