mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 12:23:36 +08:00
0b8fa32f55
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-4-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c; ui/cocoa.m fixed up]
35 lines
786 B
C
35 lines
786 B
C
#include "qemu/osdep.h"
|
|
#include "hw/stream.h"
|
|
#include "qemu/module.h"
|
|
|
|
size_t
|
|
stream_push(StreamSlave *sink, uint8_t *buf, size_t len)
|
|
{
|
|
StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink);
|
|
|
|
return k->push(sink, buf, len);
|
|
}
|
|
|
|
bool
|
|
stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify,
|
|
void *notify_opaque)
|
|
{
|
|
StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink);
|
|
|
|
return k->can_push ? k->can_push(sink, notify, notify_opaque) : true;
|
|
}
|
|
|
|
static const TypeInfo stream_slave_info = {
|
|
.name = TYPE_STREAM_SLAVE,
|
|
.parent = TYPE_INTERFACE,
|
|
.class_size = sizeof(StreamSlaveClass),
|
|
};
|
|
|
|
|
|
static void stream_slave_register_types(void)
|
|
{
|
|
type_register_static(&stream_slave_info);
|
|
}
|
|
|
|
type_init(stream_slave_register_types)
|