Mir
Classes | Typedefs
android_buffer.h File Reference
#include "mir_toolkit/mir_connection.h"
#include "mir_toolkit/mir_buffer.h"
#include "mir_toolkit/mir_extension_core.h"
Include dependency graph for android_buffer.h:

Go to the source code of this file.

Classes

struct  MirExtensionAndroidBufferV1
 
struct  MirExtensionAndroidBufferV2
 

Typedefs

typedef void(* mir_connection_allocate_buffer_android) (MirConnection *connection, int width, int height, unsigned int hal_pixel_format, unsigned int gralloc_usage_flags, MirBufferCallback available_callback, void *available_context)
 Allocate a MirBuffer usable by the android platform. More...
 
typedef struct MirExtensionAndroidBufferV1 MirExtensionAndroidBufferV1
 
typedef MirBuffer *(* MirConnectionAllocateBufferAndroidSync) (MirConnection *connection, int width, int height, unsigned int hal_pixel_format, unsigned int gralloc_usage_flags)
 Allocate a MirBuffer usable by the android platform and wait for server response. More...
 
typedef bool(* MirBufferIsAndroidCompatible) (MirBuffer const *buffer)
 Check if a MirBuffer is suitable for android usage. More...
 
typedef void(* MirBufferAndroidNativeHandle) (MirBuffer const *buffer, int *num_fds, int const **fds, int *num_data, int const **data)
 Access the data from the native_handle_t of the MirBuffer. More...
 
typedef unsigned int(* MirBufferAndroidHalPixelFormat) (MirBuffer const *buffer)
 Access the HAL_PIXEL_FORMAT of the buffer. More...
 
typedef unsigned int(* MirBufferAndroidGrallocUsage) (MirBuffer const *buffer)
 Access the GRALLOC_USAGE_FLAGS of the buffer. More...
 
typedef unsigned int(* MirBufferAndroidStride) (MirBuffer const *buffer)
 Access the stride in bytes of the buffer. More...
 
typedef void(* MirBufferAndroidIncRef) (MirBuffer *buffer)
 Increase refcount of the ANativeWindowBuffer. More...
 
typedef void(* MirBufferAndroidDecRef) (MirBuffer *buffer)
 Decrease refcount of the ANativeWindowBuffer. More...
 
typedef struct MirExtensionAndroidBufferV2 MirExtensionAndroidBufferV2
 

Typedef Documentation

◆ mir_connection_allocate_buffer_android

typedef void(* mir_connection_allocate_buffer_android) (MirConnection *connection, int width, int height, unsigned int hal_pixel_format, unsigned int gralloc_usage_flags, MirBufferCallback available_callback, void *available_context)

Allocate a MirBuffer usable by the android platform.

The callback will be called when the buffer is available for use. The buffer can be destroyed via mir_buffer_release().

Note
Not all GRALLOC_USAGE flags or HAL_PIXEL_FORMATs are available. Be sure to check mir_buffer_is_valid() on the returned buffer.
Parameters
[in]connectionThe connection
[in]widthRequested buffer width
[in]heightRequested buffer height
[in]hal_pixel_formatThe pixel format, one of Android's HAL_PIXEL_FORMAT*s
[in]gralloc_usage_flagsThe GRALLOC_USAGE* flags for the buffer.
[in]available_callbackThe callback called when the buffer is available
[in]available_contextThe context for the available_callback

◆ MirBufferAndroidDecRef

typedef void(* MirBufferAndroidDecRef) (MirBuffer *buffer)

Decrease refcount of the ANativeWindowBuffer.

Precondition
The buffer is suitable for android use
Parameters
[in]bufferThe buffer

◆ MirBufferAndroidGrallocUsage

typedef unsigned int(* MirBufferAndroidGrallocUsage) (MirBuffer const *buffer)

Access the GRALLOC_USAGE_FLAGS of the buffer.

Precondition
The buffer is suitable for android use
Parameters
[in]bufferThe buffer
Returns
The gralloc_usage of the buffer

◆ MirBufferAndroidHalPixelFormat

typedef unsigned int(* MirBufferAndroidHalPixelFormat) (MirBuffer const *buffer)

Access the HAL_PIXEL_FORMAT of the buffer.

Precondition
The buffer is suitable for android use
Parameters
[in]bufferThe buffer
Returns
The hal_pixel_format of the buffer

◆ MirBufferAndroidIncRef

typedef void(* MirBufferAndroidIncRef) (MirBuffer *buffer)

Increase refcount of the ANativeWindowBuffer.

Precondition
The buffer is suitable for android use
Parameters
[in]bufferThe buffer

◆ MirBufferAndroidNativeHandle

typedef void(* MirBufferAndroidNativeHandle) (MirBuffer const *buffer, int *num_fds, int const **fds, int *num_data, int const **data)

Access the data from the native_handle_t of the MirBuffer.

Warning
Take care not to close any of the fds.
Precondition
The buffer is suitable for android use
Parameters
[in]bufferThe buffer
[out]num_fdsThe number of fds
[out]fdsThe fds
[out]num_dataThe number of data
[out]dataThe data

◆ MirBufferAndroidStride

typedef unsigned int(* MirBufferAndroidStride) (MirBuffer const *buffer)

Access the stride in bytes of the buffer.

Precondition
The buffer is suitable for android use
Parameters
[in]bufferThe buffer
Returns
The stride of the buffer

◆ MirBufferIsAndroidCompatible

typedef bool(* MirBufferIsAndroidCompatible) (MirBuffer const *buffer)

Check if a MirBuffer is suitable for android usage.

Parameters
[in]bufferThe buffer
Returns
True if suitable, false if unsuitable

◆ MirConnectionAllocateBufferAndroidSync

typedef MirBuffer*(* MirConnectionAllocateBufferAndroidSync) (MirConnection *connection, int width, int height, unsigned int hal_pixel_format, unsigned int gralloc_usage_flags)

Allocate a MirBuffer usable by the android platform and wait for server response.

The callback will be called when the buffer is available for use. The buffer can be destroyed via mir_buffer_release().

Note
Not all GRALLOC_USAGE flags or HAL_PIXEL_FORMATs are available. Be sure to check mir_buffer_is_valid() on the returned buffer.
Parameters
[in]connectionThe connection
[in]widthRequested buffer width
[in]heightRequested buffer height
[in]hal_pixel_formatThe pixel format, one of Android's HAL_PIXEL_FORMAT*s
Returns
The buffer

◆ MirExtensionAndroidBufferV1

◆ MirExtensionAndroidBufferV2


Copyright © 2012-2018 Canonical Ltd.
Generated on Mon Feb 19 14:06:43 UTC 2018