summaryrefslogtreecommitdiff
path: root/sys/msdk/gstmsdkallocator_libva.c
Commit message (Collapse)AuthorAgeFilesLines
* gstmsdkvpp: add RGBP and BGRP in src padHaihao Xiang2021-07-051-0/+31
| | | | | | It requires MFX version 2.4+ Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2234>
* msdk: call vaExportSurfaceHandle() to get DMABuf FDHaihao Xiang2020-09-291-26/+40
| | | | | | | Compared to vaAcquireBufferHandle(), vaExportSurfaceHandle() may provide the handle details, so we needn't call vaDeriveImage(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1353>
* msdk: map Y412_LE to VA_FOURCC_Y416Haihao Xiang2020-04-031-0/+4
| | | | | In media driver, VA_FOURCC_Y416 is used for packed 12 bits 4:4:4:4 YUV format, the corresponding RT format is VA_RT_FORMAT_YUV442_12
* msdk: map MFX_FOURCC_Y416 to VA_FOURCC_Y416Haihao Xiang2020-04-031-0/+10
| | | | | Y416 is used for packed 12 bits 4:4:4:4 YUV format in media driver, the RT format is VA_RT_FORMAT_YUV444_12
* msdk: map Y212_LE to VA_FOURCC_Y216Haihao Xiang2020-04-031-0/+4
| | | | | In media driver, VA_FOURCC_Y216 is used for packed 12 bits 4:2:2 YUV format, the corresponding RT format is VA_RT_FORMAT_YUV422_12
* msdk: map MFX_FOURCC_Y216 to VA_FOURCC_Y216Haihao Xiang2020-04-031-0/+4
| | | | | In media driver, Y216 is used for packed 12 bits 4:2:2 format YUV format, so the RT format is VA_RT_FORMAT_YUV422_12.
* msdk: map P012_LE to VA_FOURCC_P016Haihao Xiang2020-03-231-0/+4
| | | | | In media driver, VA_FOURCC_P016 is used for semi-planar 12 bits YUV format, the corresponding RT format is VA_RT_FORMAT_YUV420_12
* msdk: map MFX_FOURCC_P016 to VA_FOURCC_P016Haihao Xiang2020-03-231-0/+6
| | | | | P016 is used for semi-planar 12 bits format in the media driver, so the RT format is VA_RT_FORMAT_YUV420_12
* msdk: libva: Don't set the hint if MFX_VERSION is lower than 1025Haihao Xiang2020-02-241-0/+2
| | | | | MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET is defined since MFX_VERSION 1025.
* documentation: fixed a heap o' typosAaron Boxer2019-11-051-1/+1
|
* msdk: support for MFX_FOURCC_BGR4 frame allocationHaihao Xiang2019-11-021-6/+26
| | | | | | | | MFX_FOURCC_BGR4 is mapped to VA_FOURCC_ABGR and JPEG encoder needs a MFX_FOURCC_BGR4 frame for internal usage when the input format is MFX_FOURCC_RGB4 This is a preparation for supporting native formats of JPEG encoder
* msdk: return the right pointerHaihao Xiang2019-10-111-4/+4
| | | | | | | | The first channel in memory for MFX_FOURCC_RGB4 (VA_FOURCC_ARGB or GST_VIDEO_FORMAT_BGRA) is B, not A. In MSDK, channle B is used to access data for RGB4 surface. In addition, the returned pointers for MFX_FOURCC_AYUV and MFX_FOURCC_Y410 in gst_msdk_video_memory_map_full were wrong too before this fix.
* msdk: fix for mfx frame alloc responseHaihao Xiang2019-09-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | Both MSDK and this plugin use mfxFrameAllocResponse for video and DMABuf memory, it is possible that some GST buffers are still in use when calling gst_msdk_frame_free, so add a reference count in the wrapper of mfxFrameAllocResponse (GstMsdkAllocResponse) to make sure the underlying mfx resources are still available if the corresponding buffer pool is in use. In addtion, currently all allocators for input or output share the same mfxFrameAllocResponse pointer in an element, so it is possible that the content of mfxFrameAllocResponse is updated for a new caps then all GST buffers allocated from an old allocator will use this new content of mfxFrameAllocResponse, which will result in unexpected behavior. In this fix, we save the the content of mfxFrameAllocResponse in the corresponding tructure to avoid such issue Sample pipeline: gst-launch-1.0 filesrc location=vp9_multi_resolutions.ivf ! ivfparse ! msdkvp9dec ! msdkvpp ! video/x-raw\(memory:DMABuf\),format=NV12 ! glimagesink
* msdk: don't cache mfxFrameAllocResponse pointerHaihao Xiang2019-09-211-4/+3
| | | | | | Otherwise it is possible that different wrappers share the same mfxFrameAllocResponse pointer, so instead of caching the pointer, we may cache the content of mfxFrameAllocResponse
* msdk: Don't use VA_RT_FORMAT_YUV420_10 if it's undefinedYeongjin Jeong2019-08-251-0/+8
| | | | | | ../sys/msdk/gstmsdkallocator_libva.c:99:16: error: ‘VA_RT_FORMAT_YUV420_10’ The minimum required version seems to VA_API_VERSION >= 1.2.0
* msdk: workaround for MFX_FOURCC_VP9_SEGMAP surfaceHaihao Xiang2019-07-071-0/+10
| | | | | | | | | MFX_FOURCC_VP9_SEGMAP surface in MSDK is an internal surface however MSDK still call the external allocator for this surface, so this plugin has to return UNSUPPORTED and force MSDK allocates surface using the internal allocator. See https://github.com/Intel-Media-SDK/MediaSDK/issues/762 for details
* msdk: set parameters in mfxFrameData for a MFX_FOURCC_Y410 frameHaihao Xiang2019-06-291-0/+4
|
* msdk: map MFX_FOURCC_Y410 to VA_FOURCC_Y410Haihao Xiang2019-06-291-0/+2
|
* msdk: map GST_VIDEO_FORMAT_Y410 to VA_FOURCC_Y410Haihao Xiang2019-06-291-0/+4
|
* msdk: set parameters in mfxFrameData for a MFX_FOURCC_Y210 frameHaihao Xiang2019-06-291-0/+9
|
* msdk: map MFX_FOURCC_Y210 to VA_FOURCC_Y210Haihao Xiang2019-06-291-0/+5
|
* msdk: map GST_VIDEO_FORMAT_Y210 to VA_FOURCC_Y210Haihao Xiang2019-06-291-0/+6
|
* msdk: fix the build error with libva 2.4.0Haihao Xiang2019-04-171-0/+6
| | | | This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/949
* msdk: set some parameters in mfxFrameData for a MFX_FOURCC_A2RGB10 frameHaihao Xiang2019-04-091-1/+7
|
* msdk: map MFX_FOURCC_A2RGB10 to VA_FOURCC_A2R10G10B10Haihao Xiang2019-04-091-0/+3
|
* msdk: map GST_VIDEO_FORMAT_BGR10A2_LE to VA_FOURCC_A2R10G10B10Haihao Xiang2019-04-091-1/+4
|
* msdk: set some parameters in mfxFrameData for a MFX_FOURCC_AYUV frameHaihao Xiang2019-03-251-0/+9
|
* msdk: map GST_VIDEO_FORMAT_VUYA to VA_FOURCC_AYUVHaihao Xiang2019-03-251-0/+5
|
* mskd: Don't use MFX_FOURCC_RGB565 if it's undefinedSeungha Yang2019-03-011-0/+4
| | | | | | ../subprojects/gst-plugins-bad/sys/msdk/msdk.c(61): error C2065: 'MFX_FOURCC_RGB565' The minimum required version for the format seems to MFX_VERSION >= 1028
* msdk: set some parameters in mfxFrameData for a RGB16 frameHaihao Xiang2019-02-271-0/+6
|
* msdk: map GST_VIDEO_FORMAT_RGB16 to VA_FOURCC_RGB565Haihao Xiang2019-02-271-0/+4
|
* msdk: don't destroy an image twiceHaihao Xiang2019-02-241-2/+19
| | | | | | | | | | | This gets rid of annoying message in the log, e.g. run the pipeline below: gst-launch-1.0 videotestsrc num-buffers=100 ! \ video/x-raw,format=NV12,width=352,height=288 ! msdkh264enc ! filesink \ location=test.h264 [LIBVA]:CRITICAL - DdiMedia_DestroyImage:4357: Invalid image
* msdk: map GST_VIDEO_FORMAT_UYVY to VA_FOURCC_UYVYHaihao Xiang2019-02-191-0/+4
|
* msdk: don't reset the external frame allocatorHaihao Xiang2019-01-081-2/+1
| | | | | | | | | | | In gst-msdk, a mfx session may be shared between different gst elements, each element tries to set the frame allocator. However, per the MSDK documation[1], the behavior is undefined if reset the frame allocator while the previous allocator is in use. Fortunately all elements use the same frame allocator, so we can avoid to call MFXVideoCORE_SetFrameAllocator again. [1]: https://software.intel.com/en-us/node/628430#MFXVideoCORE3
* msdk: adjust the RT format for P010 surfaceXiang, Haihao2018-11-261-0/+3
| | | | | According to VA API, VA_RT_FORMAT_YUV420_10 is expected for P010 surface
* msdk: create VA_FOURCC_P010 surface from dmabufXiang, Haihao2018-11-261-0/+4
|
* msdk: VA_FOURCC_P010 frame lockXiang, Haihao2018-11-261-0/+1
| | | | | P010 and NV12 have the same layout, so we may reuse the code in gst_msdk_frame_lock()
* msdk: add an assert in gst_msdk_frame_lock() for unhandled formatsXiang, Haihao2018-11-261-0/+3
| | | | | We will add support for more formats, e.g. P010, Adding an assert here may catch the error early
* msdk: Add method to replace internal VASurface of mfxFrameSurfaceSreerenj Balachandran2018-05-301-0/+64
| | | | | | | | Added a utility method to replace the MemID (interanl VASurfaceID) associated with the mfxFrameSurface. This is usefull for dmabuf-import where we need to replace the memID dynamically https://bugzilla.gnome.org/show_bug.cgi?id=794817
* msdk: Add method to export dmabuf to VASurfaceSreerenj Balachandran2018-05-301-0/+91
| | | | | | | | | Exporting DRM_PRIME fd to VASurface requires direct invocation of VA api VACreateSurface with VASurfaceAttribExternalBufferDescriptor and other necessary surface attributes. https://bugzilla.gnome.org/show_bug.cgi?id=794817
* msdk: allocator: libva: check if it's already using dmabuf when mappingHyunjun Ko2018-04-021-0/+5
| | | | | | | As long as we negotiate the "DMABuf" capsfeatures for now, map can't be working. So we need to confirm not to do it if using DMABuf memory. https://bugzilla.gnome.org/show_bug.cgi?id=793707
* msdk: adds new function to get dmabuf information from surface.Hyunjun Ko2018-03-301-0/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=793707
* msdk: allocator: get dmabuf handle during allocation if requiredHyunjun Ko2018-03-301-0/+31
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=793707
* msdk: specify the way to find a proper cached response by requestHyunjun Ko2018-03-301-0/+4
| | | | | | | | | | The current way to find proper response by just comparing request's value is wrong. We need to compare the size of a frame and the number of suggested frames. Refer to the sample in https://github.com/Intel-Media-SDK/samples. https://bugzilla.gnome.org/show_bug.cgi?id=793707
* msdk: adds frame allocator using libvaHyunjun Ko2018-02-131-0/+319
Implements msdk frame allocator which is required from the driver. Also makes these functions global so that GstMsdkAllocator could use the allocated video memory later and couple with GstMsdkMemory. GstMsdkContext keeps allocation information such as mfxFrameAllocRequest and mfxFrameAllocResponse after allocation. https://bugzilla.gnome.org/show_bug.cgi?id=790752