~ubuntu-branches/debian/experimental/spice/experimental

« back to all changes in this revision

Viewing changes to spice-common/common/quic.h

  • Committer: Package Import Robot
  • Author(s): Michael Tokarev, Michael Tokarev
  • Date: 2013-01-17 19:19:30 UTC
  • mfrom: (0.5.1) (7.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130117191930-oy4gnzcxdtj0uzh0
Tags: 0.12.2-0nocelt1exp
* New upstream release
* debian/patches:
   - Refresh link-libspice-server-with-libm-libpthread.patch
* Refresh debian/cpyright, new files added
* Build client, upstream don't build client by default
* Refresh libspice-server1.symbols
* Add libglib2.0-dev to Build-Depends

[ Michael Tokarev ]
* refresh make-celt-to-be-optional.patch (minor context diff)
* do not build-depend on libspice-protocol-dev
  (upstream always uses included copy)
* add (versioned) dependency on libspice-protocol-dev to libspice-server-dev
  package, since when the latter is installed, embedded protocol headers
  are not installed
* do not build-depend on mesa libs (OpenGL is not enabled by default
  and is not recommended by upstream)
* do not build-depend on libogg-dev
* configure with --disable-silent-rules, so that the compiler command
  line is visible (this fixes the lintian warnings about hardening flags)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
 
2
/*
 
3
   Copyright (C) 2009 Red Hat, Inc.
 
4
 
 
5
   This library is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU Lesser General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2.1 of the License, or (at your option) any later version.
 
9
 
 
10
   This library is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Lesser General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Lesser General Public
 
16
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 
17
*/
 
18
 
 
19
#ifndef __QUIC_H
 
20
#define __QUIC_H
 
21
 
 
22
#include <spice/macros.h>
 
23
#include "quic_config.h"
 
24
#include "macros.h"
 
25
 
 
26
SPICE_BEGIN_DECLS
 
27
 
 
28
typedef enum {
 
29
    QUIC_IMAGE_TYPE_INVALID,
 
30
    QUIC_IMAGE_TYPE_GRAY,
 
31
    QUIC_IMAGE_TYPE_RGB16,
 
32
    QUIC_IMAGE_TYPE_RGB24,
 
33
    QUIC_IMAGE_TYPE_RGB32,
 
34
    QUIC_IMAGE_TYPE_RGBA
 
35
} QuicImageType;
 
36
 
 
37
#define QUIC_ERROR -1
 
38
#define QUIC_OK 0
 
39
 
 
40
typedef void *QuicContext;
 
41
 
 
42
typedef struct QuicUsrContext QuicUsrContext;
 
43
struct QuicUsrContext {
 
44
    SPICE_ATTR_PRINTF(2, 3) void (*error)(QuicUsrContext *usr, const char *fmt, ...);
 
45
    SPICE_ATTR_PRINTF(2, 3) void (*warn)(QuicUsrContext *usr, const char *fmt, ...);
 
46
    SPICE_ATTR_PRINTF(2, 3) void (*info)(QuicUsrContext *usr, const char *fmt, ...);
 
47
    void *(*malloc)(QuicUsrContext *usr, int size);
 
48
    void (*free)(QuicUsrContext *usr, void *ptr);
 
49
    int (*more_space)(QuicUsrContext *usr, uint32_t **io_ptr, int rows_completed);
 
50
    int (*more_lines)(QuicUsrContext *usr, uint8_t **lines); // on return the last line of previous
 
51
                                                             // lines bunch must still be valid
 
52
};
 
53
 
 
54
int quic_encode(QuicContext *quic, QuicImageType type, int width, int height,
 
55
                uint8_t *lines, unsigned int num_lines, int stride,
 
56
                uint32_t *io_ptr, unsigned int num_io_words);
 
57
 
 
58
int quic_decode_begin(QuicContext *quic, uint32_t *io_ptr, unsigned int num_io_words,
 
59
                      QuicImageType *type, int *width, int *height);
 
60
int quic_decode(QuicContext *quic, QuicImageType type, uint8_t *buf, int stride);
 
61
 
 
62
 
 
63
QuicContext *quic_create(QuicUsrContext *usr);
 
64
void quic_destroy(QuicContext *quic);
 
65
 
 
66
void quic_init(void);
 
67
 
 
68
SPICE_END_DECLS
 
69
 
 
70
#endif