summaryrefslogtreecommitdiff
path: root/gst
Commit message (Collapse)AuthorAgeFilesLines
* vaapi: decoder: modify the condition to judge whether dma buffer is supportedZhang Yuankun2021-08-261-3/+4
| | | | | | | | | | | | | | It seems "GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode)" will return false even if this platform support the mem_type dma buffer. And media-driver will return GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2 on Gen12(such as TGL). Without this patch, The command such as: gst-launch-1.0 videotestsrc num-buffers=100 ! video/x-raw, format=I420 ! \ x264enc ! h264parse ! vaapih264dec ! video/x-raw\(memory:DMABuf\) ! fakesink will return not-negotiated. Signed-off-by: Zhang Yuankun <yuankunx.zhang@intel.com> Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/437>
* Display: Add a property to export the VA display handle.He Junyan2021-08-251-0/+3
| | | | | | | | Just like what we do in VA plugins. The display can be seen as a generic gst object and we can add a property to get the internal VA handle. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/435>
* plugins: video memory: Add a GST_MAP_VAAPI flag to peek the surface.He Junyan2021-08-252-2/+16
| | | | | | | | | Just like what we do in VA plugins, the GST_MAP_VAAPI can directly peek the surface of the VA buffers. The old flag 0 just peek the surface proxy, which may not be convenient for the users who do not want to include our headers. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/435>
* Revert "vaapi: Demote vaapidecodebin to rank NONE."Víctor Manuel Jáquez Leal2021-07-092-7/+7
| | | | | | This reverts commit 7a25c5d4ec95aefeca6515ac023b23c5dd330194. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/436>
* plugins: encode: fix a deadlock because of _drain()He Junyan2021-07-011-25/+24
| | | | | | | | | | | We call gst_vaapiencode_drain() in gst_vaapiencode_change_state(), whose context does not hold the stream lock of the encoder. The current gst_vaapiencode_drain inside unlock/lock pair adds a extra lock count to the stream lock of encoder and causes hang later. We just remove the gst_vaapiencode_drain() and expand its logic correctly according to the lock/unlock context. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/433>
* vaapi: Demote vaapidecodebin to rank NONE.Víctor Manuel Jáquez Leal2021-05-212-7/+7
| | | | | | | | | | One of the main reasons of vaapidecodebin was because it mitigated the possible surface exhaustion. But that problem is currently solved. Nowadays, vaapidecodebin brings more problems than it solves. Thus this patch demotes vaapidecodebin to NONE rank while bumping PRIMARY + 1 the most common decoders. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/426>
* plugins: Demote rank of vaapipostproc and vaapioverlay.Víctor Manuel Jáquez Leal2021-05-202-3/+3
| | | | | | | | | | | Since almost all video filters have rank NONE, these both elements should be NONE too. This is useful for autovideoconvert and other bins, and users might force to use these by setting the environment variable GST_PLUGIN_FEATURE_RANK. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/429>
* gst: don't use volatile to mean atomicMatthew Waters2021-03-195-8/+8
| | | | | | | | | | | | volatile is not sufficient to provide atomic guarantees and real atomics should be used instead. GCC 11 has started warning about using volatile with atomic operations. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/418>
* plugins: postproc: Fix a problem of propose_allocation when passthrough.He Junyan2021-02-041-0/+7
| | | | | | | | | | | | We should query the downstream element to answer a precise allocation query when the passthrough mode is enabled. The current way still decides the allocation by the postproc itself. The pipeline such as: gst-launch-1.0 -v filesrc location=xxx.264 ! h264parse ! vaapih264dec ! \ vaapipostproc ! fakevideosink silent=false sync=true will lose some info such as the GST_VIDEO_META_API_TYPE. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/413>
* libs: display: drm: support gst.vaapi.app.Display context for drm backendHaihao Xiang2021-01-291-0/+12
| | | | | | | | Attributes for drm backend: - va-display : ponter of VADisplay - drm-device-fd : the DRM device file descriptor Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/409>
* libs: decoder: AV1: Add the av1 decoder support.He Junyan2021-01-061-1/+11
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/191>
* vaapi: use gst_clear_object instead of g_clear_objectVíctor Manuel Jáquez Leal2020-12-123-13/+13
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/406>
* plugins: encode: unlock the stream lock before _flush()He Junyan2020-12-111-1/+6
| | | | | | | | | | | | | | The current encoder will hang when EOS comes. When we call the gst_vaapi_encoder_encode_and_queue(), we should release the stream lock, just like what we do in gst_vaapiencode_handle_frame(). The deadlock happens when: The input thread holding the stream lock is using gst_vaapi_encoder_create_coded_buffer() to acquire a coded buffer, while the output thread which holding the coded buffer resource is acquiring the stream lock in _push_frame() to push the data to down stream element. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/404>
* plugin: encode: vp9: Implement the set_config().He Junyan2020-11-301-0/+80
| | | | | | We store the allowed profiles list to encoder in set_config(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/380>
* plugin: encode: vp9: Add the profile into output caps.He Junyan2020-11-301-0/+6
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/380>
* libs: decoder: H265: Add MAIN_422_12 profile supporting.He Junyan2020-11-271-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/390>
* libs: decoder: H265: Add MAIN_444_12 profile supporting.He Junyan2020-11-271-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/390>
* decoder: don't reply src caps query with allowed if pad is fixedVíctor Manuel Jáquez Leal2020-09-201-15/+21
| | | | | | | | | | | | If the pad is already fixed the caps query have to be reply with the current fixed caps. Otherwise the query has to be replied with the autogeneratd src caps. This path fix this by falling back to the normal caps query processing if the pad is already fixed. Otherwise it will fetch the allowed src pad caps. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/397>
* plugins: decode: fix a DMA caps typo in ensure_allowed_srcpad_caps.He Junyan2020-09-151-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/392>
* vaapisink: when updating the caps, reset rotationMarc Leeman2020-09-091-0/+3
| | | | | | | | When an element upstream changes settings (e.g. crop), new caps are sent to vaapisink. When vaapisink was rotating the image, it needs to re-evaluate if the sink needs to rotate the image. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/389>
* plugin: decode: Fix two mem leaks because of caps.He Junyan2020-08-171-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/385>
* plugin: allocator: No need to ref allocator when create mem.He Junyan2020-08-161-2/+1
| | | | | | | | We do not need to ref the allocator when creating GstVaapiVideoMemory kind memory, and then release it in _free(). The framework already does it for us. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/383>
* vaapiencode: h264: ignore level without breaking negotiationVíctor Manuel Jáquez Leal2020-08-141-6/+1
| | | | | | | | | | | | | | Since commit 9f627ef2 if the user sets level in the encoder src caps the caps negotiation is rejected. But since the same commit the same encoder set the autoconfigured level in caps. Some change in the base class might fixed the operation order so now the caps are set and later negotiated. This patch removes the level check. Fixes: #273 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/382>
* plugins: remove gst_vaapi_plugin_base_get_allowed_srcpad_raw_caps()Víctor Manuel Jáquez Leal2020-08-122-61/+21
| | | | | | | | | | | | | Since nobody uses it, just remove it. Thus extract_allowed_surface_formats() is refactored to attend only gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps(). Now a surface is created when the image chorma is different from the previous one. And if the driver has the quirk, it outputs all the supported image formats without trying them. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/381>
* vaapidecode: expose raw src caps with same chromaVíctor Manuel Jáquez Leal2020-08-121-9/+41
| | | | | | | | | | | | | | | The try-and-error approach for getting the possible image formats from a surface has brought several problems in different drivers, from crashes to drop in performance. Instead of that we change the algorithm to determine the possible image formats based in the surface chroma: only those available image formats with same chroma are exposed as possible raw caps. Do this is important to avoid performance degrading in raw sinks which doesn't handle NV12 but it does YV12 or I420. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/381>
* build: update for gl pkg-config file splitVíctor Manuel Jáquez Leal2020-08-071-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/378>
* libs: window: implements gst_vaapi_window_set_render_rectangleHyunjun Ko2020-07-311-0/+6
| | | | | | | | | | | | | Implements new vmethod gst_vaapi_window_set_render_rectangle, which is doing set the information of the rendered rectangle set by user. This is necessary on wayland at least to get exact information of external surface. And vaapisink calls this when gst_video_overlay_set_render_rectangle is called. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/342>
* vaapisink: implements gst_vaapisink_wayland_create_window_from_handle()Hyunjun Ko2020-07-311-0/+20
| | | | | | | Implements gst_vaapisink_wayland_create_window_from_handle() to support using external wl_surface. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/342>
* plugins: add gst_vaapi_caps_set_width_and_height_range()Víctor Manuel Jáquez Leal2020-07-313-48/+40
| | | | | | | | | | | This utility function is called internally by gst_vaapi_build_caps_from_formats() and can be used outside. This function sets frame size and framerates ranges. Also gst_vaapi_build_caps_from_formats() is simplified. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/374>
* plugins: encode: h265: set all allowed profiles to encoder.He Junyan2020-07-301-8/+62
| | | | | | | | We should collect all allowed profiles and pass them to the inside encoder, rather than just calculate the max profile idc. The allowed profiles should also be supported by the HW. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/349>
* plugins: encode: h265: collect all allowed profiles to encoder.He Junyan2020-07-301-65/+9
| | | | | | | We should collect all allowed profiles and pass them to the inside encoder, rather than just calculate the max profile idc. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/349>
* libs: encoder: h265: modify set_max_profile to set_allowed_profiles.He Junyan2020-07-301-1/+1
| | | | | | | | | | | In h265, bigger profile idc may not be compatible with the small profile idc. And more important, there are multi profiles with the same profile idc. Such as main-422-10, main-444 and main-444-10, they all have profile idc 4. So recording the max profile idc is not enough, the encoder needs to know all allowed profiles when deciding the real profile. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/349>
* vaapipostproc: early return if fixate srcpad caps failsVíctor Manuel Jáquez Leal2020-07-291-1/+4
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/371>
* vaapipluginutil: simplify gst_vaapi_find_preferred_caps_feature()Víctor Manuel Jáquez Leal2020-07-291-20/+10
| | | | | | | Generalize the way how the preferred color format is chosen. Also use new GStreamre API as syntatic sugar. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/370>
* libs: profile: Use get_codec_from_caps to get codec type.He Junyan2020-07-292-10/+3
| | | | | | | | There is no need to get a profile from the caps and then convert that profile into codec type. We can get the codec type by caps's name easily. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/358>
* plugins: encode: vp9: Implement vp9's allowed_profiles() func.He Junyan2020-07-291-1/+12
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/188>
* plugin: util: rename h26x_encoder_get_profiles_from_caps().He Junyan2020-07-294-7/+6
| | | | | | | Change its name to encoder_get_profiles_from_caps(). Other codecs such as VP9 also needs to use this function. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/188>
* vaapidecode: always merge profile caps in sink capsVíctor Manuel Jáquez Leal2020-07-291-2/+2
| | | | | | | | | | | This commit fixes a regression of e962069d, where if the profile's caps doesn't have a caps profile, it's ignored. This patch add a conditional jump if the caps doesn't have a profile field to merge it. Fixes: #271 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/368>
* vaapidecode: dma caps only use reported color formatVíctor Manuel Jáquez Leal2020-07-271-3/+3
| | | | | | | | | | This fix pipelines without vaapipostproc after vaapi decoder, such as gst-launch-1.0 filesrc location=~/file.mp4 ! parsebin ! vaapih264dec ! glimagesink On EGL platforms, so DMABuf is used. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/366>
* vaapidecode: use allowed srcpad caps for caps queryVíctor Manuel Jáquez Leal2020-07-271-2/+1
| | | | | | | | Instead of using just the template caps use the current allowed srcpad caps, which is created considering the current decoder context. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/366>
* vaapidecode: build allowed srcpad caps from va contextVíctor Manuel Jáquez Leal2020-07-271-23/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating allowed srcpad caps with generic information, now it takes the size an formats limits from the decoder's context. This is possible since srcpad caps are generated after the internal decoder is created. The patch replaces gst_vaapi_decoder_get_surface_formats() with gst_vaapi_decoder_get_suface_attributes(). From these attributes, formats are only used for VASurface memory caps feature. For system memory caps feature, the old gst_vaapi_plugin_get_allowed_srcpad_caps() is still used, since i965 jpeg decoder cannot deliver mappable format for gstreamer. And for the other caps features (dmabuf and texture upload) the same static list are used. This patch also adds DMABuf caps feature only if the context supports that memory type. Nonetheless, we keep the pre-defined formats since they are the subset of common derive formats formats supported either by amd/gallium and both intel drivers, since, when exporting the fd through vaAcquireBufferHandle()/ vaReleaseBufferHandle(), the formats of the derivable image cannot be retriebable from the driver. Later we'll use the attribute formats for the DMABuf feature too, when the code be ported to vaExportSurfaceHandle(). Finally, the allowed srcpad caps are removed if the internal decoder is destroyed, since context attribues will change. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/366>
* vaapidecode: reorder src caps templateVíctor Manuel Jáquez Leal2020-07-271-4/+4
| | | | | | | | | | Since negotiation depends on caps order, first is VA, then DMABuf, later GLUploadTexture (deprecated) and finally raw. Also, for decoders, the possible available color formats for DMABuf is extended to all the possible VA color formats. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/366>
* postproc: reconfigure after changing cropping valuesMarc Leeman2020-07-241-0/+16
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/365>
* plugin: encode: Add static caps for template documentation.He Junyan2020-07-237-24/+90
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>
* plugin: encode: vp9: Use the dynamically built src template caps.He Junyan2020-07-231-14/+4
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>
* plugin: encode: vp8: Use the dynamically built src template caps.He Junyan2020-07-231-15/+5
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>
* plugin: encode: jpeg: Use the dynamically built src template caps.He Junyan2020-07-231-15/+5
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>
* plugin: encode: mpeg2: Use the dynamically built src template caps.He Junyan2020-07-231-15/+5
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>
* plugin: encode: h265: Use the dynamically built src template caps.He Junyan2020-07-231-16/+5
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>
* plugin: encode: h264: Use the dynamically built src template caps.He Junyan2020-07-231-17/+6
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/354>