summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2020-05-02 14:44:59 -0400
committerChristopher Michael <devilhorns@comcast.net>2020-05-02 14:51:41 -0400
commit09df69a3eb23309dedf109f6daac3480f3175515 (patch)
tree46df285e5f41af1e275a5a8bc249effc07aa9089
parent7c1c09f3edd47590123f74ee6ab6dce06166a852 (diff)
ecore-buffer: Fix formatting
NB: No functional changes
-rw-r--r--src/lib/ecore_buffer/ecore_buffer_private.h35
-rw-r--r--src/lib/ecore_buffer/ecore_buffer_provider.c43
2 files changed, 44 insertions, 34 deletions
diff --git a/src/lib/ecore_buffer/ecore_buffer_private.h b/src/lib/ecore_buffer/ecore_buffer_private.h
index 4e33772ed6..4487ea2a2c 100644
--- a/src/lib/ecore_buffer/ecore_buffer_private.h
+++ b/src/lib/ecore_buffer/ecore_buffer_private.h
@@ -1,29 +1,30 @@
1#ifndef _ECORE_BUFFER_PRIVATE_H_ 1#ifndef _ECORE_BUFFER_PRIVATE_H_
2# define _ECORE_BUFFER_PRIVATE_H_ 2# define _ECORE_BUFFER_PRIVATE_H_
3 3
4#ifdef ERR 4# ifdef ERR
5#undef ERR 5# undef ERR
6#endif 6# endif
7#ifdef WARN 7# ifdef WARN
8#undef WARN 8# undef WARN
9#endif 9# endif
10#ifdef DBG 10# ifdef DBG
11#undef DBG 11# undef DBG
12#endif 12# endif
13 13
14#define ERR(...) EINA_LOG_DOM_ERR(_ecore_buffer_queue_log_dom, __VA_ARGS__) 14# define ERR(...) EINA_LOG_DOM_ERR(_ecore_buffer_queue_log_dom, __VA_ARGS__)
15#define DBG(...) EINA_LOG_DOM_DBG(_ecore_buffer_queue_log_dom, __VA_ARGS__) 15# define DBG(...) EINA_LOG_DOM_DBG(_ecore_buffer_queue_log_dom, __VA_ARGS__)
16#define WARN(...) EINA_LOG_DOM_WARN(_ecore_buffer_queue_log_dom, __VA_ARGS__) 16# define WARN(...) EINA_LOG_DOM_WARN(_ecore_buffer_queue_log_dom, __VA_ARGS__)
17 17
18#define CALLBACK_CALL(obj, cbname) \ 18# define CALLBACK_CALL(obj, cbname) \
19do { \ 19 do { \
20 if (obj->cb.cbname) \ 20 if (obj->cb.cbname) \
21 obj->cb.cbname(obj, obj->cb.data); \ 21 obj->cb.cbname(obj, obj->cb.data); \
22} while(0) 22 } while(0)
23 23
24extern int _ecore_buffer_queue_log_dom; 24extern int _ecore_buffer_queue_log_dom;
25 25
26const char *_ecore_buffer_engine_name_get(Ecore_Buffer *buf); 26const char *_ecore_buffer_engine_name_get(Ecore_Buffer *buf);
27
27/* NOTE: if Ecore_Export_Type as a return value is EXPORT_TYPE_FD, 28/* NOTE: if Ecore_Export_Type as a return value is EXPORT_TYPE_FD,
28 * then caller should close the fd after using it. */ 29 * then caller should close the fd after using it. */
29Ecore_Export_Type _ecore_buffer_export(Ecore_Buffer *buf, int *id); 30Ecore_Export_Type _ecore_buffer_export(Ecore_Buffer *buf, int *id);
diff --git a/src/lib/ecore_buffer/ecore_buffer_provider.c b/src/lib/ecore_buffer/ecore_buffer_provider.c
index 53380fac84..e5cd4f0cf6 100644
--- a/src/lib/ecore_buffer/ecore_buffer_provider.c
+++ b/src/lib/ecore_buffer/ecore_buffer_provider.c
@@ -17,20 +17,20 @@ struct _Ecore_Buffer_Provider
17 Ecore_Buffer_Queue *ebq; 17 Ecore_Buffer_Queue *ebq;
18 int free_slot; 18 int free_slot;
19 struct 19 struct
20 { 20 {
21 void (*consumer_add) (Ecore_Buffer_Provider *provider, int queue_size, int w, int h, void *data); 21 void (*consumer_add) (Ecore_Buffer_Provider *provider, int queue_size, int w, int h, void *data);
22 void (*consumer_del) (Ecore_Buffer_Provider *provider, void *data); 22 void (*consumer_del) (Ecore_Buffer_Provider *provider, void *data);
23 void (*enqueue) (Ecore_Buffer_Provider *provider, void *data); 23 void (*enqueue) (Ecore_Buffer_Provider *provider, void *data);
24 void *data; 24 void *data;
25 } cb; 25 } cb;
26}; 26};
27 27
28static void _ecore_buffer_provider_cb_consumer_connected(void *data, struct bq_provider *bq_provider, int32_t queue_size, int32_t width, int32_t height); 28static void _ecore_buffer_provider_cb_consumer_connected(void *data, struct bq_provider *bq_provider, int32_t queue_size, int32_t width, int32_t height);
29static void _ecore_buffer_provider_cb_consumer_disconnected(void *data, struct bq_provider *bq_provider); 29static void _ecore_buffer_provider_cb_consumer_disconnected(void *data, struct bq_provider *bq_provider);
30static void _ecore_buffer_provider_cb_add_buffer(void *data, struct bq_provider *bq_provider, struct bq_buffer *buffer, uint32_t serial); 30static void _ecore_buffer_provider_cb_add_buffer(void *data, struct bq_provider *bq_provider, struct bq_buffer *buffer, uint32_t serial);
31static Shared_Buffer *_ecore_buffer_provider_shared_buffer_new(Ecore_Buffer_Provider *provider, Ecore_Buffer *buffer); 31static Shared_Buffer *_ecore_buffer_provider_shared_buffer_new(Ecore_Buffer_Provider *provider, Ecore_Buffer *buffer);
32static void _ecore_buffer_provider_shared_buffer_free(Ecore_Buffer_Provider *provider, Shared_Buffer *sb); 32static void _ecore_buffer_provider_shared_buffer_free(Ecore_Buffer_Provider *provider, Shared_Buffer *sb);
33static void _ecore_buffer_provider_cb_buffer_free(Ecore_Buffer *buf, void *data); 33static void _ecore_buffer_provider_cb_buffer_free(Ecore_Buffer *buf, void *data);
34 34
35struct bq_provider_listener _ecore_buffer_provider_listener = 35struct bq_provider_listener _ecore_buffer_provider_listener =
36{ 36{
@@ -83,7 +83,9 @@ ecore_buffer_provider_free(Ecore_Buffer_Provider *provider)
83 83
84 if (provider->ebq) 84 if (provider->ebq)
85 { 85 {
86 shared_buffers = _ecore_buffer_queue_shared_buffer_list_get(provider->ebq); 86 shared_buffers =
87 _ecore_buffer_queue_shared_buffer_list_get(provider->ebq);
88
87 EINA_LIST_FOREACH(shared_buffers, l, sb) 89 EINA_LIST_FOREACH(shared_buffers, l, sb)
88 _ecore_buffer_provider_shared_buffer_free(provider, sb); 90 _ecore_buffer_provider_shared_buffer_free(provider, sb);
89 91
@@ -183,7 +185,8 @@ ecore_buffer_provider_buffer_enqueue(Ecore_Buffer_Provider *provider, Ecore_Buff
183 } 185 }
184 186
185 _shared_buffer_state_set(sb, SHARED_BUFFER_STATE_ENQUEUE); 187 _shared_buffer_state_set(sb, SHARED_BUFFER_STATE_ENQUEUE);
186 bq_provider_enqueue_buffer(provider->resource, _shared_buffer_resource_get(sb), 0); 188 bq_provider_enqueue_buffer(provider->resource,
189 _shared_buffer_resource_get(sb), 0);
187 190
188 return EINA_TRUE; 191 return EINA_TRUE;
189} 192}
@@ -255,7 +258,8 @@ _ecore_buffer_provider_cb_consumer_connected(void *data, struct bq_provider *bq_
255 258
256 // CALLBACK_CALL 259 // CALLBACK_CALL
257 if (provider->cb.consumer_add) 260 if (provider->cb.consumer_add)
258 provider->cb.consumer_add(provider, queue_size, width, height, provider->cb.data); 261 provider->cb.consumer_add(provider, queue_size, width, height,
262 provider->cb.data);
259} 263}
260 264
261static void 265static void
@@ -298,7 +302,9 @@ static void
298_ecore_buffer_provider_cb_buffer_free(Ecore_Buffer *buffer, void *data) 302_ecore_buffer_provider_cb_buffer_free(Ecore_Buffer *buffer, void *data)
299{ 303{
300 Ecore_Buffer_Provider *provider = data; 304 Ecore_Buffer_Provider *provider = data;
301 Shared_Buffer *sb = _ecore_buffer_queue_shared_buffer_find(provider->ebq, buffer); 305 Shared_Buffer *sb;
306
307 sb = _ecore_buffer_queue_shared_buffer_find(provider->ebq, buffer);
302 308
303 EINA_SAFETY_ON_NULL_RETURN(provider); 309 EINA_SAFETY_ON_NULL_RETURN(provider);
304 310
@@ -334,7 +340,8 @@ _ecore_buffer_provider_shared_buffer_new(Ecore_Buffer_Provider *provider, Ecore_
334 engine = _ecore_buffer_engine_name_get(buffer); 340 engine = _ecore_buffer_engine_name_get(buffer);
335 flags = ecore_buffer_flags_get(buffer); 341 flags = ecore_buffer_flags_get(buffer);
336 342
337 buf_resource = bq_provider_attach_buffer(provider->resource, engine, w, h, format, flags); 343 buf_resource =
344 bq_provider_attach_buffer(provider->resource, engine, w, h, format, flags);
338 if (!buf_resource) 345 if (!buf_resource)
339 { 346 {
340 ERR("Fail to attach buffer - engine %s, size (%dx%d), format %d, flags %d", 347 ERR("Fail to attach buffer - engine %s, size (%dx%d), format %d, flags %d",
@@ -362,7 +369,9 @@ _ecore_buffer_provider_shared_buffer_new(Ecore_Buffer_Provider *provider, Ecore_
362 _ecore_buffer_queue_shared_buffer_add(provider->ebq, sb); 369 _ecore_buffer_queue_shared_buffer_add(provider->ebq, sb);
363 bq_buffer_set_user_data(buf_resource, sb); 370 bq_buffer_set_user_data(buf_resource, sb);
364 371
365 ecore_buffer_free_callback_add(buffer, _ecore_buffer_provider_cb_buffer_free, provider); 372 ecore_buffer_free_callback_add(buffer,
373 _ecore_buffer_provider_cb_buffer_free,
374 provider);
366 375
367 return sb; 376 return sb;
368} 377}