Ecore Buffer Provider functions
Ecore » Ecore_Buffer - Graphics buffer functions » Ecore Buffer Queue functions

This group of functions is applied to an Ecore_Buffer_Provider object. More...

## Typedefs

typedef struct _Ecore_Buffer_Provider | Ecore_Buffer_Provider
| An object representing a provider of Ecore_Buffer.
typedef void(* | Ecore_Buffer_Provider_Consumer_Add_Cb) (Ecore_Buffer_Provider *provider, int queue_size, int w, int h, void *data)
| Called whenever a Ecore_Buffer_Consumer connected.
typedef void(* | Ecore_Buffer_Provider_Consumer_Del_Cb) (Ecore_Buffer_Provider *provider, void *data)
| Called whenever a Ecore_Buffer_Consumer disconnected.
typedef void(* | Ecore_Buffer_Provider_Enqueue_Cb) (Ecore_Buffer_Provider *provider, void *data)
| Called whenever a Ecore_Buffer is released.

## Enumerations

enum | _Ecore_Buffer_Return { ECORE_BUFFER_RETURN_ERROR , ECORE_BUFFER_RETURN_SUCCESS , ECORE_BUFFER_RETURN_EMPTY , ECORE_BUFFER_RETURN_NOT_EMPTY , ECORE_BUFFER_RETURN_NEED_ALLOC }
| Types for an buffer queue state on provider side. More...

## Functions

EAPI Ecore_Buffer_Provider * | ecore_buffer_provider_new (const char *name)
| Creates a new Buffer Provider based on name.
EAPI void | ecore_buffer_provider_free (Ecore_Buffer_Provider *provider)
| Frees an Ecore_Buffer_Provider.
EAPI Ecore_Buffer_Return | ecore_buffer_provider_buffer_acquire (Ecore_Buffer_Provider *provider, Ecore_Buffer **ret_buf)
| Returns the Ecore_Buffer released by consumer or State of Queue.
EAPI Eina_Bool | ecore_buffer_provider_buffer_enqueue (Ecore_Buffer_Provider *provider, Ecore_Buffer *buffer)
| Submits the Ecore_Buffer to Consumer to request compositing.
EAPI Ecore_Buffer_Return | ecore_buffer_provider_buffer_acquirable_check (Ecore_Buffer_Provider *provider)
| Checks if state of queue.
EAPI void | ecore_buffer_provider_consumer_add_cb_set (Ecore_Buffer_Provider *provider, Ecore_Buffer_Provider_Consumer_Add_Cb func, void *data)
| Sets a callback for consumer connection events.
EAPI void | ecore_buffer_provider_consumer_del_cb_set (Ecore_Buffer_Provider *provider, Ecore_Buffer_Provider_Consumer_Del_Cb func, void *data)
| Sets a callback for consumer disconnection events.
EAPI void | ecore_buffer_provider_buffer_released_cb_set (Ecore_Buffer_Provider *provider, Ecore_Buffer_Provider_Enqueue_Cb func, void *data)
| Sets a callback for released buffer events.

## Detailed Description

This group of functions is applied to an Ecore_Buffer_Provider object.

Ecore_Buffer_Provider provides Ecore_Buffer to Ecore_Buffer_Consumer(usually different process or thread from Ecore_Buffer_Provider). Ecore_Buffer_Provider should creates Ecore_Buffer as a provider.

## Typedef Documentation

## Ecore_Buffer_Provider

typedef struct _Ecore_Buffer_Provider Ecore_Buffer_Provider

An object representing a provider of Ecore_Buffer.

Since
  1.15

## Ecore_Buffer_Provider_Consumer_Add_Cb

typedef void(* Ecore_Buffer_Provider_Consumer_Add_Cb) (Ecore_Buffer_Provider *provider, int queue_size, int w, int h, void *data)

Called whenever a Ecore_Buffer_Consumer connected.

Since
  1.15

See also
  ecore_buffer_provider_consumer_add_cb_set()

## Ecore_Buffer_Provider_Consumer_Del_Cb

typedef void(* Ecore_Buffer_Provider_Consumer_Del_Cb) (Ecore_Buffer_Provider *provider, void *data)

Called whenever a Ecore_Buffer_Consumer disconnected.

Since
  1.15

See also
  ecore_buffer_provider_consumer_del_cb_set()

## Ecore_Buffer_Provider_Enqueue_Cb

typedef void(* Ecore_Buffer_Provider_Enqueue_Cb) (Ecore_Buffer_Provider *provider, void *data)

Called whenever a Ecore_Buffer is released.

Since
  1.15

See also
  ecore_buffer_provider_buffer_released_cb_set()

## Enumeration Type Documentation

## _Ecore_Buffer_Return

enum _Ecore_Buffer_Return

Types for an buffer queue state on provider side.

See also
  ecore_buffer_provider_buffer_acquire()
  ecore_buffer_provider_buffer_acquirable_check()

## Function Documentation

## ecore_buffer_provider_new()

EAPI Ecore_Buffer_Provider * ecore_buffer_provider_new | ( | const char * | name | ) |

Creates a new Buffer Provider based on name.

Since
  1.15

Parameters

  [in] | name | The name of Buffer_Queue.

Returns
  Ecore_Buffer_Provider instance or `NULL` if creation failed.

References DBG, EINA_SAFETY_ON_NULL_RETURN_VAL, and ERR.

## ecore_buffer_provider_free()

EAPI void ecore_buffer_provider_free | ( | Ecore_Buffer_Provider * | provider | ) |

Frees an Ecore_Buffer_Provider.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider to free

This frees up any memory used by the Ecore_Buffer_Provider.

References DBG, EINA_LIST_FOREACH, and EINA_SAFETY_ON_NULL_RETURN.

## ecore_buffer_provider_buffer_acquire()

EAPI Ecore_Buffer_Return ecore_buffer_provider_buffer_acquire | ( | Ecore_Buffer_Provider * | provider,
|  | Ecore_Buffer ** | ret_buf )

Returns the Ecore_Buffer released by consumer or State of Queue.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider to request for buffer
  [out] | ret_buf | A Pointer to the Ecore_Buffer

Returns
  The enumeration of Ecore_Buffer_Return to indicate result of Dequeuing.

This function gives you drawable buffer and inform you the state of Queue. Each return value of enumeration has meaning as below.

- ECORE_BUFFER_RETURN_ERROR, means error occurred.
- ECORE_BUFFER_RETURN_SUCCESS, means success to dequeue, therefore ret_buf is valid.
- ECORE_BUFFER_RETURN_EMPTY, means queue is empty, not available slot in Queue. in other words, there is no free drawable buffer in Queue.
- ECORE_BUFFER_RETURN_NEED_ALLOC, means that there is available slot, but not allocated. so, You may create new Ecore_Buffer, and then just enqueue the Ecore_Buffer.

See also
  ecore_buffer_new(), ecore_buffer_provider_buffer_enqueue()

References DBG, EINA_SAFETY_ON_NULL_RETURN_VAL, and ERR.

## ecore_buffer_provider_buffer_enqueue()

EAPI Eina_Bool ecore_buffer_provider_buffer_enqueue | ( | Ecore_Buffer_Provider * | provider,
|  | Ecore_Buffer * | buffer )

Submits the Ecore_Buffer to Consumer to request compositing.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider connected with consumer.
  [in] | buffer | The Ecore_Buffer to submit

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise.

This function allow you to submit the Ecore_Buffer to consumer to request compositing. And this will be success, in case only you submit dequeued Ecore_Buffer, and new Ecore_Buffer after received return value of ECORE_BUFFER_RETURN_NEED_ALLOC by ecore_buffer_provider_buffer_acquire().

See also
  ecore_buffer_new(), ecore_buffer_provider_buffer_dequeue()

References DBG, EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_TRUE, and ERR.

## ecore_buffer_provider_buffer_acquirable_check()

EAPI Ecore_Buffer_Return ecore_buffer_provider_buffer_acquirable_check | ( | Ecore_Buffer_Provider * | provider | ) |

Checks if state of queue.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider to query

- ECORE_BUFFER_RETURN_NOT_EMPTY, means there is a dequeueable Ecore_Buffer at least one.
- ECORE_BUFFER_RETURN_EMPTY, means queue is empty, not available slot in Queue. in other words, there is no free drawable buffer in Queue.
- ECORE_BUFFER_RETURN_NEED_ALLOC, means that there is available slot, but not allocated. so, You may create new Ecore_Buffer, and then just enqueue the Ecore_Buffer.

Returns
  `EINA_TRUE` means queue is empty, `EINA_FALSE` otherwise.

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ecore_buffer_provider_consumer_add_cb_set()

EAPI void ecore_buffer_provider_consumer_add_cb_set | ( | Ecore_Buffer_Provider * | provider,
|  | Ecore_Buffer_Provider_Consumer_Add_Cb | func,
|  | void * | data )

Sets a callback for consumer connection events.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider to set callbacks on
  [in] | func | The function to call
  [in] | data | A pointer to the user data to store.

A call to this function will set a callback on an Ecore_Buffer_Provider, causing `func` to be called whenever `provider` is connected with consumer.

References EINA_SAFETY_ON_NULL_RETURN.

## ecore_buffer_provider_consumer_del_cb_set()

EAPI void ecore_buffer_provider_consumer_del_cb_set | ( | Ecore_Buffer_Provider * | provider,
|  | Ecore_Buffer_Provider_Consumer_Del_Cb | func,
|  | void * | data )

Sets a callback for consumer disconnection events.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider to set callbacks on
  [in] | func | The function to call
  [in] | data | A pointer to the user data to store.

A call to this function will set a callback on an Ecore_Buffer_Provider, causing `func` to be called whenever `provider` is disconnected with consumer.

References EINA_SAFETY_ON_NULL_RETURN.

## ecore_buffer_provider_buffer_released_cb_set()

EAPI void ecore_buffer_provider_buffer_released_cb_set | ( | Ecore_Buffer_Provider * | provider,
|  | Ecore_Buffer_Provider_Enqueue_Cb | func,
|  | void * | data )

Sets a callback for released buffer events.

Since
  1.15

Parameters

  [in] | provider | The Ecore_Buffer_Provider to set callbacks on
  [in] | func | The function to call
  [in] | data | A pointer to the user data to store.

A call to this function will set a callback on an Ecore_Buffer_Provider, causing `func` to be called whenever `provider` has received Ecore_Buffer released from provider.

You may success dequeue the Ecore_Buffer after this callback called.

References EINA_SAFETY_ON_NULL_RETURN.