return 0;
}
-static void sink_input_rewind_cb(pa_sink_input *i, size_t nbytes) {
+static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
memblockq_stream *u;
pa_sink_input_assert_ref(i);
pa_memblockq_rewind(u->memblockq, nbytes);
}
-static void sink_input_set_max_rewind(pa_sink_input *i, size_t nbytes) {
+static void sink_input_update_max_rewind(pa_sink_input *i, size_t nbytes) {
memblockq_stream *u;
pa_sink_input_assert_ref(i);
goto fail;
u->sink_input->pop = sink_input_pop_cb;
- u->sink_input->rewind = sink_input_rewind_cb;
- u->sink_input->set_max_rewind = sink_input_set_max_rewind;
+ u->sink_input->process_rewind = sink_input_process_rewind_cb;
+ u->sink_input->update_max_rewind = sink_input_update_max_rewind;
u->sink_input->kill = sink_input_kill_cb;
u->sink_input->userdata = u;
static void sink_input_kill_cb(pa_sink_input *i);
static void sink_input_suspend_cb(pa_sink_input *i, pa_bool_t suspend);
static void sink_input_moved_cb(pa_sink_input *i);
-static void sink_input_rewind_cb(pa_sink_input *i, size_t nbytes);
-static void sink_input_set_max_rewind_cb(pa_sink_input *i, size_t nbytes);
+static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes);
+static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes);
static void send_memblock(connection *c);
s->sink_input->parent.process_msg = sink_input_process_msg;
s->sink_input->pop = sink_input_pop_cb;
- s->sink_input->rewind = sink_input_rewind_cb;
- s->sink_input->set_max_rewind = sink_input_set_max_rewind_cb;
+ s->sink_input->process_rewind = sink_input_process_rewind_cb;
+ s->sink_input->update_max_rewind = sink_input_update_max_rewind_cb;
s->sink_input->kill = sink_input_kill_cb;
s->sink_input->moved = sink_input_moved_cb;
s->sink_input->suspend = sink_input_suspend_cb;
return 0;
}
-static void sink_input_rewind_cb(pa_sink_input *i, size_t nbytes) {
+static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
playback_stream *s;
pa_sink_input_assert_ref(i);
pa_memblockq_rewind(s->memblockq, nbytes);
}
-static void sink_input_set_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
+static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
playback_stream *s;
pa_sink_input_assert_ref(i);
pa_assert(i);
i->pop = NULL;
- i->rewind = NULL;
- i->set_max_rewind = NULL;
+ i->process_rewind = NULL;
+ i->update_max_rewind = NULL;
i->attach = NULL;
i->detach = NULL;
i->suspend = NULL;
pa_assert(i->state == PA_SINK_INPUT_INIT);
pa_assert(i->pop);
- pa_assert(i->rewind);
+ pa_assert(i->process_rewind);
i->thread_info.volume = i->volume;
i->thread_info.muted = i->muted;
pa_log_debug("Have to rewind %lu bytes on implementor.", (unsigned long) amount);
/* Tell the implementor */
- if (i->rewind)
- i->rewind(i, amount);
+ if (i->process_rewind)
+ i->process_rewind(i, amount);
}
/* And reset the resampler */
}
/* Called from thread context */
-void pa_sink_input_set_max_rewind(pa_sink_input *i, size_t nbytes /* in the sink's sample spec */) {
+void pa_sink_input_update_max_rewind(pa_sink_input *i, size_t nbytes /* in the sink's sample spec */) {
pa_sink_input_assert_ref(i);
pa_assert(PA_SINK_INPUT_LINKED(i->thread_info.state));
pa_assert(pa_frame_aligned(nbytes, &i->sink->sample_spec));
pa_memblockq_set_maxrewind(i->thread_info.render_memblockq, nbytes);
- if (i->set_max_rewind)
- i->set_max_rewind(i, i->thread_info.resampler ? pa_resampler_request(i->thread_info.resampler, nbytes) : nbytes);
+ if (i->update_max_rewind)
+ i->update_max_rewind(i, i->thread_info.resampler ? pa_resampler_request(i->thread_info.resampler, nbytes) : nbytes);
}
pa_usec_t pa_sink_input_set_requested_latency(pa_sink_input *i, pa_usec_t usec) {
* before peek() if it is called at all. Only called if the sink
* input driver ever plans to call
* pa_sink_input_request_rewind(). Called from IO context. */
- void (*rewind) (pa_sink_input *i, size_t nbytes); /* may NOT be NULL */
+ void (*process_rewind) (pa_sink_input *i, size_t nbytes); /* may NOT be NULL */
/* Called whenever the maximum rewindable size of the sink
* changes. Called from RT context. */
- void (*set_max_rewind) (pa_sink_input *i, size_t nbytes); /* may be NULL */
+ void (*update_max_rewind) (pa_sink_input *i, size_t nbytes); /* may be NULL */
/* If non-NULL this function is called when the input is first
* connected to a sink or when the rtpoll/asyncmsgq fields
int pa_sink_input_peek(pa_sink_input *i, size_t length, pa_memchunk *chunk, pa_cvolume *volume);
void pa_sink_input_drop(pa_sink_input *i, size_t length);
void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in the sink's sample spec */);
-void pa_sink_input_set_max_rewind(pa_sink_input *i, size_t nbytes /* in the sink's sample spec */);
+void pa_sink_input_update_max_rewind(pa_sink_input *i, size_t nbytes /* in the sink's sample spec */);
int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offset, pa_memchunk *chunk);
i->thread_info.sync_next->thread_info.sync_prev = i;
}
- pa_sink_input_set_max_rewind(i, s->thread_info.max_rewind);
+ pa_sink_input_update_max_rewind(i, s->thread_info.max_rewind);
pa_assert(!i->thread_info.attached);
i->thread_info.attached = TRUE;
pa_hashmap_put(s->thread_info.inputs, PA_UINT32_TO_PTR(info->ghost_sink_input->index), pa_sink_input_ref(info->ghost_sink_input));
info->ghost_sink_input->thread_info.sync_prev = info->ghost_sink_input->thread_info.sync_next = NULL;
- pa_sink_input_set_max_rewind(info->ghost_sink_input, s->thread_info.max_rewind);
+ pa_sink_input_update_max_rewind(info->ghost_sink_input, s->thread_info.max_rewind);
pa_assert(!info->ghost_sink_input->thread_info.attached);
info->ghost_sink_input->thread_info.attached = TRUE;
s->thread_info.max_rewind = max_rewind;
while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL)))
- pa_sink_input_set_max_rewind(i, s->thread_info.max_rewind);
+ pa_sink_input_update_max_rewind(i, s->thread_info.max_rewind);
if (s->monitor_source)
pa_source_set_max_rewind(s->monitor_source, s->thread_info.max_rewind);
return -1;
}
-static void sink_input_rewind_cb(pa_sink_input *i, size_t nbytes) {
+static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
file_stream *u;
pa_sink_input_assert_ref(i);
pa_memblockq_rewind(u->memblockq, nbytes);
}
-static void sink_input_set_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
+static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
file_stream *u;
pa_sink_input_assert_ref(i);
goto fail;
u->sink_input->pop = sink_input_pop_cb;
- u->sink_input->rewind = sink_input_rewind_cb;
- u->sink_input->set_max_rewind = sink_input_set_max_rewind_cb;
+ u->sink_input->process_rewind = sink_input_process_rewind_cb;
+ u->sink_input->update_max_rewind = sink_input_update_max_rewind_cb;
u->sink_input->kill = sink_input_kill_cb;
u->sink_input->userdata = u;
pa_assert(o);
o->push = NULL;
- o->rewind = NULL;
- o->set_max_rewind = NULL;
+ o->process_rewind = NULL;
+ o->update_max_rewind = NULL;
o->attach = NULL;
o->detach = NULL;
o->suspend = NULL;
pa_memblockq_seek(o->thread_info.delay_memblockq, chunk->length, PA_SEEK_RELATIVE);
}
- limit = o->rewind ? 0 : o->source->thread_info.max_rewind;
+ limit = o->process_rewind ? 0 : o->source->thread_info.max_rewind;
/* Implement the delay queue */
while ((length = pa_memblockq_get_length(o->thread_info.delay_memblockq)) > limit) {
if (nbytes <= 0)
return;
- if (o->rewind) {
+ if (o->process_rewind) {
pa_assert(pa_memblockq_get_length(o->thread_info.delay_memblockq) == 0);
if (o->thread_info.resampler)
pa_log_debug("Have to rewind %lu bytes on implementor.", (unsigned long) nbytes);
if (nbytes > 0)
- o->rewind(o, nbytes);
+ o->process_rewind(o, nbytes);
if (o->thread_info.resampler)
pa_resampler_reset(o->thread_info.resampler);
}
/* Called from thread context */
-void pa_source_output_set_max_rewind(pa_source_output *o, size_t nbytes /* in the source's sample spec */) {
+void pa_source_output_update_max_rewind(pa_source_output *o, size_t nbytes /* in the source's sample spec */) {
pa_source_output_assert_ref(o);
pa_assert(PA_SOURCE_OUTPUT_LINKED(o->thread_info.state));
pa_assert(pa_frame_aligned(nbytes, &o->source->sample_spec));
- if (o->set_max_rewind)
- o->set_max_rewind(o, o->thread_info.resampler ? pa_resampler_result(o->thread_info.resampler, nbytes) : nbytes);
+ if (o->update_max_rewind)
+ o->update_max_rewind(o, o->thread_info.resampler ? pa_resampler_result(o->thread_info.resampler, nbytes) : nbytes);
}
pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t usec) {
/* Only relevant for monitor sources right now: called when the
* recorded stream is rewound. */
- void (*rewind)(pa_source_output *o, size_t nbytes);
+ void (*process_rewind)(pa_source_output *o, size_t nbytes);
/* Called whenever the maximum rewindable size of the source
* changes. Called from RT context. */
- void (*set_max_rewind) (pa_source_output *o, size_t nbytes); /* may be NULL */
+ void (*update_max_rewind) (pa_source_output *o, size_t nbytes); /* may be NULL */
/* If non-NULL this function is called when the output is first
* connected to a source. Called from IO thread context */
void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk);
void pa_source_output_process_rewind(pa_source_output *o, size_t nbytes);
-void pa_source_output_set_max_rewind(pa_source_output *o, size_t nbytes);
+void pa_source_output_update_max_rewind(pa_source_output *o, size_t nbytes);
int pa_source_output_process_msg(pa_msgobject *mo, int code, void *userdata, int64_t offset, pa_memchunk *chunk);
pa_hashmap_put(s->thread_info.outputs, PA_UINT32_TO_PTR(o->index), pa_source_output_ref(o));
- pa_source_output_set_max_rewind(o, s->thread_info.max_rewind);
+ pa_source_output_update_max_rewind(o, s->thread_info.max_rewind);
pa_assert(!o->thread_info.attached);
o->thread_info.attached = TRUE;
s->thread_info.max_rewind = max_rewind;
while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL)))
- pa_source_output_set_max_rewind(o, s->thread_info.max_rewind);
+ pa_source_output_update_max_rewind(o, s->thread_info.max_rewind);
}
void pa_source_invalidate_requested_latency(pa_source *s) {