summaryrefslogtreecommitdiff
path: root/gst
AgeCommit message (Collapse)AuthorFilesLines
2020-06-11plugins: pluginbase: Do not destroy display when _close()He Junyan1-1/+2
When the element's state changes to NULL, it can still receive queries, such as the image formats. The display is needed in such queries but not well protected for MT safe. For example, ensure_allowed_raw_caps() may still use the display while it is disposed by gst_vaapi_plugin_base_close() because of the state change. We can keep the display until the element is destroyed. When the state changes to NULL, and then changes to PAUSED again, the display can be correctly set(if type changes), or leave untouched. Fix: #260 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/343>
2020-06-05libs: encoder: h265: Add support for MAIN 4:2:2 10 profile.He Junyan1-1/+1
Using YUY2 as the input of the encoder can generate main 4:2:2 bit streams and using Y210 as the input of the encoder can generate main 4:2:2 10 bit streams. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/334>
2020-06-03doc: Fix wrong link to GstVideoDirectionMethodThibault Saunier1-1/+1
2020-06-03Use gst_type_mark_as_plugin_api() for all non-element plugin typesThibault Saunier1-0/+1
2020-05-21vaapidecoder: h264: remove baseline as constrained propertyVíctor Manuel Jáquez Leal3-26/+3
From now on always the baseline is going to be treated as constrained without need of setting a property. Since the property was added along the development cycle (1.17 / commit 866a9f06) and never released, we assume that it is safe to remove it. Fixes: #252 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/328>
2020-05-18vaapivideobufferpool: fix meta overwriteVíctor Manuel Jáquez Leal1-1/+0
commit 7ac2a207 added a regression by erroneously assumed that GstVaapiVideoMeta is actually a GstMeta, which is not. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/327>
2020-05-17vaapivideopool: Set pooled flag to added metas.Víctor Manuel Jáquez Leal3-15/+16
So this could hint filters how to use these metas. Had to change the return value for texutre upload meta in order to flag it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/326>
2020-05-16plugin: use register_type to replace get_type for encode init.He Junyan1-3/+4
xxx_register_type will detect the template sink caps and is needed to be called at init time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: encode: Modify sink template of vp9 encode.He Junyan2-24/+11
Use gst_vaapi_detect_codec_caps to get more precise template caps. Also implement gst_vaapiencode_vp9_register_type, which should be called at plugin register time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: encode: Modify sink template of vp8 encode.He Junyan2-25/+12
Use gst_vaapi_detect_codec_caps to get more precise template caps. Also implement gst_vaapiencode_vp8_register_type, which should be called at plugin register time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: encode: Modify sink template of mpeg2 encode.He Junyan2-26/+13
Use gst_vaapi_detect_codec_caps to get more precise template caps. Also implement gst_vaapiencode_mpeg2_register_type, which should be called at plugin register time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: encode: Modify sink template of h265 encode.He Junyan2-25/+11
Use gst_vaapi_detect_codec_caps to get more precise template caps. Also implement gst_vaapiencode_h265_register_type, which should be called at plugin register time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: encode: Modify sink template of h264 encode.He Junyan2-25/+12
Use gst_vaapi_detect_codec_caps to get more precise template caps. Also implement gst_vaapiencode_h264_register_type, which should be called at plugin register time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: encode: Modify sink template of jpeg encode.He Junyan2-25/+12
Use gst_vaapi_detect_codec_caps to get more precise template caps. Also implement gst_vaapiencode_jpeg_register_type, which should be called at plugin register time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugin: encode: add a helper macro to register encode type.He Junyan1-0/+78
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugins: util: Add a helper function to detect supported caps.He Junyan2-0/+111
This helper function iterate all profiles and entrypoints belong to the specified codec, query the VAConfigAttribRTFormat and list all possible video formats. This function is used by each codec to get the template sink caps (for encode) or src caps(for decode) at register time, when just all possible formats are listed and no need to be very accurate. So there is no context created for the performance reason. Most codecs just use YUV kinds of formats as the input/output, so we do not include RGB kinds of formats. User can specified more formats in extra_fmts(For example, jpeg may need BGRA) if needed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16plugin: encode: extract the allowed caps maker as a helper function.He Junyan3-36/+70
Extract all logic about making caps for encode's sink as a standalone helper function. It can be reused. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/315>
2020-05-16libs: texture: Make texture a standard GstMiniObject.He Junyan1-5/+7
We store GstVaapiTextureGLX and GstVaapiTextureEGL's private data in the qdata of miniobject and avoid extending the base texture class. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/317>
2020-04-26vaapipluginutil: Use GST_VAAPI_DISPLAY_TYPE_DRM for Mesa3D GBMHaihao Xiang1-0/+5
We may build this plugin with window system support but run it without window system. Without this patch, the following pipeline will trigger a segfault when running it without window system. gst-launch-1.0 filesrc location=input.264 ! h264parse ! vaapih264dec ! fakesink Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/319>
2020-04-04libs,plugin: break surface-bufferproxy circular referenceHe Junyan1-15/+9
The bufferproxy may reference the surface and the surface may also reference the bufferproxy, producing a circular reference, which might lead to serious resource leak problems. Now make the relationship clearer, the bufferproxy's references is transfered to surface, while bufferproxy just keeps the surface's address without increasing its reference count. The surface can be created through a bufferproxy like in gst_vaapi_surface_new_with_dma_buf_handle(), and the surface might get its bufferproxy via gst_vaapi_surface_get_dma_buf_handle(). In both cases the surface holds a bufferproxy's reference.
2020-04-04plugin: bufferpool: use hashmap to cache dmabuf mem-surfaceHe Junyan1-29/+107
The old way of refer memory by bufferproxy is not a good one, since it make the logic error prone. Now it is established a map between surface-bufferproxy and its GstMemory, caching the memory bound by a surface looked for the specified surface.
2020-04-04plugin: bufferpool: Delete ACQUIRE_FLAG_NO_ALLOC flag.He Junyan2-28/+7
Delete the GST_VAAPI_VIDEO_BUFFER_POOL_ACQUIRE_FLAG_NO_ALLOC flag. In fact, no one is using that flag, and all vaapi buffers should have GstVaapiVideoMeta.
2020-04-03vaapipostproc: enable HDR10 tone mappingU. Artie Eoff2-7/+134
2020-04-02libs: encoder: h265: Support MAIN 4:4:4 10 profile.He Junyan1-1/+1
Using Y410 as the input of the encoder can generate main_444_10 bit streams.
2020-03-27vaapivideometa: remove compiler warningVíctor Manuel Jáquez Leal1-2/+2
2020-03-20vaapipostproc: deprecate format, width and size parametersVíctor Manuel Jáquez Leal1-0/+8
Since they should only be controlled by caps negotiation.
2020-03-20libs,plugins: decoder: Add -intra profile support for hevc.He Junyan1-3/+28
In hevc, we can consider the -intra profile a subset of the none -intra profile. The -intra profiles just contain I frames and we definitely can use the none -intra profiles's context to decode them. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2020-03-17plugin: don't error if cannot create displayVíctor Manuel Jáquez Leal1-1/+1
This might generated errors on automatic tools such as CI. Let's rather just raise a warning and let continue.
2020-03-06vaapivideobufferpool: force video meta if sizes are differentU. Artie Eoff1-1/+3
The strides and offsets could be the same, but the allocation size might be different (e.g. alignment). Thus, ensure we also set the flag to copy from VA memory to system memory when alloc size differs. Fixes #243
2020-03-05vaapidecode: don't set base sink caps twiceVíctor Manuel Jáquez Leal1-2/+0
Base class's sink pad caps are already set when calling set_format(). There's no need to call it again in gst_vaapidecode_negotiate().
2020-03-05vaapidecode: unlock stream if caps update failsVíctor Manuel Jáquez Leal1-3/+9
If caps update fail a dead lock occurs since the stream mutex is not unlocked.
2020-02-28Revert "vaapivideomemory: Store surface allocation flags."Víctor Manuel Jáquez Leal1-3/+0
This reverts commit dd428cc4a12c2d5c694fcd3303811cf486002c9d because it rewrites the buffer size whilst surface allocation flags are stored when allocator_params_init() is called since fab890ce. Fix: #239
2020-02-23vaapivideomemory: Try surface with allocation flags.Víctor Manuel Jáquez Leal1-5/+10
When a vaapi allocator is instantiated, it first try to generate a surface with the specified configuration. This patch adds, in this tried buffer, the requested allocation flags.
2020-02-23vaapivideomemory: Store surface allocation flags.Víctor Manuel Jáquez Leal1-0/+3
Store surface allocation flags passed to the vaapi allocator in GObject's qdata, because it might be used by the vaapivideobufferpool when recreating the allocator given any resolution change.
2020-02-21vaapipostproc: do not compensate for crop/direction if no VPPU. Artie Eoff2-25/+34
If we do not have functional VPP, then cropping and video direction is non-functional and we should avoid calling any of the gst_vaapi_filter* APIs.
2020-02-21vaapipostproc: only set VPP colorimetry when VPP is availableU. Artie Eoff1-5/+8
If we don't have functional vpp then we should not call gst_vaapi_filter_set_colorimetry.
2020-02-21videobufferpool: don't reset surface when created internallyHe Junyan3-1/+19
The bug fixing, in commit 89f202ea, just considers the case when surface's DMABuf is set through gst_buffer_pool_acquire_buffer(), which is typically a decoder's behavior. But vaapipostproc doesn't provide any surface when calling gst_buffer_pool_acquire_buffer(), thus a surface is created when GstMemory is allocated. If the surface proxy in buffer's meta is reset at buffer_pool_reset_buffer(), that surface will be destroyed and it won't be available anymore. But GstBuffers are cached in the buffer pool and they are reused again, hence only those images are rendered repeatedly. Fixes: #232
2020-02-21libs: blend: filter: handle finalize() if display isn't assignedVíctor Manuel Jáquez Leal1-1/+2
I've just discovered iHD driver in Skylake doesn't have VideoProc entry point, hence, in this platform, when vaapioverlay is tried to be registered, critical warnings are raised because blend doesn't have a display assigned. As it is possible to have drivers without EntryPointVideoProc it is required to handle it gracefully. This patch does that: only tries to register vaapioverlay if the testing display has VPP and finalize() vmethods, in filter and blend, bail out if display is NULL.
2020-02-16vaapipostproc: demote log message to trace levelVíctor Manuel Jáquez Leal1-1/+1
2020-02-07vaapidecode: don't remove chroma-site nor colorimetryVíctor Manuel Jáquez Leal1-7/+0
Since now they can be handled by vaapipostproc.
2020-02-05vaapipostproc: use sink resolution to calculate src colorimetryU. Artie Eoff1-4/+7
The default output colorimetry is persuaded by the output resolution, which is too naive when doing VPP cropping and/or scaling. For example, scaling 4K(sink)->1080P(src) resolution (i.e. both YUV) results in bt2020(sink)->bt709(src) colorimetry selection and some drivers don't support that mode in vpp. Thus, if output (i.e. downstream) does not specify a colorimetry then we use the input resolution instead of the output resolution to create the default colorimetry. Also, note that we still use the output format since it may be a different color space than the input. As in the example above, this will result in bt2020(sink)->bt2020(src) colorimetry selection and all drivers (afaik) should support that in vpp.
2020-02-05vaapipostproc: set srcpad colorimetry unconditionallyU. Artie Eoff1-2/+2
We always need a srcpad colorimetry for VAAPI VPP operations. Also, check the return value of _set_colorimetry.
2020-02-05vaapipostproc: do not override explicit srcpad colorimetryU. Artie Eoff1-1/+5
If colorimetry has been set by a capsfilter (e.g. vaapipostproc ! video/x-raw,colorimetry=bt709) then don't try to override it. Previously, the aforementioned capsfilter will fail to negotiate if default colorimetry is not the same as the capsfilter (e.g. 4K resolutions).
2020-02-05vaapipostproc: set vpp filter colorimetryU. Artie Eoff1-1/+5
Set the input and output colorimetry for vpp filter.
2020-02-02vaapivideobufferpool: dmabuf implies allocatorVíctor Manuel Jáquez Leal1-9/+4
Some code can be optimized since only if the dmabuf allocator is set, the internal flag of dmabuf is TRUE, thus there's no need to evaluate the allocator address.
2020-02-02vaapivideobufferpool: reject configuration if allocator isn't vaapiVíctor Manuel Jáquez Leal1-8/+2
If the requested allocator in set_config() is not a VAAPI valid one, reject the configuration, instead of lying and using a private one. This patch superseeds !254 and !24
2020-02-02vaapivideobufferpool: add explanation for allocator reconfigVíctor Manuel Jáquez Leal1-0/+2
2020-02-02vaapivideobufferpool: check for vaapi meta firstVíctor Manuel Jáquez Leal1-4/+4
If the configured meta doesn't request vaapi meta then it is not a vaapi buffer pool. Bail out as soon as possible.
2020-02-02vaapivideobufferpool: turn errors into warningsVíctor Manuel Jáquez Leal1-6/+6
set_config() vmethod should fail gracefully, thus upstream could negotiate another pool if possible. Instead of sending error messages to the bus, let demote the level to warning.
2020-01-27vaapivideobufferpool: Reuse internal allocator is possible.Víctor Manuel Jáquez Leal1-2/+8
Instead of creating a new allocator when upstream requests a different allocator, this patch tries to reuse the internal allocator if it was already initializated. If the stream changes, then either one will be unref and a new allocator is created.