spice/server/stream-channel.h
Frediano Ziglio 60104d818c stream-device: Handle streaming data from device to channel
Handle stream data from device sending to the channel.
The StreamChannel will forward the data to the clients using standard
DisplayChannel messages, and will create and destroy streams as
necessary.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00

62 lines
2.2 KiB
C

/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2017 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef STREAM_CHANNEL_H_
#define STREAM_CHANNEL_H_
#include "red-channel.h"
G_BEGIN_DECLS
/**
* This type it's a RedChannel class which implement display
* channel with input only by stream.
* A pointer to StreamChannel can be converted to a RedChannel.
*/
typedef struct StreamChannel StreamChannel;
typedef struct StreamChannelClass StreamChannelClass;
#define TYPE_STREAM_CHANNEL stream_channel_get_type()
#define STREAM_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_STREAM_CHANNEL, StreamChannel))
#define STREAM_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), TYPE_STREAM_CHANNEL, StreamChannelClass))
#define IS_STREAM_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_STREAM_CHANNEL))
#define IS_STREAM_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_STREAM_CHANNEL))
#define STREAM_CHANNEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), TYPE_STREAM_CHANNEL, StreamChannelClass))
GType stream_channel_get_type(void) G_GNUC_CONST;
/**
* Create StreamChannel.
*/
StreamChannel* stream_channel_new(RedsState *server, uint32_t id);
struct StreamMsgFormat;
void stream_channel_change_format(StreamChannel *channel,
const struct StreamMsgFormat *fmt);
void stream_channel_send_data(StreamChannel *channel,
const void *data, size_t size,
uint32_t mm_time);
G_END_DECLS
#endif /* STREAM_CHANNEL_H_ */