diff options
-rw-r--r-- | cras/src/common/cras_types.h | 17 | ||||
-rw-r--r-- | cras/src/server/audio_thread.c | 1 | ||||
-rw-r--r-- | cras/src/tests/cras_test_client.c | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/cras/src/common/cras_types.h b/cras/src/common/cras_types.h index b9dfc127..6c0ce0f0 100644 --- a/cras/src/common/cras_types.h +++ b/cras/src/common/cras_types.h @@ -112,6 +112,22 @@ enum CRAS_STREAM_TYPE { CRAS_STREAM_NUM_TYPES, }; +#define ENUM_STR(x) case x: return #x; + +static inline const char *cras_stream_type_str( + enum CRAS_STREAM_TYPE stream_type) +{ + switch(stream_type) { + ENUM_STR(CRAS_STREAM_TYPE_DEFAULT) + ENUM_STR(CRAS_STREAM_TYPE_MULTIMEDIA) + ENUM_STR(CRAS_STREAM_TYPE_VOICE_COMMUNICATION) + ENUM_STR(CRAS_STREAM_TYPE_SPEECH_RECOGNITION) + ENUM_STR(CRAS_STREAM_TYPE_PRO_AUDIO) + default: + return "INVALID_STREAM_TYPE"; + } +} + /* Information about a client attached to the server. */ struct __attribute__ ((__packed__)) cras_attached_client_info { uint32_t id; @@ -224,6 +240,7 @@ struct __attribute__ ((__packed__)) audio_stream_debug_info { uint64_t stream_id; uint32_t dev_idx; uint32_t direction; + uint32_t stream_type; uint32_t buffer_frames; uint32_t cb_threshold; uint32_t flags; diff --git a/cras/src/server/audio_thread.c b/cras/src/server/audio_thread.c index 84d9cc68..8b349146 100644 --- a/cras/src/server/audio_thread.c +++ b/cras/src/server/audio_thread.c @@ -802,6 +802,7 @@ static void append_stream_dump_info(struct audio_debug_info *info, si->stream_id = stream->stream->stream_id; si->dev_idx = dev_idx; si->direction = stream->stream->direction; + si->stream_type = stream->stream->stream_type; si->buffer_frames = stream->stream->buffer_frames; si->cb_threshold = stream->stream->cb_threshold; si->frame_rate = stream->stream->format.frame_rate; diff --git a/cras/src/tests/cras_test_client.c b/cras/src/tests/cras_test_client.c index 5e26b1af..6db3e116 100644 --- a/cras/src/tests/cras_test_client.c +++ b/cras/src/tests/cras_test_client.c @@ -597,6 +597,8 @@ static void audio_debug_info(struct cras_client *client) printf("direction: %s\n", (info->streams[i].direction == CRAS_STREAM_INPUT) ? "Input" : "Output"); + printf("stream_type: %s\n", + cras_stream_type_str(info->streams[i].stream_type)); printf("buffer_frames: %u\n" "cb_threshold: %u\n" "frame_rate: %u\n" |