Commit graph

4106 commits

Author SHA1 Message Date
Matthew Waters
6c26d0e1a0 vtdec/vulkan: use Shared storage mode for IOSurface textures
Fixes a debug assertion with i(Pad)OS 14:

'IOSurface textures must use MTLStorageModeShared'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1592>
2020-09-23 23:21:50 +00:00
Víctor Manuel Jáquez Leal
990d1bfbce va: vpp: global lock to handle shared buffers
Add a global mutex to exclusive access to shared stream buffers, such
as DMABufs or VASurfaces after a tee:

LIBVA_DRIVER_NAME=iHD \
gst-launch-1.0 v4l2src ! tee name=t t. ! queue ! \
  vapostproc skin-tone=9 ! xvimagesink \
  t. ! queue ! vapostproc ! xvimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
9845ec68dc va: add vapostproc element
Video postprocessor for VA-API

Funcionalities: resize frames, change format, import buffers, apply
filters (such as denoise, sharpen, orientation, if driver offers them).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
117453b947 va: allocator: export composed layer for YUY2 and UYVY
This is a result of an error reported by i965 driver which only can
export composed layer for these formats. This seems to work too with
iHD. These formats are not exposed as native surfaces in Gallium.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
a4e535d5c1 va: allocator: add gst_va_dmabuf_buffer_setup()
This function will take an array of DMABuf GstMemory and an array of
fd, and create a VASurfaceID with those fds. Later that VASurfaceID is
attached to each DMABuf through GstVaBufferSurface.

In order to free the surface GstVaBufferSurface now have GstVaDisplay
member, and _buffer_surface_unref() were added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
6ac4e79b21 va: allocator: try to get VASurfaceID from every DMABuf allocator
Relax the check of the allocator type, because now the qdata can be
attached for other DMABuf allocators.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
20e493981b va: allocator: try to create surface without fourcc but chroma only
There are, in VPP, surfaces that doesn't support 4:2:2 fourccs but it
supports the chroma. So this patch gives that opportunity to the
driver.

This patch also simplifiies
gst_va_video_surface_format_from_image_format() to just an iterator
for surfaces available formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
482a7d7d7e va: allocator: create surfaces with VASurfaceAttribExternalBuffers
Add a new parameter to _create_surfaces(): a pointer to
VASurfaceAttribExternalBuffers.

If it's defined the memory type is changed to DRM_PRIME, also a new item is
added to the VASurfaceAttrib array with
VASurfaceAttribExternalBufferDescriptor.

Also, the VASurfaceAttrib for pixel format is not mandatory anymore. If fourcc
parameter is 0, is not added in the array, relying on the chroma. This is
useful when creating surfaces for uploading or downloading images.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
f306b1e0fe va: pool: use gst_object_replace() for allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
f6a623d565 va: device: use gst_clear_object()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
6af7ec3c0f va: caps: expose gst_caps_set_format_array()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
b1a1e2d841 va: vah264dec: fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1591>
2020-09-23 15:14:21 +00:00
Haihao Xiang
912fa7ce99 msdk: add support for AV1 decoding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1448>
2020-09-22 06:54:27 +00:00
Víctor Manuel Jáquez Leal
9ed141734e va: utils: use GstObject for GstVaDisplay in context
Thus application could fetch the GstVaDisplay through the sync bus
without knowning the specific implementation, and sharing it or
extract properties.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1586>
2020-09-21 17:07:51 +00:00
Víctor Manuel Jáquez Leal
ed80aa5d6b va: utils: fix code style and wrong log message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1586>
2020-09-21 17:07:51 +00:00
Víctor Manuel Jáquez Leal
9e9e5c72d5 va: h264dec: add documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1585>
2020-09-20 09:21:08 +02:00
Haihao Xiang
9443bf7a22 msdk: enable GPUCopy
Note it works for system memory only

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/910>
2020-09-20 01:40:08 +00:00
Haihao Xiang
1d082baf18 msdk: call MFXInitEx instead of MFXInit
MFXInitEx has more control than MFXInit. The current setting in this
commit is identical to MFXInit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/910>
2020-09-20 01:40:08 +00:00
Víctor Manuel Jáquez Leal
467618f8ac va: decoder: render picture only if data
Call vaRenderPicture() only if buffer or slice data is available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1584>
2020-09-19 14:32:13 +02:00
Víctor Manuel Jáquez Leal
ad019a1d01 va: decoder: warn if decode fails on a surface
Instead of logging error if a step fails, it logs a warning message
reducing the noise and obeying the rule for errors since the program
doesn't end

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1584>
2020-09-19 14:32:13 +02:00
Víctor Manuel Jáquez Leal
ad839ada5b va: h264dec: check is pad has fixed caps at caps query
Otherwise it will always reply with the possible driver caps, which
generates problems with Web MSE players.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1583>
2020-09-19 13:00:49 +02:00
Seungha Yang
2fe1afeafa va: h264dec: Don't need to set pts/dts/duration on outputting frame
It will be handled by videodecoder baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1582>
2020-09-18 23:50:54 +00:00
Nicolas Dufresne
671d9fed3a kmssink: Do not source using padded width/height
The width/height from the video meta can be padded width, height. But when
sourcing from padded buffer, we only want to use the valid pixels. This
rectangle is from the crop meta, orther it is deduces from the caps. The width
and height from the caps is save in the parent class, use these instead of the
GstVideoInfo when settting the src rectangle.

This fixes an issue with 1080p video displaying repeated or green at the
padded bottom 8 lines (seen with v4l2codecs).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1580>
2020-09-18 16:26:23 +00:00
Seungha Yang
ea24a2e527 d3d11: Add support for packed 8bits 4:2:2 YUV formats
Note that newly added formats (YUY2, UYVY, and VYUY) are not supported
render target view formats. So such formats can be only input of d3d11convert
or d3d11videosink. Another note is that YUY2 format is a very common
format for hardware en/decoders on Windows.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1581>
2020-09-18 14:47:21 +00:00
Randy Li (ayaka)
2f5904c20d msdk: vpp: fixup passthrough checking for DMA
I think it is just a typo from e1a90f1ec9
msdkvpp: Disable passthrough if memory capsfeature changes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1559>
2020-09-16 03:02:31 +00:00
Seungha Yang
08119ea515 d3d11vp9dec: Don't need to consider output_picture() call without GstVideoCodecFrame
Baseclass will be updated in order to ensure GstVideoCodecFrame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1567>
2020-09-15 15:54:53 +00:00
Seungha Yang
b73a223dc5 d3d11vp9dec: Specify profile and alignment on sink template
Set supported profile(s) on sink template caps, so that decodebin
can filter out this element if profile of given vp9 stream is not
supported by hardware decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1567>
2020-09-15 15:54:53 +00:00
Seungha Yang
bb5ef4fd5b d3d11decoder: Cleanup code
* Don't need to set pts/dts/duration on output buffer of frame.
  it's handled by baseclass
* Remove meaningless debug output

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1567>
2020-09-15 15:54:53 +00:00
Víctor Manuel Jáquez Leal
261d6e463a Revert "va: h264dec: set latency"
This reverts commit 3aedef4c86.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1531>
2020-09-14 16:48:31 +00:00
Nicolas Dufresne
20785e775e v4l2slh264dec: Minor cleanup
Move few variables in their respective scope.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1563>
2020-09-10 15:21:57 +00:00
Nicolas Dufresne
cc8e1ca2ac v4l2slh264dec: Fix B-Frame weight table
We where not setting the luma l1 weight table.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1563>
2020-09-10 15:21:57 +00:00
Seungha Yang
47bbc997f8 mfvideosrc: Set timestamp on buffer when it's captured
Capture the timestamp immediately when new frame is arrived,
instead of doing that on ::create() method. There would be
time gap between captured time and outputting time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1351>
2020-09-10 10:21:00 +00:00
Seungha Yang
d1d2acead1 mfvideoenc: Add support for zero-copy encoding
Add custom IMFMediaBuffer and IMF2DBuffer implementation in order to
keep track of lifecycle of Media Foundation memory object.
By this new implementation, we can pass raw memory of upstream buffer
to Media Foundation without copy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1518>
2020-09-09 07:25:52 +00:00
Sebastian Dröge
64039cdf84 gst: Update for gst_video_transfer_function_*() function renaming
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1557>
2020-09-07 12:14:47 +03:00
Haihao Xiang
cc3057e4ea msdkvp9dec: change the include header order
This fixes the compiler error when MFX_VERSION_USE_LATEST is defined in
the SDK.

/usr/include/mfx/mfxvp9.h:48:5: error: unknown type name ‘mfxExtBuffer’
     mfxExtBuffer Header;

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1549>
2020-09-01 13:57:13 +08:00
Jérôme Laheurte
ccfb799d83 dshowsrcwrapper: Update build instructions. Add _builddir to include search path.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1537>
2020-08-28 23:00:53 +00:00
Jérôme Laheurte
02666d929f dshowsrcwrapper: fix typo in variable name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1538>
2020-08-25 10:49:11 +02:00
Seungha Yang
95e007ac49 d3d11videosink: Fix crash caused by missing null termination
gst_caps_features_new() must be null terminated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1524>
2020-08-24 20:03:05 +00:00
Víctor Manuel Jáquez Leal
7c696b67be va: allocator: remove parameter from _create_buffer_surface()
Don't the allocator to _create_buffer_surface() since it's not used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1516>
2020-08-24 19:35:57 +00:00
Víctor Manuel Jáquez Leal
80de32b017 va: utils: free allocated string
and fix a memleak

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1516>
2020-08-24 19:35:57 +00:00
Víctor Manuel Jáquez Leal
69a00541dd va: utils: fix log category initialization
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1516>
2020-08-24 19:35:57 +00:00
Víctor Manuel Jáquez Leal
c905f6131d va: h264dec: check va allocator at decide allocation
And some code cleanups

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1516>
2020-08-24 19:35:57 +00:00
Víctor Manuel Jáquez Leal
f755730b20 va: decoder: improve locks for member variable access
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1516>
2020-08-24 19:35:57 +00:00
Seungha Yang
5d4ab18ced mediafoundation: Correct wrong raw video format mapping
Was a shameful mistake

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1517>
2020-08-17 21:39:13 +09:00
Víctor Manuel Jáquez Leal
3aedef4c86 va: h264dec: set latency
The min latency is calculated with the maximum number of frames that
precede any frame, if available, and it is lower than the maximum
number of frames in DBP.

The max latency is calculated with the maxium size of frames in DBP.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1500>
2020-08-17 09:32:41 +00:00
Seungha Yang
5ffd2c64a0 mediafoundation: Call MFShutdown when destroying plugin
MFStartup and MFShutdown should be paired as documented in
https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mfstartup#remarks
Otherwise valgrind-like tools would report false positive memory leak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1512>
2020-08-13 07:05:36 +00:00
Xu Guangxin
9123b9ba39 msdkvpp: do not hold too many input buffers in locked list
If the surface is locked before vpp, upstream takes the reference.
We do not need to take a reference for msdk in vpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1490>
2020-08-13 01:43:19 +00:00
Xu Guangxin
ea0aac4c19 msdkvpp: refact, put input and output surface in diffrent list
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1490>
2020-08-13 01:43:19 +00:00
Seungha Yang
185d2f56a3 d3d11: Handle newly added GST_VIDEO_TRANSFER_BT601
Use the value for mapping between DXGI_COLOR_SPACE_TYPE and GstVideoColorimetry.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1410>
2020-08-12 15:18:56 +00:00
Seungha Yang
205ad89802 d3d11: Store more device information in context structure
It would be more informative for debugging

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1507>
2020-08-12 14:04:55 +00:00
Seungha Yang
ff9157eef4 d3d11: Selected adapter index should be unsigned integer
If d3d11device was created successfully, the index of adapter
must not be negative value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1507>
2020-08-12 14:04:55 +00:00
Víctor Manuel Jáquez Leal
122a3cc40c va: h264dec: remove spurious comment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1499>
2020-08-10 15:36:47 +00:00
Víctor Manuel Jáquez Leal
159562faf7 va: h264dec: check return value of gst_va_handle_set_context()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1499>
2020-08-10 15:36:47 +00:00
Matthew Waters
d1667da0c3 build: update for gl pkg-config file split
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1462>
2020-08-07 20:22:41 +10:00
Sebastian Dröge
309f6187fe decklink: Re-order modes enum for backwards compatibility with 1.16
The PAL/NTSC widescreen modes were added after 1.16 but inserted before
the HD modes, which changed the integer values of the enums.

Move them to the very end instead to keep backwards compatibility.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1048

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1492>
2020-08-06 12:22:04 +03:00
Andrew Branson
8a51fdbc2c androidmedia: ignore additional camera effects if not present
Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/283

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1470>
2020-08-04 11:07:33 +00:00
Víctor Manuel Jáquez Leal
6cf03b21f6 va: h264dec: log if upstream pool is kept
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1489>
2020-08-04 10:39:05 +02:00
Víctor Manuel Jáquez Leal
f332c35ec0 va: utils: fix precondition check for handle_context_query()
display paramater can be NULL, but if it's not, it has to be a
GstVaDisplay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1489>
2020-08-04 10:39:05 +02:00
Víctor Manuel Jáquez Leal
62dacfd89a va: allocator: support for GST_MAP_VA map flag
This flag will return the VASurface value at mapping
2020-08-03 19:33:01 +02:00
Víctor Manuel Jáquez Leal
f7cfb422f1 va: context: instanciate VA display through GstContext
Add all the machinery to instanciate VA display through GstContext,
thus all va elements can share the same display and the user can set
a custom one.
2020-08-03 19:33:01 +02:00
Víctor Manuel Jáquez Leal
0cc1dccd84 va: h264dec: don't copy frames if VAMemory capsfeature is negotiated
Otherwise the VASurfaceID is lost.
2020-08-03 19:33:01 +02:00
Víctor Manuel Jáquez Leal
aa664a4eca va: h264dec: copy render_device_path in klass
It it's not copied both cdata and klass, the string is lost. Thus
also it's freed from cdata when freeing it.
2020-08-03 19:33:01 +02:00
Víctor Manuel Jáquez Leal
040c799cd8 va: display: wrapped: Fix property name 2020-08-03 19:33:01 +02:00
Víctor Manuel Jáquez Leal
585295e82b va: decoder: remove unused argument
And that changes function's namespace
2020-08-03 19:33:01 +02:00
Víctor Manuel Jáquez Leal
5154ee7f4c va: caps: bail raw caps if driver doesn't report surface formats
This is a bug in Gallium RadeonSI driver for Polaris10, which doesn't
report sufrace formats for reported chroma.

If one chroma doesn't report surface formats, skip the generated caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1483>
2020-08-03 15:54:45 +00:00
Víctor Manuel Jáquez Leal
d3ef3d562a va: allocator: get a surface format from a image format
For the allocator to create surfaces with the correct chroma an
fourcc, it should use a surface format, not necessarily the negotiated
format.

Instead of the previous arbitrary extra formats list, the decoder
extracts the valid pixel formats from the given VA config, and pass
that list to the allocator which stores it (full transfer).

Then, when the allocator allocates a new surface, it looks for a
surface color format chroma-compatible with the negotiated image color
format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1483>
2020-08-03 15:54:45 +00:00
Víctor Manuel Jáquez Leal
2327ac4a13 va: caps: add raw caps image formats with same chroma of surfaces
Instead of adding a list of ad-hoc formats for raw caps (I420 and
YV12), the display queries the available image formats and we assume
that driver can download frames in that available format with same
chroma of the config surfaces chroma.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1483>
2020-08-03 15:54:45 +00:00
Víctor Manuel Jáquez Leal
9db747e4d0 va: display: add gst_va_display_get_image_formats()
For this it was also added gst_va_video_format_from_va_image_format()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1483>
2020-08-03 15:54:45 +00:00
Víctor Manuel Jáquez Leal
39e55129d5 va: decoder: initialize rt_formas to zero
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1483>
2020-08-03 15:54:45 +00:00
Seungha Yang
9b72b04dad d3d11download: Allow linking with downstream d3d11 elements
It will make pipeline configuration easier since d3d11download
element can be placed unconditionally. This behavior is similar
to that of gldownload element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1485>
2020-08-03 13:10:07 +00:00
Seungha Yang
4986b0dd34 mfvideosrc: Select common formats if both VideoPreview and VideoRecord are available
Some devices (e.g., Surface Book 2, Surface Pro X) will expose
both MediaStreamType_VideoPreview and MediaStreamType_VideoRecord types
for a logical device. And for some reason, MediaStreamType_VideoPreview
seems to be selected between them while initiailzing device.
But I cannot find any documentation for the decision rule.
To be safe, we will select common formats between them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1478>
2020-08-01 15:17:05 +00:00
Seungha Yang
479a67c1b7 mfvideosrc: Check framerate for target IMediaFrameFormat selection
Not only resolution and format, but framerate needs to be checked
for proper target IMediaFrameFormat selection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1478>
2020-08-01 15:17:05 +00:00
Seungha Yang
3fb8caf635 mfvideosrc: Handle I420/IYUV subtypes for UWP cases
Microsoft defines two I420 formats, one is I420, and the other is
IYUV (but both are same, just names are different).
Since both will be converted to GST_VIDEO_FORMAT_I420,
we should check both I420 and IYUV subtypes during
GstVideoFormat to Microsoft's format conversion.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1478>
2020-08-01 15:17:05 +00:00
Seungha Yang
2303ad7bf4 mfvideosrc: Add more debug log
It would be useful for finding the error reason.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1478>
2020-08-01 15:17:05 +00:00
Seungha Yang
fc49886c61 wasapi2, mfvideosrc: Update "dispatcher" property to be only writable
Disallow getting dispatcher pointer, since it doesn't seem to be useful
and might not be safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1480>
2020-07-31 21:50:16 +09:00
Seungha Yang
ed14e0d5a6 wasapi2device: Allow empty caps for UWP use case
If the device has not been activated yet, caps might not be available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1466>
2020-07-26 12:52:15 +00:00
Seungha Yang
9e56d20279 wasapi2: Activate device asynchronously if required
In case of UWP, documentation from MS is saying that
ActivateAudioInterfaceAsync() method should be called from UI thread.
And the resulting callback might not happen until user interaction
has been made.
So we cannot wait the activation result on constructed() method.
and therefore we should return gst_wasapi2_client_new()
immediately without waiting the result if wasapi2 elements are
running on UWP application.
In addition to async operation fix, this commit includes COM object
reference counting issue around ActivateAudioInterfaceAsync() call.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1466>
2020-07-26 12:52:15 +00:00
Seungha Yang
b10afc574e wasapi2: Add a new property for ICoreDispatcher setting
... so that ensure device activation on UI thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1466>
2020-07-26 12:52:15 +00:00
Seungha Yang
6d960781fc mfvideosrc: Only device activation needs to be running on UI thread
... and the other operations does not have the thread constraint.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1466>
2020-07-26 12:52:15 +00:00
Seungha Yang
502aea3969 mfvideosrc: Add a new property for ICoreDispatcher setting
Since the commit c29c71ae9d,
device activation method will be called from an internal thread.

A problem is that, CoreApplication::GetCurrentView()
method will return nullptr if it was called from non-UI thread,
and as a result, currently implemented method for accessing ICoreDispatcher
will not work in any case. There seems to be no robust way for
accessing ICoreDispatcher other then setting it by user.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1466>
2020-07-26 12:52:15 +00:00
Seungha Yang
42de98fd42 mfvideosrc: Suppress more spammy debug messages
The failure on compressed format (e.g., MJPG, H264 subtypes) is expected.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1468>
2020-07-26 05:48:48 +09:00
Seungha Yang
d03e959f54 d3d11window: Remove timeout and wait a task if possible
If the run_async() method is expected to be called from streaming
thread and not from application thread, use INFINITE as timeout value
so that d3d11window can wait UI dispatcher thread in any case.

There is no way to get a robust timeout value from library side.
So the fixed timeout value might not be optimal and therefore
we should avoid it as much as possible.

Rule whether a timeout value can be INFINITE or not is,
* If the waiting can be cancelled by GstBaseSink:unlock(), use INFINITE.
  GstD3D11Window:on_resize() is one case for example.
* Otherwise, use timeout value
  Some details are, GstBaseSink:start() and GstBaseSink:stop() will be called
  when NULL to READY or READY to NULL state change, so there will be no
  chance for GstBaseSink:unlock() and GstBaseSink:unlock_stop()
  to be called around them. So there is no other way then timeout way.
  GstD3D11Window:consturcted() and GstD3D11Window:unprepare() are the case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1461>
2020-07-24 04:53:44 +00:00
Seungha Yang
6ede4a99a7 d3d11window: Increase timeout to 10 sec for WinRT window implementations
No strong reason for this number, but we can follow other well known
UWP implementation ANGLE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1461>
2020-07-24 04:53:44 +00:00
Seungha Yang
deaa29bd96 codecs: vp8decoder: Sync up with h264decoder implementation
Pass GstVideoCodecFrame with GstVp8Picture to new_picture() and
output_picture() methods for subclass to be able to reference
it directly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1458>
2020-07-23 15:48:05 -04:00
Seungha Yang
c78fe6bfb0 v4l2codecs: vp8dec: Remove white space
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1458>
2020-07-23 18:57:02 +00:00
Seungha Yang
e754d5a5b2 codecs: vp9decoder: Sync up with h264decoder implementation
* Pass GstVideoCodecFrame to new_picture() and output_picture()
* Pass the last reference of GstVp9Picture to subclass if possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1455>
2020-07-23 15:41:39 +00:00
Seungha Yang
8821165648 wasapi2: Fix broken debug log
I hope that MSVC is smart enought to warn this at build time

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1459>
2020-07-23 14:37:52 +00:00
Seungha Yang
87b150c42a v4l2codecs: h264dec: Remove outdated comment
... and unnecessary user data clear on GstVideoCodecFrame

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1457>
2020-07-23 18:07:58 +09:00
Seungha Yang
96b9000289 v4l2codecs: h264dec: Fix leak on decoding failure
Given GstVideoCodecFrame and GstH264Picture should be cleared,
and the return must be GST_FLOW_ERROR, not boolean value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1457>
2020-07-23 18:07:11 +09:00
Seungha Yang
128e533a6e d3d11decoder: Disable array-of-texture
Some 4K VP9 + super frame enabled streams would be broken with
array-of-texture configuration (i.e., allowing runtime texture registration
for DPB).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1456>
2020-07-22 16:06:47 +00:00
Seungha Yang
3422868c59 mfutils: Suppress spammy debug print
Remove FIXME debug print. It seems to be spammy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1452>
2020-07-22 18:11:18 +09:00
Seungha Yang
6c52008413 mfvideosrc: Expose sorted caps
Sort the list of supported caps for downstream to be able to select
the best image in terms of quality (resolution and framerate) by default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1452>
2020-07-22 18:11:18 +09:00
Seungha Yang
c3ecea0aa4 mfvideosrc: Don't expose unsupported formats
Some UVC cameras support H.264 stream but we don't support it yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1452>
2020-07-22 18:10:57 +09:00
Víctor Manuel Jáquez Leal
820bbc1bce va: documentation since tag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1387>
2020-07-21 16:15:47 +00:00
Víctor Manuel Jáquez Leal
1ca39b571d vah264dec: add documentation caps for pad templates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1387>
2020-07-21 16:15:47 +00:00
Seungha Yang
2a0de96015 d3d11window: Disable d3d11 video processor for HDR10 stream.
d3d11 video processor is showing buggy behaviors in various cases.
And this HDR10 is one case of them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1454>
2020-07-21 15:41:20 +00:00
Nicolas Dufresne
bb9fbf0626 v4l2codecs: h264dec: Use the new picture lookup
This will avoid having to create a reference chain from CodecFrame
to GstH264Picture to GstV4l2Request.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1449>
2020-07-21 17:18:42 +09:00
Seungha Yang
e921a07715 codecs: h264decoder: Pass GstVideoCodecFrame to output_picture()
All subclasses are retrieving list to get target output frame, which
can be done by baseclass. And pass the ownership of the GstH264Picture
to subclass so that subclass can clear implementation dependent resources
before finishing the frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1449>
2020-07-21 17:18:42 +09:00
Seungha Yang
7a024a740f codecs: h264decoder: Don't attach extra ref of GstH264Picture to GstVideoCodecFrame
The lifecycle of GstH264Picture is being managed by our DPB
implementation. If it's still required, subclass can do that
by itself in the new_picture() method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1449>
2020-07-21 17:18:42 +09:00
Seungha Yang
37aeb91d54 mfvideosrc: Don't error out when if we've found supported format
While retrieving supported formats by device, the last return might
not be S_OK in case that it's not supported one by us (e.g., H264, JPEG or so).
But if we've found at least one supported raw video format,
we can keep going on.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1451>
2020-07-20 16:13:37 +00:00