return pa_strbuf_to_string_free(s);
}
-static const char *sink_state_to_string(pa_sink_state_t state) {
- switch (state) {
- case PA_SINK_INIT:
- return "INIT";
- case PA_SINK_RUNNING:
- return "RUNNING";
- case PA_SINK_SUSPENDED:
- return "SUSPENDED";
- case PA_SINK_IDLE:
- return "IDLE";
- case PA_SINK_UNLINKED:
- return "UNLINKED";
- default:
- return "INVALID";
- }
-}
-
-static const char *source_state_to_string(pa_source_state_t state) {
- switch (state) {
- case PA_SOURCE_INIT:
- return "INIT";
- case PA_SOURCE_RUNNING:
- return "RUNNING";
- case PA_SOURCE_SUSPENDED:
- return "SUSPENDED";
- case PA_SOURCE_IDLE:
- return "IDLE";
- case PA_SOURCE_UNLINKED:
- return "UNLINKED";
- default:
- return "INVALID";
- }
-}
-
char *pa_sink_list_to_string(pa_core *c) {
pa_strbuf *s;
pa_sink *sink;
sink->flags & PA_SINK_LATENCY ? "LATENCY " : "",
sink->flags & PA_SINK_FLAT_VOLUME ? "FLAT_VOLUME " : "",
sink->flags & PA_SINK_DYNAMIC_LATENCY ? "DYNAMIC_LATENCY" : "",
- sink_state_to_string(pa_sink_get_state(sink)),
+ pa_sink_state_to_string(pa_sink_get_state(sink)),
sink->suspend_cause & PA_SUSPEND_USER ? "USER " : "",
sink->suspend_cause & PA_SUSPEND_APPLICATION ? "APPLICATION " : "",
sink->suspend_cause & PA_SUSPEND_IDLE ? "IDLE " : "",
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
source->flags & PA_SOURCE_LATENCY ? "LATENCY " : "",
source->flags & PA_SOURCE_DYNAMIC_LATENCY ? "DYNAMIC_LATENCY" : "",
- source_state_to_string(pa_source_get_state(source)),
+ pa_source_state_to_string(pa_source_get_state(source)),
source->suspend_cause & PA_SUSPEND_USER ? "USER " : "",
source->suspend_cause & PA_SUSPEND_APPLICATION ? "APPLICATION " : "",
source->suspend_cause & PA_SUSPEND_IDLE ? "IDLE " : "",
return ret;
}
+ pa_log_debug("%s: state: %s -> %s", s->name, pa_sink_state_to_string(s->state), pa_sink_state_to_string(state));
s->state = state;
#ifdef TIZEN_PCM_DUMP
/* close file for dump pcm */
return ret;
}
+const char *pa_sink_state_to_string(pa_sink_state_t state) {
+ switch (state) {
+ case PA_SINK_INIT: return "INIT";
+ case PA_SINK_IDLE: return "IDLE";
+ case PA_SINK_RUNNING: return "RUNNING";
+ case PA_SINK_SUSPENDED: return "SUSPENDED";
+ case PA_SINK_UNLINKED: return "UNLINKED";
+ case PA_SINK_INVALID_STATE: return "INVALID_STATE";
+ }
+
+ pa_assert_not_reached();
+}
+
/* Called from the IO thread */
static void sync_input_volumes_within_thread(pa_sink *s) {
pa_sink_input *i;
#define pa_sink_get_state(s) ((s)->state)
+const char *pa_sink_state_to_string(pa_sink_state_t state);
+
/* Moves all inputs away, and stores them in pa_queue */
pa_queue *pa_sink_move_all_start(pa_sink *s, pa_queue *q);
void pa_sink_move_all_finish(pa_sink *s, pa_queue *q, bool save);
return ret;
}
+ pa_log_debug("%s: state: %s -> %s", s->name, pa_source_state_to_string(s->state), pa_source_state_to_string(state));
s->state = state;
#ifdef TIZEN_PCM_DUMP
/* close file for dump pcm */
return ret;
}
+const char *pa_source_state_to_string(pa_source_state_t state) {
+ switch (state) {
+ case PA_SOURCE_INIT: return "INIT";
+ case PA_SOURCE_IDLE: return "IDLE";
+ case PA_SOURCE_RUNNING: return "RUNNING";
+ case PA_SOURCE_SUSPENDED: return "SUSPENDED";
+ case PA_SOURCE_UNLINKED: return "UNLINKED";
+ case PA_SOURCE_INVALID_STATE: return "INVALID_STATE";
+ }
+
+ pa_assert_not_reached();
+}
+
/* Called from the IO thread */
static void sync_output_volumes_within_thread(pa_source *s) {
pa_source_output *o;
#define pa_source_get_state(s) ((pa_source_state_t) (s)->state)
+const char *pa_source_state_to_string(pa_source_state_t state);
+
/* Moves all inputs away, and stores them in pa_queue */
pa_queue *pa_source_move_all_start(pa_source *s, pa_queue *q);
void pa_source_move_all_finish(pa_source *s, pa_queue *q, bool save);