diff options
author | Seunghun Lee <beauty.positive3@gmail.com> | 2015-06-22 10:23:54 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2015-06-22 10:31:42 -0400 |
commit | 8b621775619b9959fe952b095b3baaa7aaa99572 (patch) | |
tree | 99059a841a79729cac4687ea41f3abf672e6e455 /src/lib/ecore_buffer/shared_buffer.h | |
parent | 3671506ad39d2a956e388e151bd20f1b9ffd62a5 (diff) |
ecore-buffer: Add ecore_buffer library to EFL.
Summary:
Ecore_Buffer is abstraction of graphic buffer.
it supports backend of shm, x11_dri2 and x11_dri3 for now,
and this library also provides method to share buffers between processes.
Ecore_Buffer_Provider and Ecore_Buffer_Consumer is for this, sharing buffer.
provider draws something in to Ecore_Buffer, and consumer receives and displays it.
the binary, bq_mgr is a connection maker for buffer provider and consumer.
it can be included Enlightenment as a deamon later.
@feature
Test Plan:
1. Configure with --enable-ecore-buffer and --enable-always-build-examples to build examples.
2. Run bq_mgr, it connects consumer and provider.
3. Run ecore_buffer_provider_example and ecore_buffer_consumer_example
Reviewers: lsj119, gwanglim, cedric, zmike, jpeg, raster, devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2197
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_buffer/shared_buffer.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/ecore_buffer/shared_buffer.h b/src/lib/ecore_buffer/shared_buffer.h new file mode 100644 index 0000000000..ce168de3dd --- /dev/null +++ b/src/lib/ecore_buffer/shared_buffer.h | |||
@@ -0,0 +1,41 @@ | |||
1 | #ifndef _SHARED_BUFFER_H_ | ||
2 | # define _SHARED_BUFFER_H_ | ||
3 | |||
4 | #include <stdio.h> | ||
5 | #include <Eina.h> | ||
6 | #include <Ecore_Buffer.h> | ||
7 | |||
8 | #include "bq_mgr_protocol.h" | ||
9 | #include "ecore_buffer_private.h" | ||
10 | |||
11 | typedef struct _Shared_Buffer Shared_Buffer; | ||
12 | |||
13 | typedef enum _Shared_Buffer_State | ||
14 | { | ||
15 | // common | ||
16 | SHARED_BUFFER_STATE_UNKNOWN, | ||
17 | SHARED_BUFFER_STATE_ENQUEUE, | ||
18 | // provider side type | ||
19 | SHARED_BUFFER_STATE_NEW, | ||
20 | SHARED_BUFFER_STATE_SUBMIT, | ||
21 | SHARED_BUFFER_STATE_DEQUEUE, | ||
22 | // consumer side type | ||
23 | SHARED_BUFFER_STATE_ATTACH, | ||
24 | SHARED_BUFFER_STATE_IMPORT, | ||
25 | SHARED_BUFFER_STATE_DETACH, | ||
26 | SHARED_BUFFER_STATE_ACQUIRE, | ||
27 | SHARED_BUFFER_STATE_RELEASE, | ||
28 | } Shared_Buffer_State; | ||
29 | |||
30 | Shared_Buffer *_shared_buffer_new(const char *engine, struct bq_buffer *resource, int w, int h, int format, unsigned int flags); | ||
31 | void _shared_buffer_free(Shared_Buffer *sb); | ||
32 | Eina_Bool _shared_buffer_info_get(Shared_Buffer *sb, const char **engine, int *w, int *h, int *format, unsigned int *flags); | ||
33 | Eina_Bool _shared_buffer_buffer_set(Shared_Buffer *sb, Ecore_Buffer *buffer); | ||
34 | Ecore_Buffer *_shared_buffer_buffer_get(Shared_Buffer *sb); | ||
35 | Eina_Bool _shared_buffer_resource_set(Shared_Buffer *sb, struct bq_buffer *resource); | ||
36 | struct bq_buffer *_shared_buffer_resource_get(Shared_Buffer *sb); | ||
37 | void _shared_buffer_state_set(Shared_Buffer *sb, Shared_Buffer_State state); | ||
38 | Shared_Buffer_State _shared_buffer_state_get(Shared_Buffer *sb); | ||
39 | const char *_shared_buffer_state_string_get(Shared_Buffer *sb); | ||
40 | |||
41 | #endif /* _SHARED_BUFFER_H_ */ | ||