summaryrefslogtreecommitdiff
path: root/server/dcc.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/dcc.h')
-rw-r--r--server/dcc.h93
1 files changed, 23 insertions, 70 deletions
diff --git a/server/dcc.h b/server/dcc.h
index 1dd53bd7..91cda714 100644
--- a/server/dcc.h
+++ b/server/dcc.h
@@ -18,11 +18,9 @@
#ifndef DCC_H_
# define DCC_H_
-#include "red-worker.h"
+#include "image-cache.h"
#include "pixmap-cache.h"
-#include "cache-item.h"
-#include "dcc-encoders.h"
-#include "stream.h"
+#include "red-worker.h"
#include "display-limits.h"
#define PALETTE_CACHE_HASH_SHIFT 8
@@ -42,6 +40,12 @@
#define MAX_PIPE_SIZE 50
+/* FIXME: remove */
+typedef struct DisplayChannel DisplayChannel;
+typedef struct Stream Stream;
+typedef struct StreamAgent StreamAgent;
+typedef struct GlzSharedDictionary GlzSharedDictionary;
+
typedef struct WaitForChannels {
SpiceMsgWaitForChannels header;
SpiceWaitForChannel buf[MAX_CACHE_CLIENTS];
@@ -54,72 +58,11 @@ typedef struct FreeList {
WaitForChannels wait;
} FreeList;
-struct DisplayChannelClient {
- CommonGraphicsChannelClient common;
- uint32_t id;
- SpiceImageCompression image_compression;
- spice_wan_compression_t jpeg_state;
- spice_wan_compression_t zlib_glz_state;
- int jpeg_quality;
- int zlib_level;
-
- QuicData quic_data;
- QuicContext *quic;
- LzData lz_data;
- LzContext *lz;
- JpegData jpeg_data;
- JpegEncoderContext *jpeg;
-#ifdef USE_LZ4
- Lz4Data lz4_data;
- Lz4EncoderContext *lz4;
-#endif
- ZlibData zlib_data;
- ZlibEncoder *zlib;
-
- int expect_init;
-
- PixmapCache *pixmap_cache;
- uint32_t pixmap_cache_generation;
- int pending_pixmaps_sync;
-
- RedCacheItem *palette_cache[PALETTE_CACHE_HASH_SIZE];
- Ring palette_cache_lru;
- long palette_cache_available;
- uint32_t palette_cache_items;
-
- struct {
- uint32_t stream_outbuf_size;
- uint8_t *stream_outbuf; // caution stream buffer is also used as compress bufs!!!
-
- FreeList free_list;
- uint64_t pixmap_cache_items[MAX_DRAWABLE_PIXMAP_CACHE_ITEMS];
- int num_pixmap_cache_items;
- } send_data;
-
- /* global lz encoding entities */
- GlzSharedDictionary *glz_dict;
- GlzEncoderContext *glz;
- GlzData glz_data;
-
- Ring glz_drawables; // all the living lz drawable, ordered by encoding time
- Ring glz_drawables_inst_to_free; // list of instances to be freed
- pthread_mutex_t glz_drawables_inst_to_free_lock;
-
- uint8_t surface_client_created[NUM_SURFACES];
- QRegion surface_client_lossy_region[NUM_SURFACES];
-
- StreamAgent stream_agents[NUM_STREAMS];
- int use_video_encoder_rate_control;
- uint32_t streams_max_latency;
- uint64_t streams_max_bit_rate;
- bool gl_draw_ongoing;
-};
-
-#define DCC_TO_WORKER(dcc) \
- (SPICE_CONTAINEROF((dcc)->common.base.channel, CommonGraphicsChannel, base)->worker)
-#define DCC_TO_DC(dcc) \
- SPICE_CONTAINEROF((dcc)->common.base.channel, DisplayChannel, common.base)
-#define RCC_TO_DCC(rcc) SPICE_CONTAINEROF((rcc), DisplayChannelClient, common.base)
+typedef struct DisplayChannelClient DisplayChannelClient;
+
+#define DCC_TO_WORKER(dcc) ((RedWorker*)((CommonGraphicsChannel*)((RedChannelClient*)dcc)->channel)->worker)
+#define DCC_TO_DC(dcc) ((DisplayChannel*)((RedChannelClient*)dcc)->channel)
+#define RCC_TO_DCC(rcc) ((DisplayChannelClient*)rcc)
typedef struct RedSurfaceCreateItem {
SpiceMsgSurfaceCreate surface_create;
@@ -231,4 +174,14 @@ int dcc_compress_image (DisplayCha
int can_lossy,
compress_send_data_t* o_comp_data);
+StreamAgent * dcc_get_stream_agent (DisplayChannelClient *dcc, int stream_id);
+GlzSharedDictionary * dcc_get_glz_dictionary (DisplayChannelClient *dcc);
+spice_wan_compression_t dcc_get_jpeg_state (DisplayChannelClient *dcc);
+spice_wan_compression_t dcc_get_zlib_glz_state (DisplayChannelClient *dcc);
+gboolean dcc_use_video_encoder_rate_control (DisplayChannelClient *dcc);
+uint32_t dcc_get_max_stream_latency(DisplayChannelClient *dcc);
+void dcc_set_max_stream_latency(DisplayChannelClient *dcc, uint32_t latency);
+uint64_t dcc_get_max_stream_bit_rate(DisplayChannelClient *dcc);
+void dcc_set_max_stream_bit_rate(DisplayChannelClient *dcc, uint64_t rate);
+
#endif /* DCC_H_ */