• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2019 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 <syslog.h>
7 
8 #include "cras_iodev_list.h"
9 #include "cras_messages.h"
10 #include "cras_observer.h"
11 #include "cras_rclient.h"
12 #include "cras_rclient_util.h"
13 #include "cras_rstream.h"
14 #include "cras_types.h"
15 #include "cras_util.h"
16 
17 /* Declarations of cras_rclient operators for cras_playback_rclient. */
18 static const struct cras_rclient_ops cras_playback_rclient_ops = {
19 	.handle_message_from_client = rclient_handle_message_from_client,
20 	.send_message_to_client = rclient_send_message_to_client,
21 	.destroy = rclient_destroy,
22 };
23 
24 /*
25  * Exported Functions.
26  */
27 
28 /* Creates a client structure and sends a message back informing the client that
29  * the connection has succeeded. */
cras_playback_rclient_create(int fd,size_t id)30 struct cras_rclient *cras_playback_rclient_create(int fd, size_t id)
31 {
32 	return rclient_generic_create(
33 		fd, id, &cras_playback_rclient_ops,
34 		cras_stream_direction_mask(CRAS_STREAM_OUTPUT));
35 }
36