]> git.proxmox.com Git - mirror_qemu.git/blame - hw/core/stream.c
Merge remote-tracking branch 'remotes/juanquintela/tags/migration-20211102-pull-reque...
[mirror_qemu.git] / hw / core / stream.c
CommitLineData
18c86e2b 1#include "qemu/osdep.h"
83c9f4ca 2#include "hw/stream.h"
0b8fa32f 3#include "qemu/module.h"
669b4983 4
35e60bfd 5size_t
cfbef3f4 6stream_push(StreamSink *sink, uint8_t *buf, size_t len, bool eop)
669b4983 7{
cfbef3f4 8 StreamSinkClass *k = STREAM_SINK_GET_CLASS(sink);
669b4983 9
51b19950 10 return k->push(sink, buf, len, eop);
35e60bfd
PC
11}
12
13bool
cfbef3f4 14stream_can_push(StreamSink *sink, StreamCanPushNotifyFn notify,
35e60bfd
PC
15 void *notify_opaque)
16{
cfbef3f4 17 StreamSinkClass *k = STREAM_SINK_GET_CLASS(sink);
35e60bfd
PC
18
19 return k->can_push ? k->can_push(sink, notify, notify_opaque) : true;
669b4983
PC
20}
21
cfbef3f4
PMD
22static const TypeInfo stream_sink_info = {
23 .name = TYPE_STREAM_SINK,
669b4983 24 .parent = TYPE_INTERFACE,
cfbef3f4 25 .class_size = sizeof(StreamSinkClass),
669b4983
PC
26};
27
28
cfbef3f4 29static void stream_sink_register_types(void)
669b4983 30{
cfbef3f4 31 type_register_static(&stream_sink_info);
669b4983
PC
32}
33
cfbef3f4 34type_init(stream_sink_register_types)