1 /* Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #include "cras_types.h"
7 #include "utlist.h"
8 
9 struct cras_rclient;
10 struct cras_rstream;
11 struct cras_rstream_config;
12 struct cras_audio_format;
13 struct stream_list;
14 
15 typedef int (stream_callback)(struct cras_rstream *rstream);
16 typedef int (stream_create_func)(struct cras_rstream_config *stream_config,
17 				 struct cras_rstream **rstream);
18 typedef void (stream_destroy_func)(struct cras_rstream *rstream);
19 
20 struct stream_list *stream_list_create(stream_callback *add_cb,
21 				       stream_callback *rm_cb,
22 				       stream_create_func *create_cb,
23 				       stream_destroy_func *destroy_cb,
24 				       struct cras_tm *timer_manager);
25 
26 void stream_list_destroy(struct stream_list *list);
27 
28 struct cras_rstream *stream_list_get(struct stream_list *list);
29 
30 int stream_list_add(struct stream_list *list,
31 		    struct cras_rstream_config *stream_config,
32 		    struct cras_rstream **stream);
33 
34 int stream_list_rm(struct stream_list *list, cras_stream_id_t id);
35 
36 int stream_list_rm_all_client_streams(struct stream_list *list,
37 				      struct cras_rclient *rclient);
38