Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame^] | 1 | #ifndef DVR_DISPLAY_MANAGER_CLIENT_H_ |
| 2 | #define DVR_DISPLAY_MANAGER_CLIENT_H_ |
| 3 | |
| 4 | #include <stdbool.h> |
| 5 | #include <stddef.h> |
| 6 | #include <stdint.h> |
| 7 | |
| 8 | #ifdef __cplusplus |
| 9 | extern "C" { |
| 10 | #endif |
| 11 | |
| 12 | typedef struct DvrDisplayManagerClient DvrDisplayManagerClient; |
| 13 | typedef struct DvrDisplayManagerClientSurfaceList |
| 14 | DvrDisplayManagerClientSurfaceList; |
| 15 | typedef struct DvrDisplayManagerClientSurfaceBuffers |
| 16 | DvrDisplayManagerClientSurfaceBuffers; |
| 17 | |
| 18 | DvrDisplayManagerClient* dvrDisplayManagerClientCreate(); |
| 19 | |
| 20 | void dvrDisplayManagerClientDestroy(DvrDisplayManagerClient* client); |
| 21 | |
| 22 | // If successful, populates |surface_list| with a list of application |
| 23 | // surfaces the display is currently using. |
| 24 | // |
| 25 | // @return 0 on success. Otherwise it returns a negative error value. |
| 26 | int dvrDisplayManagerClientGetSurfaceList( |
| 27 | DvrDisplayManagerClient* client, |
| 28 | DvrDisplayManagerClientSurfaceList** surface_list); |
| 29 | |
| 30 | void dvrDisplayManagerClientSurfaceListDestroy( |
| 31 | DvrDisplayManagerClientSurfaceList* surface_list); |
| 32 | |
| 33 | // @return Returns the number of surfaces in the list. |
| 34 | size_t dvrDisplayManagerClientSurfaceListGetSize( |
| 35 | DvrDisplayManagerClientSurfaceList* surface_list); |
| 36 | |
| 37 | // @return Return a unique identifier for a client surface. The identifier can |
| 38 | // be used to query for other surface properties. |
| 39 | int dvrDisplayManagerClientSurfaceListGetSurfaceId( |
| 40 | DvrDisplayManagerClientSurfaceList* surface_list, size_t index); |
| 41 | |
| 42 | // @return Returns the stacking order of the client surface at |index|. |
| 43 | int dvrDisplayManagerClientSurfaceListGetClientZOrder( |
| 44 | DvrDisplayManagerClientSurfaceList* surface_list, size_t index); |
| 45 | |
| 46 | // @return Returns true if the client surface is visible, false otherwise. |
| 47 | bool dvrDisplayManagerClientSurfaceListGetClientIsVisible( |
| 48 | DvrDisplayManagerClientSurfaceList* surface_list, size_t index); |
| 49 | |
| 50 | // Populates |surface_buffers| with the list of buffers for |surface_id|. |
| 51 | // |surface_id| should be a valid ID from the list of surfaces. |
| 52 | // |
| 53 | // @return Returns 0 on success. Otherwise it returns a negative error value. |
| 54 | int dvrDisplayManagerClientGetSurfaceBuffers( |
| 55 | DvrDisplayManagerClient* client, int surface_id, |
| 56 | DvrDisplayManagerClientSurfaceBuffers** surface_buffers); |
| 57 | |
| 58 | void dvrDisplayManagerClientSurfaceBuffersDestroy( |
| 59 | DvrDisplayManagerClientSurfaceBuffers* surface_buffers); |
| 60 | |
| 61 | // @return Returns the number of buffers. |
| 62 | size_t dvrDisplayManagerClientSurfaceBuffersGetSize( |
| 63 | DvrDisplayManagerClientSurfaceBuffers* surface_buffers); |
| 64 | |
| 65 | // @return Returns the file descriptor for the buffer consumer at |index|. |
| 66 | int dvrDisplayManagerClientSurfaceBuffersGetFd( |
| 67 | DvrDisplayManagerClientSurfaceBuffers* surface_buffers, size_t index); |
| 68 | |
| 69 | #ifdef __cplusplus |
| 70 | } // extern "C" |
| 71 | #endif |
| 72 | |
| 73 | #endif // DVR_DISPLAY_MANAGER_CLIENT_H_ |