Seungha Yang [Sun, 20 Dec 2020 17:47:45 +0000 (02:47 +0900)]
d3d11: Move core methods to gst-libs
Move d3d11 device, memory, buffer pool and minimal method
to gst-libs so that other plugins can access d3d11 resource.
Since Direct3D is primary graphics API on Windows, we need
this infrastructure for various plugins can share GPU resource
without downloading GPU memory.
Note that this implementation is public only for -bad scope
for now.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/464>
Seungha Yang [Mon, 11 Jan 2021 15:13:22 +0000 (00:13 +0900)]
va: allocator: Fix deadlock caused by double lock
Trivial bug fix for deadlock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1949>
Matthew Waters [Mon, 4 Jan 2021 08:34:40 +0000 (19:34 +1100)]
wpesrc: replace object lock usage with a new lock
Using the object lock is problematic for anything that can dispatch to
another thread which is what createWPEView() does inside
gst_wpe_src_start(). Using the object lock there can cause a deadlock.
One example of such a deadlock is when createWPEView is called, but
another (or the same) wpesrc is on the WPEContextThread and e.g. posts a
bus message. This message propagations takes and releases the object
lock of numerous elements in quick succession for determining various
information about the elements in the bin. If the object lock is
already held, then the message propagation will block and stall bin
processing (state changes, other messages) and wpe servicing any events.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1490
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1934>
Seungha Yang [Sun, 10 Jan 2021 14:16:55 +0000 (23:16 +0900)]
codecs: h264picture: Count only complete complementary field pair for dpb fullness decision
Our DPB implementation was designed as such that allowing
temporary DPB overflow in the middle of field picture decoding
and incomplete field pair should not trigger DPB bumping.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1947>
Seungha Yang [Sun, 10 Jan 2021 14:11:01 +0000 (23:11 +0900)]
codecs: h264decoder: Add support for field-pair input frame
In case that upstream pushed buffer as a frame unit, not picture
unit for interlaced stream, baseclass should be able to detect
AU boundary (i.e., complementary field pair).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1947>
Seungha Yang [Sun, 10 Jan 2021 13:01:27 +0000 (22:01 +0900)]
codecs: h264decoder: Remove unused private variables
... and reset() method to clear internal status at one place
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1947>
Mathieu Duponchelle [Tue, 22 Dec 2020 01:29:03 +0000 (02:29 +0100)]
webrtcbin: try harder not to pick duplicate media ids
On renegotiation, or when the user has specified a mid for
a transceiver, we need to avoid picking a duplicate mid for
a transceiver that doesn't yet have one.
Also assign the mid we created to the transceiver, that doesn't
fix a specific bug but seems to make sense to me.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1902>
Seungha Yang [Thu, 7 Jan 2021 14:47:35 +0000 (23:47 +0900)]
meson: va: Skip configuration on non-linux environment
VA plugin is linux-only plugin, so we can skip it earlier.
Note that this plugin is making use of libdrm meson fallback,
which is unusable on the other platforms such as Windows
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1946>
Haihao Xiang [Thu, 7 Jan 2021 04:41:16 +0000 (12:41 +0800)]
msdkenc: the unit for max-frame-size is kbyte
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1944>
Edward Hervey [Thu, 7 Jan 2021 08:21:47 +0000 (09:21 +0100)]
srt: Define options added in later revisions
Allows compiling the plugin against old headers.
For SRTO_BINDTODEVICE there's nothing we can do, since the value depends on
configuration options of the library. Nice.
Fixes build with libsrt < 1.4.2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1945>
Jakub Adam [Fri, 16 Oct 2020 17:30:59 +0000 (19:30 +0200)]
srtobject: distinguish authentication error messages
Use GST_RESOURCE_ERROR_NOT_AUTHORIZED code in posted error messages
related to SRT authentication (e.g. incorrect or missing password) so
that the application can recognize them more easily.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1943>
Jakub Adam [Fri, 16 Oct 2020 17:27:37 +0000 (19:27 +0200)]
srtobject: detect socket errors from srt_epoll_wait()
On an error event, epoll wait puts the failed socket in both readfds and
writefds. We can take advantage of this and avoid explicitly checking
socket state before every read or write attempt.
In addition, srt_getrejectreason() will give us more detailed
description of the connection failure.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1943>
Olivier Crête [Wed, 30 Dec 2020 18:51:21 +0000 (13:51 -0500)]
webrtcbin: Remove remnant of non-rtcp-mux mode
There was some code left that wasn't used anymore.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1930>
Jakub Adam [Tue, 24 Nov 2020 21:25:15 +0000 (22:25 +0100)]
srtobject: make possible to specify more sockopts in SRT URI
Any socket option that can be passed to libsrt's srt-live-transmit
through SRT URI query string is now recognized.
Also make the code that applies options to SRT sockets more generic.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1842>
Jakub Adam [Wed, 26 Aug 2020 12:33:57 +0000 (14:33 +0200)]
srtsrc: fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1541>
Jakub Adam [Tue, 25 Aug 2020 11:44:42 +0000 (13:44 +0200)]
srtsink: remove unused connection_mode variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1541>
Jakub Adam [Mon, 23 Nov 2020 15:12:39 +0000 (16:12 +0100)]
srtobject: obey "wait-for-connection" in caller mode
The pipeline now gets stuck in gst_srt_object_write_one() until the
receiver comes online, which may or may not be desired based on the use
case.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1836>
Víctor Manuel Jáquez Leal [Tue, 5 Jan 2021 13:18:39 +0000 (14:18 +0100)]
va: mpeg2dec: refactor the picture reference filling
Add the helper function _get_surface_id() which extracts the
VASurfaceID from the passed picture. This function gets the surface of
the next and previous reference picture.
Instead of if-statements, this refactor uses a switch-statement with a
fall-through, for P-type pictures, making the code a bit more readable.
Also it adds quirks for gallium driver, which cannot handle invalid
surfaces as forwarding nor backwarding references, so the function fails.
Also iHD cannot handle them, but to avoid failing, the current picture
is used as self-reference.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
Víctor Manuel Jáquez Leal [Tue, 5 Jan 2021 13:16:45 +0000 (14:16 +0100)]
va: mpeg2dec: set first field either frame or has a first field
Add a helper function _is_frame_start() which check if picture has a
frame structure or if it has not an interlaced first field yet. This
function is used with filling is_first_field parameter.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
Víctor Manuel Jáquez Leal [Wed, 6 Jan 2021 15:38:14 +0000 (16:38 +0100)]
codecs: mpeg2decoder: decode only if B and not closed gop
Mark as decode only if picture type is B, without previous picture in DBP and
closed_gop is 0 as might be understood in "6.3.8 Group of pictures header".
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
Víctor Manuel Jáquez Leal [Wed, 6 Jan 2021 11:48:14 +0000 (12:48 +0100)]
codecs: mpeg2decoder: rename variables
Since prev_picture and next_picture are plain pointers, not pointer to pointers,
it's misleading to name them with _ptr suffix.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
Víctor Manuel Jáquez Leal [Mon, 4 Jan 2021 20:02:35 +0000 (21:02 +0100)]
va: display: parse and set driver implementation
This enum can be used for quirk handling. It's not a property because
the driver enum list might change, it's not static, thus avoiding the
update of GType declaration.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1938>
Víctor Manuel Jáquez Leal [Mon, 4 Jan 2021 19:56:26 +0000 (20:56 +0100)]
va: display: add function precondition check
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1938>
Jakub Adam [Tue, 25 Aug 2020 17:12:13 +0000 (19:12 +0200)]
srtobject: post a message on the bus when broken socket is detected
So that the application gets notified may react to it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1935>
He Junyan [Wed, 30 Dec 2020 15:29:47 +0000 (23:29 +0800)]
va: mpeg2dec: Using the current picture's surface when missing reference.
When missing the reference frames, we should not just discard the current
frame. Some streams have group of picture header. It is an optional header
that can be used immediately before a coded I-frame to indicate to the decoder
if the first consecutive B-pictures immediately following the coded I-frame can
be reconstructed properly in the case of a random access.
In that case, the B frames may miss the previous reference and can still be
correctly decoded. We also notice that the second field of the I frame may
be set to P type, and it only ref its first field.
We should not skip all those frames, and even the frame really misses the
reference frame, some manner such as inserting grey picture should be used
to handle these cases.
The driver crashes when it needs to access the reference picture while we set
forward_reference_picture or backward_reference_picture to VA_INVALID_ID. We
now set it to current picture to avoid this. This is just a temp manner.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
He Junyan [Wed, 30 Dec 2020 15:14:01 +0000 (23:14 +0800)]
codecs: mpeg2decoder: Creating the field based on its arriving time.
Spec says:
In a frame picture top_field_first being set to ‘1’ indicates that the
top field of the reconstructed frame is the first field output by the
decoding process. top_field_first being set to ‘0’ indicates that the
bottom field of the reconstructed frame is the first field output by
decoding process.
Here, the "output" should be interpreted just as the output order, not
including the decoding order. The field should be decoded as the order
they comes in the stream. Namely, no matter top_field_first is 0 or 1,
the first coming field is the first one to be decoded.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
He Junyan [Fri, 1 Jan 2021 08:00:10 +0000 (16:00 +0800)]
va: mpeg2dec: Apply buffer_flags to the output buffer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
He Junyan [Fri, 1 Jan 2021 07:56:03 +0000 (15:56 +0800)]
codecs: Add buffer_flags for mpeg2 picture.
We need to store the buffer flags such as GST_VIDEO_BUFFER_FLAG_INTERLACED
and GST_VIDEO_BUFFER_FLAG_TFF for interlaced video. Without these flags,
the VPP and display elements can not apply filter correctly.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
He Junyan [Wed, 30 Dec 2020 15:00:51 +0000 (23:00 +0800)]
codecs: Reset the quant matrices for each sequence in mpeg2 decoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
Raghavendra [Tue, 27 Oct 2020 06:22:09 +0000 (11:52 +0530)]
srt: Add authentication to srtsink and srtsrc elements
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1725>
Haihua Hu [Wed, 30 Dec 2020 14:52:01 +0000 (22:52 +0800)]
dashsink: fix critical log when exit dynamic pipeline
availability-start-time and publish-time shared the same
GstDateTime object, this object will be unref twice and
cause reference count issue. Should use g_value_dup_boxed()
to copy this object.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1928>
Haihao Xiang [Wed, 23 Dec 2020 08:11:42 +0000 (16:11 +0800)]
msdkenc{h264,h265}: add min-qp and max-qp properties
The SDK allows user to set a QP range [1], so add min-qp and max-qp to
sepecify QP range. By default, there is no limitations on QP.
[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
Haihao Xiang [Wed, 23 Dec 2020 05:36:02 +0000 (13:36 +0800)]
msdkenc{h264,h265}: add p-pyramid property
The SDK can support P-Pyramid reference structure [1], so add a new
property to enable this feature in msdkenc{h264,h265}.
[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#preftype
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
Haihao Xiang [Tue, 22 Dec 2020 08:17:18 +0000 (16:17 +0800)]
msdkh265enc: add b-pyramid property
Like as msdkh264enc, b-pyramid is added to enable B-Pyramid reference
structure for H265 encoding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
Haihao Xiang [Tue, 22 Dec 2020 06:54:59 +0000 (14:54 +0800)]
msdkh265enc: add transform-skip property
Since the SDK API 1.26, TransformSkip was added to control
transform_skip_enabled_flag setting in PPS [1]
[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
Haihao Xiang [Tue, 29 Dec 2020 01:41:05 +0000 (09:41 +0800)]
msdk: needn't close mfx session when failed
Otherwise we will get double free issue because mfx session is closed in
finalize. See
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1867#note_739346
for the double free issue.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1916>
Olivier Crête [Tue, 29 Dec 2020 18:29:05 +0000 (13:29 -0500)]
webrtcstats: PLI/FIR/NACK direction are the opposite of the media
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1924>
Sebastian Dröge [Tue, 29 Dec 2020 11:15:10 +0000 (13:15 +0200)]
assrender: Don't try unlocking unlocked mutex
When flushing right at the beginning of the video chain function or
when failing negotiation at the top of the function, the assrender mutex
would be unlocked without being previously locked.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1918>
Seungha Yang [Sun, 27 Dec 2020 13:16:13 +0000 (22:16 +0900)]
d3d11compositor: Add support for resolution change
Not only for position update (e.g., xpos, ypos),
we need to configure shader again per resolution change of each
input stream.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1912>
Seungha Yang [Sun, 27 Dec 2020 19:33:11 +0000 (04:33 +0900)]
d3d11shader: Fix ID3DBlob object leak
Even if HLSL compiler was able to compile our shader code, D3DCompile()
might return ID3DBlob object for compile warnings and the object
should be released.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1914>
He Junyan [Mon, 28 Dec 2020 09:13:22 +0000 (17:13 +0800)]
codecs: Fix a typo in mpeg2 stateless decoder base class.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1915>
Víctor Manuel Jáquez Leal [Thu, 24 Dec 2020 19:07:09 +0000 (20:07 +0100)]
va: mpeg2dec: cosmetic changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
Víctor Manuel Jáquez Leal [Sun, 27 Dec 2020 14:47:13 +0000 (15:47 +0100)]
codecs: mpeg2decoder: fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
Víctor Manuel Jáquez Leal [Thu, 24 Dec 2020 15:20:31 +0000 (16:20 +0100)]
codecs: mpeg2decoder: simplify macros
For constructors, instead of casting to pointers, cast to the structures.
For compare, use inlined functions.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
He Junyan [Fri, 18 Dec 2020 14:28:41 +0000 (22:28 +0800)]
va: Add mpeg2 VA decoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
He Junyan [Fri, 18 Dec 2020 13:25:08 +0000 (21:25 +0800)]
codecs: Add mpeg2 stateless decoder base class.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
Seungha Yang [Sat, 26 Dec 2020 18:16:28 +0000 (03:16 +0900)]
mfvideoenc: Re-define default GOP size value
The behavior for zero AVEncMPVGOPSize value would be
varying depending on GPU vendor implementation and some
GPU will produce keyframe only once at the beginning of encoding.
That's unlikely expected result for users.
To make this property behave consistently among various GPUs,
this commit will change default value of "gop-size" property to -1
which means "auto". When "gop-size" is unspecified, then
mfvideoenc will calculate GOP size based on framerate
like that of our x264enc implementation.
See also
https://docs.microsoft.com/en-us/windows/win32/directshow/avencmpvgopsize-property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1911>
Seungha Yang [Sat, 26 Dec 2020 18:43:11 +0000 (03:43 +0900)]
mfvideoenc: Fix use of uninitialized value
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1911>
Seungha Yang [Thu, 24 Dec 2020 12:31:04 +0000 (21:31 +0900)]
d3d11device: Add property for getting adapter LUID
LUID (Locally Unique Identifier) can used for identifying GPU
and that's required for some Windows APIs (e.g., MFTEnum2()) to setup device.
See also
https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mftenum2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1910>
Seungha Yang [Sat, 26 Dec 2020 11:39:07 +0000 (20:39 +0900)]
mfvideoenc: Remove duplicated class registration code
Each codec subclass has the same code for class/element registration,
so we can move the code into one helper methodm and that will make
future enhancement simple.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1909>
Haihao Xiang [Thu, 10 Dec 2020 03:11:04 +0000 (11:11 +0800)]
msdk: check GstMsdkContext instead of mfxSession instance
When creating a GstMsdkContext instance, it also creates a mfxSession
instance, so we may check GstMsdkContext instead of mfxSession instance
to make sure MSDK is available. In addition, according to MSDK doc [1],
MFXVideoCORE_SetHandle function should be executed before any actual
usage of library including queries, otherwise the behavior is
unexpected, so we should call MFXVideoCORE_QueryPlatform after
MFXVideoCORE_SetHandle on Linux
[1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#working-with-va-api-applications
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1867>
Seungha Yang [Wed, 23 Dec 2020 12:21:55 +0000 (21:21 +0900)]
d3d11: Remove unnecessary helper methods
We can query selected D3D_FEATURE_LEVEL and factory version
by using native D3D11 API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1906>
Seungha Yang [Fri, 20 Nov 2020 18:20:36 +0000 (03:20 +0900)]
d3d11: Re-implement Desktop Duplication source
Add a new video source element "d3d11desktopdupsrc" for capturing desktop image
via Desktop Duplication based on Microsoft's Desktop Duplication sample available at
https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/DXGIDesktopDuplication
This element is expected to be a replacement of existing dxgiscreencapsrc
element in winscreencap plugin.
Currently this element can support (but dxgiscreencapsrc cannot)
- Copying captured D3D11 texture to output buffer without download
- Support desktop session transition
e.g., can capture desktop without error even in case that
"Lock desktop" and "Permission dialog"
- Multiple d3d11desktopdupsrc elements can capture the same monitor
Not yet implemented features
- Cropping rect is not implemented, but that can be handled by downstream
- Mult-monitor is not supported. But that is also can be implemented by
downstream element for example via multiple d3d11desktopdup elements
with d3d11compositor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1855>
Seungha Yang [Mon, 21 Dec 2020 15:47:09 +0000 (00:47 +0900)]
d3d11device: Add an optional flags argument for creating device
Extend gst_d3d11_device_new() method so that caller can specify
D3D11_CREATE_DEVICE_FLAG value to use.
See https://docs.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_create_device_flag
for more detail about D3D11_CREATE_DEVICE_FLAG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1901>
Raju Babannavar [Mon, 21 Dec 2020 08:36:53 +0000 (14:06 +0530)]
dvbsuboverlay: Add support for dynamic resolution update.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1487
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1897>
Seungha Yang [Sun, 20 Dec 2020 17:56:55 +0000 (02:56 +0900)]
d3d11device: Remove dead code
We don't use this method since the commit of
0788492461e1b559230cc5c3a354fe5f48f95f8b
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1892>
Seungha Yang [Sat, 19 Dec 2020 17:39:40 +0000 (02:39 +0900)]
d3d11: Privatize d3d11memory implementation
Hide most of symbols of GstD3D11Memory object.
GstD3D11Memory is one of primary resource for imcoming d3d11 library
and it's expected to be a extensible feature.
Hiding implementation detail would be helpful for later use case.
Summary of this commit:
* Now all native Direct3D11 resources are private of GstD3D11Memory.
To access native resources, getter methods need to be used
or generic map (e.g., gst_memory_map) API should be called
apart from some exceptional case such as d3d11decoder case.
* Various helper methods are added for GstBuffer related operations
and in order to remove duplicated code.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1892>
Seungha Yang [Sat, 19 Dec 2020 16:06:24 +0000 (01:06 +0900)]
d3d11: Add a helper method for d3d11buffferpool setup
Remove duplicated code for d3d11buffferpool setup.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1892>
Seungha Yang [Fri, 18 Dec 2020 15:40:53 +0000 (00:40 +0900)]
d3d11device: Remove optional helper methods
Most of Direct3D11 APIs can be called without GstD3D11Device
abstraction. This is a part of prework for public GstD3D11 library
to introduce minimal APIs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1892>
Seungha Yang [Sun, 20 Dec 2020 13:12:44 +0000 (22:12 +0900)]
d3d11videosink: Prepare window once streaming started
... instead of READY state. READY state is too early for setting
overlay window handle especially playbin/playsink scenario
since playsink will set given overlay handle on videosink once
READY state change of videosink is ensured.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1893>
Seungha Yang [Tue, 18 Aug 2020 18:19:26 +0000 (03:19 +0900)]
mfvideoenc: Improve latency performance for hardware encoder
Unlike software MFT (Media Foundation Transform) which is synchronous
in terms of processing input and output data, hardware MFT works
in asynchronous mode. output data might not be available right after
we pushed one input data into MFT.
Note that async MFT will fire two events, one is "METransformNeedInput"
which happens when MFT can accept more input data,
and the other is "METransformHaveOutput", that's for signaling
there's pending data which can be outputted immediately.
To listen the events, we can wait synchronously via
IMFMediaEventGenerator::GetEvent() or make use of IMFAsyncCallback
object which is asynchronous way and the event will be notified
from Media Foundation's internal worker queue thread.
To handle such asynchronous operation, previous working flow was
as follows (IMFMediaEventGenerator::GetEvent() was used for now)
- Check if there is pending output data and push the data toward downstream.
- Pulling events (from streaming thread) until there's at least
one pending "METransformNeedInput" event
- Then, push one data into MFT from streaming thread
- Check if there is pending "METransformHaveOutput" again.
If there is, push new output data to downstream
(unlikely there is pending output data at this moment)
Above flow was processed from upstream streaming thread. That means
even if there's available output data, it could be outputted later
when the next buffer is pushed from upstream streaming thread.
It would introduce at least one frame latency in case of live stream.
To reduce such latency, this commit modifies the flow to be fully
asynchronous like hardware MFT was designed and to be able to
output encoded data whenever it's available. More specifically,
IMFAsyncCallback object will be used for handling
"METransformNeedInput" and "METransformHaveOutput" events from
Media Foundation's internal thread, and new output data will be
also outputted from the Media Foundation's thread.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1520>
Sebastian Dröge [Wed, 16 Dec 2020 16:32:25 +0000 (18:32 +0200)]
decklinkaudiosrc: Fix duration of the first audio frame after each discont
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1886>
Biswapriyo Nath [Tue, 15 Dec 2020 18:58:08 +0000 (00:28 +0530)]
mediafoundation: Fix redefinition of variables.
Remove duplicate GstMFDevice and GstMFDeviceProvider declaration.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1884>
Jan Schmidt [Wed, 16 Dec 2020 17:41:18 +0000 (04:41 +1100)]
audiobuffersplit: Calculate the correct size for fixed size buffers
Fix the output-buffer-size property to do what it says by calculating
the correct audio buffer size for that target size, rounded down to
the nearest whole number of samples.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1887>
Sebastian Dröge [Thu, 10 Dec 2020 10:35:07 +0000 (12:35 +0200)]
decklink: Implement GstBaseSrc::get_caps() to return more constrained caps
Instead of the template caps we can return a subset of them based on the
selected properties.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1868>
Seungha Yang [Thu, 29 Oct 2020 17:21:11 +0000 (02:21 +0900)]
wasapi2: Ensure unmute when opening audio client
ISimpleAudioVolume::SetMute() status seems to be preserved even
after process is terminated. In order to start audio client with
unmuted state, always disable mute when opening audio client.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1731>
Edward Hervey [Mon, 14 Dec 2020 15:12:22 +0000 (16:12 +0100)]
tsparse: Don't use non-object for debugging statement
Use the pad instead
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1880>
Edward Hervey [Mon, 14 Dec 2020 09:56:39 +0000 (10:56 +0100)]
examples/ts-parser: Use the section type for descriptor identification
Some descriptors can only be present in some section
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1880>
Edward Hervey [Mon, 14 Dec 2020 09:56:02 +0000 (10:56 +0100)]
examples/ts-parser: Try more descriptor/stream types
These were added recently
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1880>
Edward Hervey [Wed, 9 Dec 2020 08:14:12 +0000 (09:14 +0100)]
mpegts: Don't add non-padded streams to collection on updates
When carrying over existing GstStream to a new GstStreamCollection we need to
check whether they *actually* were being used in the previous collection.
This avoids adding unknown streams (metadata, PSI, etc...) to the collection on
updates.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1880>
Edward Hervey [Sun, 22 Nov 2020 17:48:08 +0000 (18:48 +0100)]
mpegts: Add support for SIT sections
Selection Information Tables (EN 300 468)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1852>
Edward Hervey [Mon, 14 Dec 2020 09:50:02 +0000 (10:50 +0100)]
mpegts: Update documentation
* Split up into appropriate individual header files
* Document more sections and structures
* Add well-known list of registration id
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1879>
Thibault Saunier [Thu, 10 Dec 2020 19:29:31 +0000 (16:29 -0300)]
player/transcoder: Use bus signal watch
Instead of implementing exactly the same thing ourself but making
`GstBus` not know that it is the case.
Since we are *sure* that the bus can't have been access at the point
where we add the watch we are guaranteed that the current thread
maincontext is going to be used.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1870>
Lim Siew Hoon [Thu, 10 Dec 2020 07:37:14 +0000 (15:37 +0800)]
intervideosrc: fix negotiation of interlaced caps
In 1.0 the field in caps is called "interlace-mode", not "interlaced".
Fixes #1480
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1869>
Arun Raghavan [Sat, 12 Dec 2020 02:45:25 +0000 (21:45 -0500)]
openaptx: Drop lib prefix from option name for consistency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1876>
Igor Kovalenko [Fri, 11 Dec 2020 08:45:06 +0000 (08:45 +0000)]
openaptx: add aptX and aptX-HD codecs using libopenaptx
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1871>
Philippe Normand [Mon, 19 Oct 2020 13:56:43 +0000 (14:56 +0100)]
wpe: Emit load-progress messages
The estimated-load-progress value can be used on application side to display a
progress bar for instance.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1710>
Vivia Nikolaidou [Tue, 8 Dec 2020 14:46:42 +0000 (16:46 +0200)]
basetsmux: Don't send the capsheader if src pad has no caps
That means we're shutting down, so there's no point in the streamheader
being sent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1864>
Matthew Waters [Fri, 4 Dec 2020 06:02:00 +0000 (17:02 +1100)]
rtmp2/connection: pass the parent cancellable down to the connection
Otherwise, when rtpm2src cancels an inflight operation that has a queued
message stored, then the rtmp connection operation is not stopped.
If the cancellation occurs during rtmp connection start up, then
rtpm2src does not have any way of accessing the connection object as it
has not been returned yet. As a result, rtpm2src will cancel, the
connection will still be processing things and the
GMainContext/GMainLoop associated with the outstanding operation will be
destroyed. All outstanding operations and the rtmpconnection object will
therefore be leaked in this case.
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1425
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1862>
Jan Alexander Steffens (heftig) [Mon, 7 Dec 2020 13:54:28 +0000 (14:54 +0100)]
srt: Don't take object lock calling gst_srt_object_get_stats
This function takes the sock lock. This can result in a deadlock when
another thread holding the sock lock is trying to take the object lock.
Thread A (Holds object lock, wants sock lock):
#2 gst_srt_object_get_stats at gst-plugins-bad/ext/srt/gstsrtobject.c:1753
#3 gst_srt_object_get_property_helper at gst-plugins-bad/ext/srt/gstsrtobject.c:409
#4 gst_srt_sink_get_property at gst-plugins-bad/ext/srt/gstsrtsink.c:95
#5 g_object_get_property from libgobject-2.0.so.0
Thread B (Holds sock lock, wants object lock):
#2 gst_element_post_message_default at gstreamer/gst/gstelement.c:2069
#3 gst_element_post_message at gstreamer/gst/gstelement.c:2123
#4 gst_element_message_full_with_details at gstreamer/gst/gstelement.c:2259
#5 gst_element_message_full at gstreamer/gst/gstelement.c:2298
#6 gst_srt_object_send_headers at gst-plugins-bad/ext/srt/gstsrtobject.c:1407
#7 gst_srt_object_send_headers at gst-plugins-bad/ext/srt/gstsrtobject.c:1444
#8 gst_srt_object_write_to_callers at gst-plugins-bad/ext/srt/gstsrtobject.c:1444
#9 gst_srt_object_write at gst-plugins-bad/ext/srt/gstsrtobject.c:1598
#10 gst_srt_sink_render at gst-plugins-bad/ext/srt/gstsrtsink.c:179
Fixes
d2d00e07acc2b1ab1ae5a728ef5dc33c9dee7869.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1861>
Sebastian Dröge [Wed, 25 Nov 2020 14:24:25 +0000 (16:24 +0200)]
ccconverter: Add property to specify which sections to include in CDP packets
Various software, including ffmpeg's Decklink support, fails parsing CDP
packets that contain anything but CC data in the CDP packets.
Based on this property, timecodes are not written into the CDP packets
even if they're present.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1833>
Sebastian Dröge [Wed, 25 Nov 2020 12:54:09 +0000 (14:54 +0200)]
ccconverter: Refactor code to only retrieve the timecode meta once
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1833>
Víctor Manuel Jáquez Leal [Sun, 6 Dec 2020 17:03:47 +0000 (18:03 +0100)]
va: decode: fix display type
Instead of a pointer to GstVaDisplay it was used a VADisplay type, which in
certain platforms is the same, and the compiler didn't complain.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1860>
Marc Leeman [Fri, 3 Jul 2020 10:25:31 +0000 (12:25 +0200)]
rtpmanagerbad: allow setting caps on rtpsrc
rtpsrc tries to do a lookup of the caps based on the encoding-name. For
not so standard encodings, the caps can be set, avoiding the lookup.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1406>
Seungha Yang [Sat, 21 Nov 2020 19:39:57 +0000 (04:39 +0900)]
d3d11videosink: Add a property to support rendering statistics data on window
Add a new property "render-stats" to allow rendering statistics
data on window for debugging and/or development purpose.
Text rendering will be accelerated by GPU since this implementation
uses Direct2D/DirectWrite API and Direct3D inter-op for minimal overhead.
Specifically, text data will be rendered on swapchain backbuffer
directly without any copy/allocation of extra texture.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1830>
Seungha Yang [Thu, 3 Dec 2020 18:40:17 +0000 (03:40 +0900)]
d3d11: Protect ID3D11VideoContext with lock
Likewise d3d11 immediate context (i.e., ID3D11DeviceContext),
ID3D11VideoContext API is not thread safe. It must be protected therefore.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1856>
Mathieu Duponchelle [Thu, 3 Dec 2020 16:13:15 +0000 (17:13 +0100)]
docs: don't exit the subdir when optional deps aren't found
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1854>
Edward Hervey [Wed, 2 Dec 2020 10:29:08 +0000 (11:29 +0100)]
opencv: Expose retinex parameters
Makes the plugin a tad more useful :)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1845>
Marius Vlad [Mon, 12 Oct 2020 11:12:07 +0000 (14:12 +0300)]
gst-libs/gst/wayland: Install "unstable" wayland header
Context creation and retrieval is required, the symbols are exported
with the header missing. Users most likely define GST_USE_UNSTABLE_API
so they're aware of the implications of using a header that might change
between releases.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1688>
Edward Hervey [Thu, 3 Dec 2020 13:12:06 +0000 (14:12 +0100)]
hlsdemux: Use actual object for logging
i.e. the pad of the stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1853>
Arun Raghavan [Thu, 3 Dec 2020 11:55:00 +0000 (06:55 -0500)]
curl: Remove incorrect GST_DEBUG_OBJECT() calls
klass is not a GstObject, and these debugs print should likely not be
around anyway.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1851>
Edward Hervey [Wed, 25 Nov 2020 16:59:54 +0000 (17:59 +0100)]
cuda: Fix lowest targetted architecture for CUDA >= 11.0
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1469
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1835>
Edward Hervey [Thu, 5 Nov 2020 11:48:27 +0000 (13:48 +0200)]
tsparse: Forward incoming timestamps
Ensure we properly forward the upstream PTS/DTS on the regular and program
source pads. All packets being processed will carry over the latest PTS/DTS (as
a reconstructed GstBuffer).
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1419
And properly forward PTS/DTS for program pads (which wasn't the case before)
Original patch by Vivia Nikolaidou <vivia@ahiru.eu>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1769>
Sebastian Dröge [Wed, 2 Dec 2020 07:39:45 +0000 (09:39 +0200)]
adaptivedemux: Don't log with non-GObject objects
Instead of using the streams, log with the pad of the streams.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1457
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1844>
Thibault Saunier [Fri, 20 Nov 2020 14:29:46 +0000 (11:29 -0300)]
transcodebin: Minor error message enhancement
Thibault Saunier [Fri, 20 Nov 2020 01:56:46 +0000 (22:56 -0300)]
transcodebin: Unlock while setting decodebin caps
Otherwise it will deadlock recursing up to notify parent object property changes
Thibault Saunier [Thu, 19 Nov 2020 21:31:34 +0000 (18:31 -0300)]
transcodebin: Avoid plugin converter if filter handles ANY caps
For example identity or clocksync or this kind of elements can be
used with any data flow and we should not enforce decoding to row in
that case.
Thibault Saunier [Thu, 19 Nov 2020 21:39:33 +0000 (18:39 -0300)]
transcodebin: Add filter as soon as it is set
Instead of waiting so that we can simply use a clocksync element as
filter, otherwise we won't know the pipeline is live as it won't
return NO_PREROLL as one would expect in that case.
Adding it right away shouldn't create any issue, both ways are fine.
Thibault Saunier [Thu, 19 Nov 2020 21:29:15 +0000 (18:29 -0300)]
uritranscodebin: Add `setup-source` and `element-setup` signals
The same way as playbinX does it as it is often quite useful
Thibault Saunier [Thu, 19 Nov 2020 20:55:10 +0000 (17:55 -0300)]
transcode: Port to encodebin2
This allows supporting muxing sinks like hlssink2 or splitmux