From 4fee49aa43b838411eb755033d0e4ec56c0b2446 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Sat, 14 Mar 2020 22:31:01 +0800 Subject: [PATCH] add argument offset to drmCreateDCFromXXX functions --- include/gdi.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/include/gdi.h b/include/gdi.h index fc3b8ce0..a9fb0c45 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -14364,7 +14364,9 @@ typedef struct _DrmSurfaceInfo { /** The DRM pixel format. */ uint32_t drm_format; /** Size in bytes of the buffer object. */ - unsigned long size; + size_t size; + /** The offset from the buffer start to the real pixel data. */ + off_t offset; } DrmSurfaceInfo; /** @@ -14386,6 +14388,7 @@ MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info); * \param video The video handle. * \param name The name handle of the DRM surface. * \param drm_format The DRM pixel format. + * \param offset The offset from the buffer start to the real pixel data. * \param width The width of the DRM surface. * \param height The height of the DRM surface. * \param pitch The pitch (row stride) of the DRM surface. @@ -14393,8 +14396,8 @@ MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info); * \return The handle to the memory DC for success, HDC_INVALID for failure. */ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video, - uint32_t name, uint32_t drm_format, - unsigned int width, unsigned int height, uint32_t pitch); + uint32_t name, uint32_t drm_format, off_t offset, + uint32_t width, uint32_t height, uint32_t pitch); /** * This function creates a memory DC with a DRM surface which is created by @@ -14404,6 +14407,7 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video, * \param prime_fd The PRIME file descriptor. * \param size The size of the DRM surface in bytes. * \param drm_format The DRM pixel format. + * \param offset The offset from the buffer start to the real pixel data. * \param width The width of the DRM surface. * \param height The height of the DRM surface. * \param pitch The pitch (row stride) of the DRM surface. @@ -14411,8 +14415,8 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video, * \return The handle to the memory DC for success, HDC_INVALID for failure. */ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video, - int prime_fd, unsigned long size, uint32_t drm_format, - unsigned int width, unsigned int height, uint32_t pitch); + int prime_fd, size_t size, uint32_t drm_format, off_t offset, + uint32_t width, uint32_t height, uint32_t pitch); /** * This function creates a memory DC with a DRM surface which is created by @@ -14422,6 +14426,7 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video, * \param handle The handle of the DRM surface. * \param size The size of the DRM surface in bytes. * \param drm_format The DRM pixel format. + * \param offset The offset from the buffer start to the real pixel data. * \param width The width of the DRM surface. * \param height The height of the DRM surface. * \param pitch The pitch (row stride) of the DRM surface. @@ -14429,8 +14434,8 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video, * \return The handle to the memory DC for success, HDC_INVALID for failure. */ MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video, - uint32_t handle, unsigned long size, uint32_t drm_format, - unsigned int width, unsigned int height, uint32_t pitch); + uint32_t handle, size_t size, uint32_t drm_format, off_t offset, + uint32_t width, uint32_t height, uint32_t pitch); /** @} end of gdi_drm_fns */