blob: 158f1372ddf6b56749a215888668103123278837 [file] [log] [blame]
Vladimir Chtchetkinee95660a2010-12-20 08:28:03 -08001/* 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 UI-side framebuffer client that receives framebuffer updates
15 * from the core.
16 */
17
18#ifndef _ANDROID_FRAMEBUFFER_UI_H
19#define _ANDROID_FRAMEBUFFER_UI_H
20
21#include "console.h"
Vladimir Chtchetkinecf755ea2011-01-12 14:38:19 -080022#include "framebuffer.h"
Vladimir Chtchetkinee95660a2010-12-20 08:28:03 -080023#include "android/looper.h"
24#include "android/async-utils.h"
25#include "android/core-connection.h"
26
27/* Descriptor for the framebuffer client. */
28typedef struct ClientFramebuffer ClientFramebuffer;
29
30/*
31 * Creates framebuffer client, and connects it with the core.
32 * Param:
33 * console_socket Address of the core's console socket.
34 * protocol Protocol to use for the updates:
35 * -raw Stream pixels over socket
36 * -shared Use shared memory for pixels.
Vladimir Chtchetkinecf755ea2011-01-12 14:38:19 -080037 * fb - Framebuffer associated with this FB client.
Vladimir Chtchetkinee95660a2010-12-20 08:28:03 -080038 * Return:
39 * Descriptor for the framebuffer client on success, or NULL on failure.
40 */
41ClientFramebuffer* clientfb_create(SockAddress* console_socket,
Vladimir Chtchetkinecf755ea2011-01-12 14:38:19 -080042 const char* protocol,
43 QFrameBuffer* fb);
Vladimir Chtchetkinee95660a2010-12-20 08:28:03 -080044
45/*
46 * Disconnects and destroys framebuffer client.
47 * Param:
48 * client_fb Framebuffer client descriptor created with clientfb_create.
49 */
50void clientfb_destroy(ClientFramebuffer* client_fb);
51
52#endif /* _ANDROID_FRAMEBUFFER_UI_H */