Commit graph

213 commits

Author SHA1 Message Date
Nicolas Dufresne cf3d64129b v4l2codecs: vp9: Fix reset_frame_context parameter
It was assumed that the kernel parameters would match with the bitstream value
but instead the author when with another set of value. Surprisingly, this
makes no difference with the resulting fluster score.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1748>
2022-02-18 23:55:59 +00:00
Nicolas Dufresne 5a9df9e850 v4l2codecs: vp9: Only fill compressed headers if needed
Fixes: 13944cf3ee ("v4l2codecs: vp9: Make compressed hdr control optional")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1748>
2022-02-18 23:55:59 +00:00
Tim Mooney 54a1f60077 v4l2: include <sys/ioccom.h> on Illumos
Needed for _IOR/_IORW

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1524>
2022-02-18 21:34:49 +00:00
Loic Le Page e1c0628bb9 Add build files and fix build for gst-plugins-bad dshowsinkwrapper plugin
dshowsinkwrapper plugin is the old dshowvideosink plugin that has been
renamed to be compliant with the actuel plugin name in the source code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>
2022-02-18 14:59:25 +01:00
Loic Le Page b355345ef5 Add build files and fix build for gst-plugins-bad dshowsrcwrapper plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>
2022-02-18 14:59:25 +01:00
Loic Le Page 587b2e6bcb Add build files and fix build for gst-plugins-bad dshowdecwrapper plugin
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>
2022-02-18 14:59:25 +01:00
Loic Le Page 42bdeaf52c Add directshow strmbase library source code from Microsoft repo
Original repo is here:
https://github.com/microsoft/Windows-classic-samples

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>
2022-02-18 14:59:25 +01:00
Loïc Le Page 42c6a26aea Move all directshow plugins to the same sub-folder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1577>
2022-02-18 14:59:24 +01:00
Tim Mooney 97720dabe0 meson: check for libsocket and libnsl
If present, add '-lsocket' and '-lnsl' to network_deps.

ext/curl/meson.build: add network_deps to dependencies
gst/festival/meson.build: same
sys/shm/meson.build: same

Fixes linking issues on Illumos distros.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1525>
2022-02-17 18:44:49 +00:00
Seungha Yang 04b8dfa391 d3d11: Add support for AYUV, AYUV64, and RGBA64_LE formats
Note that AYUV and AYUV64 formats will be used to expand format
support, especially some packed YUV formats (e.g., Y410, YUY2)
are common DXGI formats used for hardware decoder/encoder on Windows
but those formats cannot be used as a render target. We need to handle
them differently without pixel shader help, using compute shader
for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1699>
2022-02-16 18:41:05 +00:00
Seungha Yang dd906f9610 d3d11: Store device format in struct
Holding pointer to struct was unsafe approach because
the pointer to d3d11 format will be invalidated once d3d11 device
object is released

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1699>
2022-02-16 18:41:05 +00:00
Seungha Yang e1f0687b09 meson: Do hard build error for some MSVC warnings
Handle various MSVC warnings as errors for development version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1006>
2022-02-16 17:03:29 +00:00
Dmitry Osipenko b757d12cff v4l2codecs: h264: Correct scaling matrix ABI check
Scaling matrix V4L UAPI control not presents on NVIDIA Tegra, the default
matrix should be used in this case. Mark scaling matrix presence optional.

Fixes: 47bfa71530 ("v4l2codecs: h264: Improve ABI check ")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1726>
2022-02-16 13:16:17 +00:00
Mengkejiergeli Ba 586dfab9bd msdkdec: Enable SFC scaling for AVC and HEVC
Decoder SFC only supports down-scaling at most to 1/8.
For example, given a 4K bistream, SFC can scale it to 1080p via:
"msdkh265dec ! video/x-raw,width=1920,height=1080 ! glimagesink"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>
2022-02-16 08:26:46 +00:00
Mengkejiergeli Ba c5f0e075e2 msdkdec: Enable SFC csc for AVC and HEVC
Decoder SFC will be triggered when default output format is not accept at
downstream. One use case below can work without using msdkvpp:
"! msdkh265dec ! "video/x-raw,format=BGRA" ! glimagesink",

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>
2022-02-16 08:26:46 +00:00
Mengkejiergeli Ba eb742c8ed0 msdkdec: Add SFC codes
SFC refers to Scaler Format Converter, more details here:
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-kbl-vol15-sfc.pdf
By attaching mfxExtDecVideoProcessing buffer to mfxVideoParam, decoder
can do SFC for csc and scaling.

MSDK will check if surface bitdepth equals to input when no SFC is
triggered, which means in the case of SFC, there is no need to update
surface bitdepth via gst_msdk_update_mfx_frame_info_from_mfx_video_param.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1444>
2022-02-16 08:26:46 +00:00
Seungha Yang dbda4cf409 d3d11converter: Fix for missing GRAY conversion
Add missing Y410 -> GRAY and GRAY -> semi-planar conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1724>
2022-02-16 02:30:01 +09:00
Seungha Yang 98345a141a d3d11converter: Don't use FIXME_OBJECT for non-GstObject
... and print ERROR messages for unexpected input/output formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1724>
2022-02-16 02:27:53 +09:00
He Junyan 24c3e0fcfa va: Delete the display lock/unlock when we call VA-API.
According to the VA-API's description, they are MT-safe, we do not
need to care about that in our middleware layer. The lock/unlock
operations have overhead and make the performance lower.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1333>
2022-02-15 10:02:08 +00:00
Seungha Yang e3e23a2c84 d3d11converter: Fix RGB to GRAY conversion
Fix typo in shader code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1697>
2022-02-14 17:49:54 +00:00
Seungha Yang 27246ebeb0 d3d11download: Fix decide_allocation
Caps should be parsed in any cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1691>
2022-02-14 10:48:31 +00:00
He Junyan fa4dc3470f meson: va: Add va option check into plugin's build.
Because the liblibgstva is built unconditionally, we now move the
va option check into va plugin's build.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1685>
2022-02-14 06:30:56 +00:00
He Junyan 1eed9de0bb vavpp: Fix the caps leak in the transform_caps() function.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1689>
2022-02-12 20:11:46 +08:00
Seungha Yang e96687d88d d3d11: Update build-time dependency
Remove all the d3d11 and dxgi header version dependent ifdef
and bump the minimum requirement to d3d11_4.h and dxgi1_6.h.
We are already failing support old Visual Studio (Windows SDK actually)
such as Visual Studio 2015. Note that our MinGW toolchain satisfies
the requirement.

From runtime point of view, this change should be fine since
we are checking OS version with IUnknown::QueryInterface()
everywhere in order to check API availability

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1684>
2022-02-11 20:01:52 +00:00
He Junyan 248baef400 MSDK: Import VA surface as encoder's input.
We make all MSDK encoders declare "memory:VAMemory" feature. Then
the pipeline such as:
  gst-launch-1.0 -vf filesrc location=xxx.h264 ! h264parse ! \
       vah264dec ! msdkh265enc ! fakesink
will choose VA memory caps between the VA decoder and MSDK encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan ef5f6ab5d9 MSDK: Add helper function to peek VA surface of VA kind gstbuffer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan 26172123e5 MSDK: Handle context query into the encoder's query function.
The MSDK encoder's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan 2928b14b69 MSDK: Handle context query into the VPP's query function.
The MSDK VPP's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan db5be289c7 MSDK: Handle context query into the decoder's query function.
The MSDK decoder's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan 6635852c40 MSDK: Add a handle_context_query() helper function.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan 85664b5af6 MSDK: Improve the GstContext setting logic.
We now can use the gst va lib's display to create our MSDK context,
and use its helper functions to simplify our code. The improved logic
is like this:
1. Every MSDK element should use gst_msdk_context_find() to find a MSDK
context from neighbour. If valid, reuse it.
2. Use gst_msdk_ensure_new_context(). It will first query neighbours
about the GstVaDisplay, if found(e.g. some VA element is connected),
use gst_msdk_context_from_external_display() to create a MSDK context.
3. Then, creating the MSDK context from scratch. It creates both the
display and MSDK context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan a905e7474b MSDK: Add new_with_va_display() helper function to create context.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan a9aa522e26 MSDK: Use the VA display object to replace the raw display handle.
The VA display object from VA lib is a common defined object. which
contain the whole display things. It is easier to use, and more important,
we can share it with the other VA plugins and keep all the VA related
plugins working on the same GPU device.
We also delete the useless gst_msdk_context_get_fd() API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
He Junyan c7e3c8e9f6 MSDK: Add the gst va lib into MSDK's dependency.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
2022-02-11 07:13:45 +00:00
Seungha Yang 2c93afd8bb mediafoundation: Add support for MP3 decoding
See also
https://docs.microsoft.com/en-us/windows/win32/medfound/windows-media-mp3-decoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1596>
2022-02-11 04:16:23 +09:00
Seungha Yang be957f6c61 mediafoundation: Add support for AAC decoding
See also
https://docs.microsoft.com/en-us/windows/win32/medfound/aac-decoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1596>
2022-02-11 04:16:22 +09:00
Seungha Yang 0b26254a6a mediafoundation: Cosmetic changes
Rename baseclass to be consistent with other Windows plugins

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1596>
2022-02-11 04:16:22 +09:00
Seungha Yang ce4875ccde mediafoundation: Use & operator instead of GetAddressOf()
Use shorter expression

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1596>
2022-02-11 04:16:22 +09:00
Seungha Yang 36020c7549 mediafoundation: Port to C++
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1596>
2022-02-11 04:16:15 +09:00
Seungha Yang c7a9b5c458 d3d11decoder: Promote rank to primary except for mpeg2
Our D3D11/DXVA codecs implementation has been verified
during 1.18 and 1.20 development cycle and also via the Fluster
test framework. Similar to the case of nvdec and vtdec,
we can prefer hardware over software in most cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1672>
2022-02-10 17:16:18 +00:00
Nicolas Dufresne 7a9e11ae1b v4l2codecs: vp9: Fix duplicating a duplicated picture
Duplicating a picture what was already a dup was leading to a crash. Rename
the custom picture flags as HOLDS_BUFFER to make its meaning clear. Then save
then ref and store the picture as userdata, so it can be obtained when
duplicating. Finally, mark the doplicated as HOLDS_BUFFER to avoid thinking it
holds a request.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1681>
2022-02-09 22:37:55 +00:00
Seungha Yang 090b50e549 mfaudioenc: Handle empty IMFMediaBuffer
IMFMediaBuffer may not hold encoded data, which seems to happen
while draining.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1679>
2022-02-10 01:49:55 +09:00
Víctor Manuel Jáquez Leal b3c71584e0 va: decoder: Log profile name.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1675>
2022-02-09 12:25:24 +01:00
Víctor Manuel Jáquez Leal df6c985474 va: filter: Log the added filter name.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1675>
2022-02-09 11:07:47 +00:00
Víctor Manuel Jáquez Leal 4be3413fec vapostproc: Process HDR caps
This patch adds a new parameter: hdr-tone-mapping (same as
vaapipostproc), if the HDR capabilites are availabe in driver, and
it's disabled by default.

If hdr-tone-mapping is enabled then HDR fields in sink caps are
processed in frames from HDR to SDR, removing those hdr fields in
source pad caps too.

hdr-tone-mapping is not enabled if a color conversion is also
requested, since it fails to process in the iHD driver, so far.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1258>
2022-02-09 10:26:02 +00:00
Víctor Manuel Jáquez Leal 0e7dade55a build: Add libva dependency fallback.
Then libva can be subproject and used by either gstreamer-vaapi,
va and msdk in gst-plugins-bad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1397>
2022-02-09 09:45:04 +00:00
Nicolas Dufresne 13944cf3ee v4l2codecs: vp9: Make compressed hdr control optional
This is to supported by Mediatek VP9 driver. Mediatek handles
the forward probabilities in hardware hence does not need and
does not implement support for
V4L2_CID_STATELESS_VP9_COMPRESSED_HDR.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1600>
2022-02-08 16:46:09 -05:00
Víctor Manuel Jáquez Leal 5e4c152de4 va: Remove libgudev crumbs in library.
In commit e699aaeb we moved linking of libgudev to the plugin rather
the library, because it's only used in the plugin. But the dependency
check is still done in library.

This patch removes the dependency check in library, and updates the
dependency check in plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1650>
2022-02-08 16:22:42 +00:00
Seungha Yang 8773ba1104 msdk: Fix for MFXUnload symbol re-definition build error
Fix for libgstreamer-full build

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1408>
2022-02-08 10:05:35 +00:00
Seungha Yang 278908ce96 qsv: Add support for HEVC encoding
main and main-10 profiles are supported for now

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1408>
2022-02-08 10:05:35 +00:00