本文整理汇总了C++中pa_source_output_assert_ref函数的典型用法代码示例。如果您正苦于以下问题:C++ pa_source_output_assert_ref函数的具体用法?C++ pa_source_output_assert_ref怎么用?C++ pa_source_output_assert_ref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pa_source_output_assert_ref函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: source_output_put_cb
static pa_hook_result_t source_output_put_cb(pa_core *core, pa_source_output *i, struct userdata *u) {
pa_core_assert_ref(core);
pa_source_output_assert_ref(i);
pa_assert(u);
return process(u, PA_OBJECT(i), FALSE);
}
开发者ID:KOLIA112,项目名称:pulseaudio,代码行数:7,代码来源:module-filter-heuristics.c
示例2: pa_source_output_kill
/* Called from main context */
void pa_source_output_kill(pa_source_output*o) {
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
o->kill(o);
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:8,代码来源:source-output.c
示例3: source_output_push_cb
/* Called from input thread context */
static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk) {
struct userdata *u;
pa_memchunk copy;
pa_source_output_assert_ref(o);
pa_source_output_assert_io_context(o);
pa_assert_se(u = o->userdata);
if (u->skip > chunk->length) {
u->skip -= chunk->length;
return;
}
if (u->skip > 0) {
copy = *chunk;
copy.index += u->skip;
copy.length -= u->skip;
u->skip = 0;
chunk = ©
}
pa_asyncmsgq_post(u->asyncmsgq, PA_MSGOBJECT(u->sink_input), SINK_INPUT_MESSAGE_POST, NULL, 0, chunk, NULL);
u->send_counter += (int64_t) chunk->length;
}
开发者ID:freedesktop-unofficial-mirror,项目名称:pulseaudio__pulseaudio.git.backup,代码行数:26,代码来源:module-loopback.c
示例4: pa_source_output_set_requested_latency
/* Called from main context */
pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t usec) {
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
if (PA_SOURCE_OUTPUT_IS_LINKED(o->state) && o->source) {
pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o), PA_SOURCE_OUTPUT_MESSAGE_SET_REQUESTED_LATENCY, &usec, 0, NULL) == 0);
return usec;
}
/* If this source output is not realized yet or is being moved, we
* have to touch the thread info data directly */
if (o->source) {
if (!(o->source->flags & PA_SOURCE_DYNAMIC_LATENCY))
usec = pa_source_get_fixed_latency(o->source);
if (usec != (pa_usec_t) -1) {
pa_usec_t min_latency, max_latency;
pa_source_get_latency_range(o->source, &min_latency, &max_latency);
usec = PA_CLAMP(usec, min_latency, max_latency);
}
}
o->thread_info.requested_source_latency = usec;
return usec;
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:28,代码来源:source-output.c
示例5: source_output_moving_cb
/* Called from main thread */
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
pa_proplist *p;
const char *n;
struct userdata *u;
if (!dest)
return;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert_se(u = o->userdata);
p = pa_proplist_new();
pa_proplist_setf(p, PA_PROP_MEDIA_NAME, "Loopback of %s", pa_strnull(pa_proplist_gets(dest->proplist, PA_PROP_DEVICE_DESCRIPTION)));
if ((n = pa_proplist_gets(dest->proplist, PA_PROP_DEVICE_ICON_NAME)))
pa_proplist_sets(p, PA_PROP_MEDIA_ICON_NAME, n);
pa_sink_input_update_proplist(u->sink_input, PA_UPDATE_REPLACE, p);
pa_proplist_free(p);
if (pa_source_get_state(dest) == PA_SOURCE_SUSPENDED)
pa_sink_input_cork(u->sink_input, true);
else
pa_sink_input_cork(u->sink_input, false);
update_adjust_timer(u);
}
开发者ID:xedp3x,项目名称:pulseaudio,代码行数:29,代码来源:module-loopback.c
示例6: source_output_moving_cb
/* Called from main thread */
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
struct userdata *u;
char *input_description;
const char *n;
if (!dest)
return;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert_se(u = o->userdata);
input_description = pa_sprintf_malloc("Loopback of %s",
pa_strnull(pa_proplist_gets(dest->proplist, PA_PROP_DEVICE_DESCRIPTION)));
pa_sink_input_set_property(u->sink_input, PA_PROP_MEDIA_NAME, input_description);
pa_xfree(input_description);
if ((n = pa_proplist_gets(dest->proplist, PA_PROP_DEVICE_ICON_NAME)))
pa_sink_input_set_property(u->sink_input, PA_PROP_DEVICE_ICON_NAME, n);
if (pa_source_get_state(dest) == PA_SOURCE_SUSPENDED)
pa_sink_input_cork(u->sink_input, true);
else
pa_sink_input_cork(u->sink_input, false);
update_adjust_timer(u);
}
开发者ID:ford-prefect,项目名称:pulseaudio,代码行数:28,代码来源:module-loopback.c
示例7: pa_source_output_send_event
/* Called from main context */
void pa_source_output_send_event(pa_source_output *o, const char *event, pa_proplist *data) {
pa_proplist *pl = NULL;
pa_source_output_send_event_hook_data hook_data;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert(event);
if (!o->send_event)
return;
if (!data)
data = pl = pa_proplist_new();
hook_data.source_output = o;
hook_data.data = data;
hook_data.event = event;
if (pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_SEND_EVENT], &hook_data) < 0)
goto finish;
o->send_event(o, event, data);
finish:
if (pl)
pa_proplist_free(pl);
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:28,代码来源:source-output.c
示例8: pa_source_output_move_to
/* Called from main context */
int pa_source_output_move_to(pa_source_output *o, pa_source *dest, pa_bool_t save) {
int r;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
pa_assert(o->source);
pa_source_assert_ref(dest);
if (dest == o->source)
return 0;
if (!pa_source_output_may_move_to(o, dest))
return -PA_ERR_NOTSUPPORTED;
pa_source_output_ref(o);
if ((r = pa_source_output_start_move(o)) < 0) {
pa_source_output_unref(o);
return r;
}
if ((r = pa_source_output_finish_move(o, dest, save)) < 0) {
pa_source_output_fail_move(o);
pa_source_output_unref(o);
return r;
}
pa_source_output_unref(o);
return 0;
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:33,代码来源:source-output.c
示例9: pa_source_output_start_move
/* Called from main context */
int pa_source_output_start_move(pa_source_output *o) {
pa_source *origin;
int r;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
pa_assert(o->source);
if (!pa_source_output_may_move(o))
return -PA_ERR_NOTSUPPORTED;
if ((r = pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_MOVE_START], o)) < 0)
return r;
origin = o->source;
pa_idxset_remove_by_data(o->source->outputs, o, NULL);
if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED)
pa_assert_se(origin->n_corked-- >= 1);
pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_REMOVE_OUTPUT, o, 0, NULL) == 0);
pa_source_update_status(o->source);
o->source = NULL;
pa_source_output_unref(o);
return 0;
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:32,代码来源:source-output.c
示例10: pa_source_output_cork
/* Called from main context */
void pa_source_output_cork(pa_source_output *o, pa_bool_t b) {
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
source_output_set_state(o, b ? PA_SOURCE_OUTPUT_CORKED : PA_SOURCE_OUTPUT_RUNNING);
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:8,代码来源:source-output.c
示例11: pa_source_output_process_rewind
/* Called from thread context */
void pa_source_output_process_rewind(pa_source_output *o, size_t nbytes /* in source sample spec */) {
pa_source_output_assert_ref(o);
pa_source_output_assert_io_context(o);
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->thread_info.state));
pa_assert(pa_frame_aligned(nbytes, &o->source->sample_spec));
if (nbytes <= 0)
return;
if (o->process_rewind) {
pa_assert(pa_memblockq_get_length(o->thread_info.delay_memblockq) == 0);
if (o->thread_info.resampler)
nbytes = pa_resampler_result(o->thread_info.resampler, nbytes);
pa_log_debug("Have to rewind %lu bytes on implementor.", (unsigned long) nbytes);
if (nbytes > 0)
o->process_rewind(o, nbytes);
if (o->thread_info.resampler)
pa_resampler_reset(o->thread_info.resampler);
} else
pa_memblockq_rewind(o->thread_info.delay_memblockq, nbytes);
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:28,代码来源:source-output.c
示例12: source_output_moving_cb
/* Called from main thread */
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert_se(u = o->userdata);
if (dest) {
pa_source_set_asyncmsgq(u->source, dest->asyncmsgq);
pa_source_update_flags(u->source, PA_SOURCE_LATENCY|PA_SOURCE_DYNAMIC_LATENCY, dest->flags);
} else
pa_source_set_asyncmsgq(u->source, NULL);
if (u->auto_desc && dest) {
const char *k;
pa_proplist *pl;
pl = pa_proplist_new();
k = pa_proplist_gets(dest->proplist, PA_PROP_DEVICE_DESCRIPTION);
pa_proplist_setf(pl, PA_PROP_DEVICE_DESCRIPTION, "Remapped %s", k ? k : dest->name);
pa_source_update_proplist(u->source, PA_UPDATE_REPLACE, pl);
pa_proplist_free(pl);
}
}
开发者ID:DryakhlyyZlodey,项目名称:pulseaudio,代码行数:26,代码来源:module-remap-source.c
示例13: cmtspeech_source_output_state_change_cb
/* Called from I/O thread context */
static void cmtspeech_source_output_state_change_cb(pa_source_output *o, pa_source_output_state_t state) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_assert_se(u = o->userdata);
pa_log_debug("State changed %d -> %d", o->thread_info.state, state);
}
开发者ID:tanuk2,项目名称:pulseaudio-modules-nemo,代码行数:9,代码来源:cmtspeech-source-output.c
示例14: source_output_get_latency_cb
/* Called from main context */
static pa_usec_t source_output_get_latency_cb(pa_source_output *o) {
connection*c;
pa_source_output_assert_ref(o);
c = CONNECTION(o->userdata);
pa_assert(c);
return pa_bytes_to_usec(pa_memblockq_get_length(c->output_memblockq), &c->source_output->sample_spec);
}
开发者ID:DryakhlyyZlodey,项目名称:pulseaudio,代码行数:10,代码来源:protocol-simple.c
示例15: source_output_may_move_to_cb
/* Called from main thread */
static pa_bool_t source_output_may_move_to_cb(pa_source_output *o, pa_source *dest) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert_se(u = o->userdata);
return dest != u->sink_input->sink->monitor_source;
}
开发者ID:KimT,项目名称:pulseaudio_kt,代码行数:10,代码来源:module-loopback.c
示例16: pa_source_output_update_max_rewind
/* Called from thread context */
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_source_output_assert_io_context(o);
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->thread_info.state));
pa_assert(pa_frame_aligned(nbytes, &o->source->sample_spec));
if (o->update_max_rewind)
o->update_max_rewind(o, o->thread_info.resampler ? pa_resampler_result(o->thread_info.resampler, nbytes) : nbytes);
}
开发者ID:felfert,项目名称:pulseaudio,代码行数:10,代码来源:source-output.c
示例17: source_output_process_rewind_cb
/* Called from output thread context */
static void source_output_process_rewind_cb(pa_source_output *o, size_t nbytes) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_source_output_assert_io_context(o);
pa_assert_se(u = o->userdata);
pa_source_process_rewind(u->source, nbytes);
}
开发者ID:DryakhlyyZlodey,项目名称:pulseaudio,代码行数:10,代码来源:module-remap-source.c
示例18: source_output_state_change_cb
/* Called from output thread context */
static void source_output_state_change_cb(pa_source_output *o, pa_source_output_state_t state) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_source_output_assert_io_context(o);
pa_assert_se(u = o->userdata);
pa_log_debug("Source output %d state %d.", o->index, state);
}
开发者ID:DryakhlyyZlodey,项目名称:pulseaudio,代码行数:10,代码来源:module-remap-source.c
示例19: source_output_kill_cb
/* Called from main thread */
static void source_output_kill_cb(pa_source_output *o) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert_se(u = o->userdata);
teardown(u);
pa_module_unload_request(u->module, TRUE);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:pulseaudio__pulseaudio.git.backup,代码行数:11,代码来源:module-loopback.c
示例20: source_output_push_cb
/* Called from thread context */
static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk) {
connection *c;
pa_source_output_assert_ref(o);
c = CONNECTION(o->userdata);
pa_assert(c);
pa_assert(chunk);
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(c), CONNECTION_MESSAGE_POST_DATA, NULL, 0, chunk, NULL);
}
开发者ID:DryakhlyyZlodey,项目名称:pulseaudio,代码行数:11,代码来源:protocol-simple.c
注:本文中的pa_source_output_assert_ref函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论