]>
Commit | Line | Data |
---|---|---|
83c9f4ca | 1 | #include "hw/stream.h" |
669b4983 | 2 | |
35e60bfd | 3 | size_t |
42bb9c91 | 4 | stream_push(StreamSlave *sink, uint8_t *buf, size_t len) |
669b4983 PC |
5 | { |
6 | StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink); | |
7 | ||
42bb9c91 | 8 | return k->push(sink, buf, len); |
35e60bfd PC |
9 | } |
10 | ||
11 | bool | |
12 | stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify, | |
13 | void *notify_opaque) | |
14 | { | |
15 | StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink); | |
16 | ||
17 | return k->can_push ? k->can_push(sink, notify, notify_opaque) : true; | |
669b4983 PC |
18 | } |
19 | ||
8c43a6f0 | 20 | static const TypeInfo stream_slave_info = { |
669b4983 PC |
21 | .name = TYPE_STREAM_SLAVE, |
22 | .parent = TYPE_INTERFACE, | |
23 | .class_size = sizeof(StreamSlaveClass), | |
24 | }; | |
25 | ||
26 | ||
27 | static void stream_slave_register_types(void) | |
28 | { | |
29 | type_register_static(&stream_slave_info); | |
30 | } | |
31 | ||
32 | type_init(stream_slave_register_types) |