Commit graph

113094 commits

Author SHA1 Message Date
Brady J. Garvin
2b8eef30e7 validate:launcher: Ensure a positive job count.
The default number of jobs to use is half of the available cores
rounded down, but in situations where only one core is available (such
as under some VMs), this means that `gst-validate-launcher` defaults
to using zero jobs, a case that the test-running code is not prepared
to handle.

This change makes the code match the documentation for the `--jobs` option,
guards against negative values both in the default setting and in argument
parsing, and introduces some defensive programming to prevent other situations
where the code might try to use zero jobs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/154>
2021-01-30 10:11:57 -06:00
Marijn Suijten
9ab400e267 gstaudiostreamalign: Pass self as const pointer in getter functions
It was noticed in [1] that `GstAudioStreamAlign` is a simple boxed type
that is passed as const in the copy function, but not as such in the
getters. These functions turn out to be the only users of `const = true`
overrides in `gstreamer-rs`. Since there is no locking or other advanced
caching/sharing going on (as happens with miniobjects) these functions
can safely take self as const pointer.

[1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/683#note_783129

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1025>
2021-01-29 21:42:47 +01:00
Nicolas Dufresne
99ebbf72ef v4l2codecs: h264: Enable 1 frame delay on non-live
When doing non-live decoding, enable 1 frame of delay. This will ensure
that we queue the next decoding job before we actually wait for the previous
to complete. This improves throughput notably on RK3399.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
241a490084 v4l2codecs: Add support for render delay
This add support for render delay in the decoder helper.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
88b93416fe v4l2codecs: Coding style fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
13a40b1da9 v4l2codecs: Poll inside set_done()
This removes the need for the gst_v4l2_decoder_is_done() helper and
simplify slightly the subclass code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
1c2f391b57 v4l2codecs: Make request structure ref-counted
This adds a non-thread safe refcount to the GstV4l2Request. This will
allow holding on more then one request in order to implement render
delay. This is made non-thread safe for speed as we know this will all
happen on the same streaming thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Nicolas Dufresne
3db6f45ca9 v4l2codecs: Rework handling of queues and pending requests
Starting from this patch, all queue and dequeue operation happening
on V4L2 is now abstracted with the request. Buffers are dequeued
automatically when pending requests are marked done and only 1 in-flight
request is now used.

Along with fixing issues with request not being reused with slice
decoders, this change reduces the memory footprint by allocating only
two bitstream buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
2021-01-29 19:44:48 +00:00
Mathieu Duponchelle
8bbd06c7c6 ges-launcher: do not set rendering details too early
It looks like the _set_rendering_details call is superfluous
in _startup(), as it will get called in run_pipeline.

The problem with calling it before timeline_set_user_options
is that we are going to fail creating a smart profile if
the user selected eg --track-types=video, as the get_smart_profile
method compares the tracks in the asset with those on the timeline.

Reproduce with a video-only clip:

ges-launch-1.0 --track-types=video +clip file://$PWD/jelly.mp4 \
inpoint=15.0 -o foo.mp4 --smart-rendering

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/228>
2021-01-29 20:42:26 +01:00
Staz M
180ab8377f decklink: Fixed decklinkvideosink auto format detection
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1994>
2021-01-29 16:49:07 +00:00
Seungha Yang
fba807bead nvh264sldec: Add support for output-delay to improve throughput performance
NVDEC API support delaying getting decoded output, and recommended
delay by API document is 4 frames. In case that throughput is
more critical factor than latency, we can prefer delayed output
as recommended by NVIDIA.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1925>
2021-01-29 16:22:28 +00:00
Seungha Yang
86e312c1b1 codecs: h264decoder: Add support for output delay
Some decoding APIs support delayed output or a command for decoding
a frame doesn't need to be sequential to corresponding command for
getting decoded frame. For instance, subclass might be able to
request decoding for multiple frames and then get for one (oldest)
decoded frame or so.
If aforementioned case is supported by specific decoding API,
delayed output might show better throughput performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1925>
2021-01-29 16:22:28 +00:00
Haihao Xiang
4ff4bcd725 libs: display: drm: support gst.vaapi.app.Display context for drm backend
Attributes for drm backend:
- va-display : ponter of VADisplay
- drm-device-fd : the DRM device file descriptor

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/409>
2021-01-29 14:08:42 +00:00
Haihao Xiang
85284f4aac libs: display: drm: allow user specify a drm device via an env variable
Currently the default drm device is always used on a system with
multiple drm devices. This patch allows user to specify the required
drm device via GST_VAAPI_DRM_DEVICE env variable

Example:
GST_VAAPI_DRM_DEVICE=/dev/dri/renderD129 gst-launch-1.0 videotestsrc !
vaapih264enc ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/409>
2021-01-29 14:08:42 +00:00
Jakub Adam
11e6f8da92 video-hdr: Add API to check content light level equality
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/969>
2021-01-28 20:55:38 +01:00
Aleksandr Slobodeniuk
ec83432140 gstvalue: fix compilation warning in "holds" macros
GST_VALUE_HOLDS_... macros may cause -Waddress warning
on gcc if GValue is allocated on stack:

gstvalue.h:145:46: warning: the comparison will always
evaluate as ‘true’ for the address of ‘v’ will never
be NULL [-Waddress]

 #define GST_VALUE_HOLDS_CAPS(x)         ((x) != NULL &&
  G_VALUE_TYPE(x) == _gst_caps_type)

Fixes #653

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/738>
2021-01-28 16:15:13 +00:00
Haihao Xiang
23967fc02b libs: display: drm: fix set_device_path_from_fd
drmGetBusid() (GET_UNIQUE ioctl) won't return a valid bus id when
drmSetInterfaceVersion() (SET_VERSION ioctl) hasn't been called(see[1]),
so we can't get the right device path. Running test-display will get the
error below:

** (test-display:18630): ERROR **: 10:26:00.434: could not create Gst/VA
display

Calling drmSetInterfaceVersion() before drmGetBusid() can't fix this
issue because a special permission is required for SET_VERSION ioctl.

This patch retrieves the device path from file descriptor via
g_file_read_link()

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_ioctl.c#L48-L104

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/412>
2021-01-28 09:48:56 +08:00
Arun Raghavan
a417a761fd ldac: Use pkg-config instead of raw lib/header search
The ldacBT library includes pkg-config files for the standard and ABR
libraries, so let's just use that instead of doing a header/library
search.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1990>
2021-01-27 17:16:57 -05:00
Seungha Yang
66eed8a61d d3d11videosink: Don't limit max buffers of buffer pool
In some case, especially reverse playback, we would need more than
two buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1989>
2021-01-27 20:08:51 +00:00
Jordan Petridis
d5136450c2 docker/fedora: run git gc after cloning the subprojects
Most of the subprojects specify depth=1 in the wrap file,
so this doesn't have a big effect atm.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-ci/-/merge_requests/375>
2021-01-27 13:15:07 +00:00
Jordan Petridis
dbf14146b9 citemplate: use meson 0.56 and suproject update --reset
The windows build will be updated in a later
commit.

Close #73 #74 #75

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-ci/-/merge_requests/375>
2021-01-27 13:15:07 +00:00
Guillaume Desmottes
df9064fdc6 rtpbasedepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was
impossible to do so as they didn't have access to the caps.

Fix #864

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes
912cf46b83 rtpbasepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was
impossible to do so as they didn't have access to the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Guillaume Desmottes
5acde5568e rtpbasedepayload: fix clear-extensions signal definition
Typo as we were using the wrong enum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
2021-01-27 09:48:49 +01:00
Knobe, Daniel
cdbf535f01 overlay/example: added qt core dependency for qt overlay example
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1020>
2021-01-27 07:44:59 +00:00
Bing Song
5f00810ee0 v4l2h265codec: fix HEVC profile string issue.
Keep HEVC profile compatible with other module.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/850>
2021-01-27 01:22:41 +00:00
Seungha Yang
0b0bf1b0bf d3d11: Suppress some warning debug messages
* Don't warn for live object, since ID3D11Debug itself seems to be
  holding refcount of ID3D11Device at the moment we called
  ID3D11Debug::ReportLiveDeviceObjects(). It would report live object
  always
* Device might not be able to support some formats (e.g., P010)
  especially in case of WARP device. We don't need to warn about that.
* gst_d3d11_device_new() can be used for device enumeration. Don't warn
  even if we cannot create D3D11 device with given adapter index therefore.
* Don't warn for HLSL compiler warning. It's just noise and
  should not be critical thing at all

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1986>
2021-01-27 04:46:42 +09:00
Henry Wilkes
60922c0288 ges-structure-parser: force string types
Force a string type for structure values obtained through parsing a
serialized timeline by inserting a (string) specifier after a '=',
rather than relying on gst_structure_from_string guessing the type.

As such, the functions that extract clocktimes and properties are
modified to accept string value types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/123>
2021-01-26 18:16:50 +00:00
Henry Wilkes
d8dbf50603 command-line-formatter: fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/123>
2021-01-26 18:16:50 +00:00
Henry Wilkes
a33a3b145d marker-list: made deserialize reverse of serialize
Changed deserialize method to actually reverse the serialize method by
removing the edge quote marks and reversing g_strescape.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/452

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/123>
2021-01-26 18:16:50 +00:00
Seungha Yang
657370a91c examples: Add d3d11videosink examples for shared-texture use cases
Add two examples to demonstrate "draw-on-shared-texture" use cases.

d3d11videosink will draw application's own texture without copy
by using:
- Enable "draw-on-shared-texture" property
- make use of "begin-draw" and "draw" signals

And then, application will render the shared application's texture
to swapchain's backbuffer by using
1) Direct3D11 APIs
2) Or, Direct3D9Ex + interop APIs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1873>
2021-01-26 18:14:37 +00:00
Seungha Yang
60e223f4fd d3d11videosink: Add support for drawing on application's own texture
Add a way to support drawing on application's texture instead of
usual window handle.
To make use of this new feature, application should follow below step.
1) Enable this feature by using "draw-on-shared-texture" property
2) Watch "begin-draw" signal
3) On "begin-draw" signal handler, application can request drawing
   by using "draw" signal action. Note that "draw" signal action
   should be happen before "begin-draw" signal handler is returned

NOTE 1) For texture sharing, creating a texture with
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag is strongly recommend
if possible because we cannot ensure sync a texture
which was created with D3D11_RESOURCE_MISC_SHARED
and it would cause glitch with ID3D11VideoProcessor use case.

NOTE 2) Direct9Ex doesn't support texture sharing which was
created with D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX. In other words,
D3D11_RESOURCE_MISC_SHARED is the only option for Direct3D11/Direct9Ex interop.

NOTE 3) Because of missing synchronization around ID3D11VideoProcessor,
If shared texture was created with D3D11_RESOURCE_MISC_SHARED,
d3d11videosink might use fallback texture to convert DXVA texture
to normal Direct3D texture. Then converted texture will be
copied to user-provided shared texture.

* Why not use generic appsink approach?
In order for application to be able to store video data
which was produced by GStreamer in application's own texture,
there would be two possible approaches,
one is copying our texture into application's own texture,
and the other is drawing on application's own texture directly.
The former (appsink way) cannot be a zero-copy by nature.
In order to support zero-copy processing, we need to draw on
application's own texture directly.

For example, assume that application wants RGBA texture.
Then we can imagine following case.

"d3d11h264dec ! d3d11convert ! video/x-raw(memory:D3D11Memory),format=RGBA ! appsink"
                             ^
                             |_ allocate new Direct3D texture for RGBA format

In above case, d3d11convert will allocate new texture(s) for RGBA format
and then application will copy again the our RGBA texutre into
application's own texture. One texture allocation plus per frame GPU copy will hanppen
in that case therefore.
Moreover, in order for application to be able to access
our texture, we need to allocate texture with additional flags for
application's Direct3D11 device to be able to read texture data.
That would be another implementation burden on our side

But with this MR, we can configure pipeline in this way
"d3d11h264dec ! d3d11videosink".

In that way, we can save at least one texture allocation and
per frame texutre copy since d3d11videosink will convert incoming texture
into application's texture format directly without copy.

* What if we expose texture without conversion and application does
  conversion by itself?
As mentioned above, for application to be able to access our texture
from application's Direct3D11 device, we need to allocate texture
in a special form. But in some case, that might not be possible.
Also, if a texture belongs to decoder DPB, exposing such texture
to application is unsafe and usual Direct3D11 shader cannot handle
such texture. To convert format, ID3D11VideoProcessor API needs to
be used but that would be a implementation burden for application.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1873>
2021-01-26 18:14:37 +00:00
Haihua Hu
66788366a0 dashsink: add h265 codec support
Return hvc1 for video/x-h265 mime type in mpd helper function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1966>
2021-01-26 17:47:53 +00:00
He Junyan
db134d27a0 av1parse: set the default alignment for input and output.
1. Set the default output alignment to frame, rather than current
   alignment of obu. This make it the same behaviour as h264/h265
   parse, which default align to AU.
2. Set the default input alignment to byte. It can handle the "not
   enough data" error while the OBU alignment can not. Also make it
   conform to the comments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>
2021-01-26 12:22:31 +00:00
He Junyan
be7a9e29df test: Add more test cases for the av1parse obu aligned output.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>
2021-01-26 12:22:31 +00:00
He Junyan
5abf4ad4dd av1parse: Reset the annex_b when meet TU inside a buffer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>
2021-01-26 12:22:31 +00:00
He Junyan
d83f253258 av1parse: Output each OBU when output is aligned to obu.
The current behaviour for obu aligned output is not very precise.
Several OBUs will be output together within one gst buffer. We
should output each gst buffer just containing one OBU. This is
the same way as the h264/h265 parse do when NAL aligned.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>
2021-01-26 12:22:31 +00:00
He Junyan
ee1f6017ac av1parse: Always copy the OBU to cache.
The current optimization when input align and out out align are
the same is not very correct. We simply copy the data from input
buffer to output buffer, but we failed to consider the dropping of
OBUs. When we need to drop some OBUs(such as filter out the OBUs
of some temporal ID), we can not do simple copy. So we need to
always copy the input OBUs into a cache.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>
2021-01-26 12:22:31 +00:00
He Junyan
a9c8aa4788 av1parse: Improve the logic when to drop the OBU.
When drop some OBU, we need to go on. The current manner will make
the data access out range of the buffer mapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1979>
2021-01-26 12:22:31 +00:00
Marijn Suijten
e8bb0fa062 ext/ldac: Move duplicate sampling rates into #define
Because there was a typo in one of the duplicates already (see previous
commit) it is much safer to specify these once and only once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1985>
2021-01-26 11:12:28 +01:00
Marijn Suijten
3747fdb1a6 ext/ldac: Fix typo in 88200(0) stereo encoder sampling rate
Fixes: a57681455 ("ext: Add LDAC encoder")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1985>
2021-01-26 11:02:21 +01:00
Jordan Petridis
8aa80fb714 citemplate: only spawn a single pipeline in Merge Requests
This is the 3rd or 4th time we are trying this yes, (!331),
but hear me out. This time is for Real!

Jokes aside, its possible to avoid spawning >1 pipeline per event
with gitlab 13.8.

https://gitlab.com/gitlab-org/gitlab/-/issues/201845

https://gitlab.com/gitlab-org/gitlab/-/issues/299409

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-ci/-/merge_requests/391>
2021-01-26 08:54:44 +02:00
Seungha Yang
6f6a82d0f5 d3d11: Add support for MPEG-2 video decoding
Add DXVA/Direct3D11 API based MPEG-2 decoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1969>
2021-01-25 18:05:53 +00:00
Guillaume Desmottes
0896ccb436 rtp: fix clear-extensions signal definition
Typo as we were using the wrong enum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1018>
2021-01-25 14:28:12 +01:00
Guillaume Desmottes
d396190b91 rtphdrext: fix typo in doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1018>
2021-01-25 14:28:12 +01:00
Matthew Waters
3ed0ee95f2 wpesrc: fix possible small deadlock on shutdown
Problem is that unreffing the EGLImage/SHM Buffer while holding the
images_mutex lock may deadlock when a new buffer is advertised and
an attempt is made to lock the images_mutex there.

The advertisement of the new image/buffer is performed in the
WPEContextThread and the blocking dispatch when unreffing wants to run
something on the WPEContextThread however images_mutex has already been
locked by the destructor.

Delay unreffing images/buffers outside of images_mutex and instead just
clear the relevant fields within the lock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1843>
2021-01-25 09:15:28 +00:00
Haihua Hu
1753d2931c dashsink: fix double unref of sinkpad caps
no need to unref caps in gst_mpd_helper_get_XXX_codec_from_mime
it will be unref in caller gst_dash_sink_get_stream_metadata()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1981>
2021-01-25 10:28:45 +08:00
Peter Boba
2248c5a389 Fix time-management tutorial sample code
Adds newline to a print statement so it doesn't overwrite the position
output. (I'd like to see the last timestamp for the position output).
2021-01-24 21:45:49 +01:00
He Junyan
e8ec8f7dd7 codecparsers: av1: Fix a typo in frame_restoration_type setting.
Fixes: #1500
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1974>
2021-01-23 10:53:44 +00:00
He Junyan
7196abf7a3 av1parse: Fix some issues in the src caps.
1. Add the mono_chrome to identify 4:0:0 chroma-format.
2. Correct the mapping between subsampling_x/y and chroma-format.
   There is no 4:4:0 format definition in AV1. And 4:4:4 should
   let both subsampling_x/y be equal to 0.
3. Send the chroma-format when the color space is not RGB.

Fixes: #1502
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1974>
2021-01-23 10:53:44 +00:00