1/* Copyright (C) 2010 The Android Open Source Project
2**
3** This software is licensed under the terms of the GNU General Public
4** License version 2, as published by the Free Software Foundation, and
5** may be copied, distributed, and modified under those terms.
6**
7** This program is distributed in the hope that it will be useful,
8** but WITHOUT ANY WARRANTY; without even the implied warranty of
9** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10** GNU General Public License for more details.
11*/
12
13/*
14 * Contains core-side framebuffer service that sends framebuffer updates
15 * to the UI connected to the core.
16 */
17
18#ifndef _ANDROID_PROTOCOL_FB_UPDATES_PROXY_H
19#define _ANDROID_PROTOCOL_FB_UPDATES_PROXY_H
20
21/* Descriptor for a framebuffer core service instance */
22typedef struct ProxyFramebuffer ProxyFramebuffer;
23
24/*
25 * Creates framebuffer service.
26 * Param:
27 *  sock - Socket descriptor for the service
28 *  protocol - Defines protocol to use when sending FB updates to the UI. The
29 *      supported values ar:
30 *      -raw Transfers the updating rectangle buffer over the socket.
31 *      -shared Used a shared memory to transfer the updating rectangle buffer.
32 * Return:
33 *  Framebuffer service descriptor.
34 */
35ProxyFramebuffer* proxyFb_create(int sock, const char* protocol);
36
37/*
38 * Destroys framebuffer service created with proxyFb_create.
39 * Param:
40 *  core_fb - Framebuffer service descriptor created with proxyFb_create
41 */
42void proxyFb_destroy(ProxyFramebuffer* core_fb);
43
44/*
45 * Gets number of bits used to encode a single pixel.
46 * Param:
47 *  core_fb - Framebuffer service descriptor created with proxyFb_create
48 * Return:
49 *  Number of bits used to encode a single pixel.
50 */
51int proxyFb_get_bits_per_pixel(ProxyFramebuffer* core_fb);
52
53#endif /* _ANDROID_PROTOCOL_FB_UPDATES_PROXY_H */
54