vfs: check userland buffers before reading them.
[haiku.git] / src / kits / media / experimental / MediaClientDefs.cpp
blob6985e95cf4f6fc2a40cb1c1fc04e54b34aa7472b
1 /*
2 * Copyright 2015, Dario Casalinuovo. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
6 #include <MediaClient.h>
7 #include <MediaConnection.h>
9 #include "debug.h"
12 media_client_id
13 media_client::Id() const
15 return node.node;
19 media_client_kinds
20 media_client::Kinds() const
22 return kinds;
26 const media_client&
27 media_connection::Client() const
29 return client;
33 media_connection_id
34 media_connection::Id() const
36 return id;
40 media_connection_kinds
41 media_connection::Kinds() const
43 return kinds;
47 bool
48 media_connection::IsInput() const
50 return Kinds() == B_MEDIA_INPUT;
54 bool
55 media_connection::IsOutput() const
57 return Kinds() == B_MEDIA_OUTPUT;
61 media_input
62 media_connection::_MediaInput() const
64 media_input input;
65 input.node = client.node;
66 input.source = source;
67 input.destination = destination;
68 input.format = format;
69 return input;
73 media_output
74 media_connection::_MediaOutput() const
76 media_output output;
77 output.node = client.node;
78 output.source = source;
79 output.destination = destination;
80 output.format = format;
81 return output;
85 const media_source&
86 media_connection::_Source() const
88 return source;
92 const media_destination&
93 media_connection::_Destination() const
95 return destination;
99 media_node
100 media_connection::_RemoteNode() const
102 return remote_node;
106 media_node
107 media_connection::_Node() const
109 return client.node;