Commit graph

270 commits

Author SHA1 Message Date
Stéphane Cerveau 08f924b491 FAQ: add mention to downstream cherry-pick
Give an help to cherry-pick an upstream patch to
downstream repository (old stable version)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1095>
2021-10-08 14:34:00 +02:00
Seungha Yang 7286c8e302 d3d11: d3d11desktopdupsrc: Add support for non-D3D11 downstream element
By this commit, application doesn't need to configure d3d11download
element for software pipeline which will make things simpler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1082>
2021-10-08 16:13:46 +09:00
Thibault Saunier b590511146 validate:scenario: Allow waiting signal searching for element factory
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1064>
2021-10-07 15:05:53 +00:00
Marek Vasut e6d83d8f96 jpegdec: Support libjpeg-turbo colorspace conversion
The libjpeg-turbo has a built-in support for performing colorspace
conversion. The performance of this conversion is much better than
doing the same separately using videoconvert. Implement support for
this conversion to RGBx/xRGB/BGRx/xBGR formats. Other formats can
be easily added later.

- The decoding of various pixel formats can be tested and compared to
  non-libjpeg-turbo decoding as follows:
  for gfmt in {RGB,BGR}{,x} x{RGB,BGR} ; do
      echo "$gfmt"
      gst-launch-1.0 -q \
          videotestsrc pattern=colors ! \
          video/x-raw,format=${gfmt} ! \
          fakesink dump=true | \
	  head -n 200 | tail -n 1
      gst-launch-1.0 -q --gst-plugin-path=build/ext/jpeg/ \
          videotestsrc pattern=colors ! \
          video/x-raw,format=${gfmt} ! \
	  jpegenc ! \
	  jpegdec ! \
	  video/x-raw,format=${gfmt} ! \
	  fakesink dump=true | \
	  head -n 200 | tail -n 1
      done
  Result looks as follows, i.e. comparable:
  RGB
  00000c70 (0x7f7736fbdd10): 05 33 19 05 33 26 05 33 33 05 33 40 05 33 4c 05  .3..3&.33.3@.3L.
  00000c70 (0x7f389e8f7d10): 05 32 17 04 32 22 04 32 31 04 32 3e 04 32 4a 04  .2..2".21.2>.2J.
  RGBx
  00000c70 (0x7f79efd0ad10): cc 07 22 ff d9 07 22 ff e6 07 22 ff f3 07 22 ff  .."..."..."...".
  00000c70 (0x7fb6989f3d10): cd 06 22 00 d9 06 22 00 e6 06 22 00 f4 06 22 00  .."..."..."...".
  BGR
  00000c70 (0x7fa0a6c42d10): 05 0c 33 05 19 33 05 26 33 05 33 33 05 40 33 05  ..3..3.&3.33.@3.
  00000c70 (0x7fc74165fd10): 05 08 32 04 17 32 04 22 32 04 31 32 04 3e 32 04  ..2..2."2.12.>2.
  BGRx
  00000c70 (0x7fbf399f1d10): 22 07 cc ff 22 07 d9 ff 22 07 e6 ff 22 07 f3 ff  "..."..."..."...
  00000c70 (0x7f50e3d1cd10): 22 06 cd 00 22 06 d9 00 22 06 e6 00 22 06 f4 00  "..."..."..."...
  xRGB
  00000c70 (0x7f0b950a2d10): ff cc 07 22 ff d9 07 22 ff e6 07 22 ff f3 07 22  ..."..."..."..."
  00000c70 (0x7f4416b8dd10): 00 cd 06 22 00 d9 06 22 00 e6 06 22 00 f4 06 22  ..."..."..."..."
  xBGR
  00000c70 (0x7f237d74dd10): ff 22 07 cc ff 22 07 d9 ff 22 07 e6 ff 22 07 f3  ."..."..."..."..
  00000c70 (0x7f095547dd10): 00 22 06 cd 00 22 06 d9 00 22 06 e6 00 22 06 f4  ."..."..."..."..
                             ^^          ^^          ^^          ^^
  Notice how the alpha channel is set to arbitrary value in case of the
  libjpeg-turbo decoding into RGBx/BGRx/xRGB/xBGR pixel formats. This is
  documented in libjpeg-turbo README.md as follows:
    "
    When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
    X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
    can set that byte to whatever value it wishes.
    "

- The interlaced num_fields=2 mjpeg stream can be generated and
  tested as follows (this does require mjpegtools):
  $ gst-launch-1.0 videotestsrc num-buffers=10 ! jpegenc ! multifilesink location=in%04d.jpg
  $ jpeg2yuv -f 25 -I t -L 0 -j in%04d.jpg | yuv2lav -f avi -o result.avi
  ...
  $ gst-launch-1.0 --gst-plugin-path=build/ext/jpeg/ filesrc location=result.avi ! \
       avidemux ! jpegdec ! video/x-raw,format=RGBx ! videoconvert ! autovideosink

Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1091>
2021-10-07 12:40:29 +00:00
Sebastian Dröge 14d636b224 rtsp-media: Unprepare suspended medias too
Previously suspended medias immediately reached the UNPREPARED state
without going through the media's unprepare() vfunc. This didn't allow
the media subclass to do any additional cleanup, and for example the
shutdown-eos property of GstRTSPMedia was ignored.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1090>
2021-10-07 11:16:39 +00:00
Seungha Yang 314901a208 tests: gstmeta: Fix failure on Windows
Windows doesn't support fork so every test will be performed in
one process. So the test_meta_custom_transform() is being
failed because "test-custom" custom meta is being used/defined in
another test test_meta_custom() as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1086>
2021-10-07 07:43:27 +00:00
Seungha Yang 88437a9c9b codecs: Use GST_VIDEO_DECODER_ERROR() only for decoding error case
The GST_VIDEO_DECODER_ERROR() should be used only for robust/error-resilient
decoding purpose. Any other error codes such as not-negotiated or flushing
should be returned without modified for upstream to be able to handle
it immediately. (for example, application might want to try other
decoder element on not-negotiated)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1070>
2021-10-07 06:48:46 +00:00
Seungha Yang e31b797c05 codecs: h264decoder: Update for remaining gboolean to GstFlowReturn port
Fix for spurious/spammy warning and wrong function return type

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1085>
2021-10-07 06:07:29 +00:00
Sebastian Dröge e9d551b45c rtsp-media: Only unprepare a media if it was not already unpreparing anyway
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1083>
2021-10-07 05:28:19 +00:00
Nirbheek Chauhan f0c3eefefc meson: Fix gst-launch build on UWP
The APIs we need from WinMM for higher timer resolution are only
available for non-UWP apps. The winmm library itself is still
available, so we need to disable the check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/890>
2021-10-07 04:43:34 +00:00
Nirbheek Chauhan be607d7cca meson: Fix build with -Dopenjpeg=disabled
tests/check/meson.build uses the openjpeg_dep variable
unconditionally, and the subdir_done() is useless anyway, since the
plugin is only built if openjpeg_dep.found() is true. Fixes:

..\tests\check\meson.build:23:0: ERROR: Unknown variable "openjpeg_dep".

In particular, this fixes the build on UWP since we disable openjpeg
explicitly in Cerbero when building for UWP.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1069>
2021-10-07 03:22:25 +00:00
Guillaume Desmottes de05bb3da2 bad: gs: update README
- add one missing dep
- change install path to match monorepo
- fix current dirs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1008>
2021-10-06 21:35:08 +00:00
Ognyan Tonchev 7ba665995f rtsp-client: make sure sessmedia will not get freed while used
handle_*_request() functions were all retrieving the session media from
the session by calling gst_rtsp_session_get_media () which is a transfer-none
call. If a session timeout happens at that time, the session media may get freed
making the pointer invalid..

Fixes #757

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1053>
2021-10-06 19:42:43 +00:00
Thibault Saunier ce76a286ed validate:launcher: Sync asset only when passing --sync
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1020>
2021-10-06 17:00:54 +00:00
Víctor Manuel Jáquez Leal 01cfc1ee7e va: Use macro rather than VAMemory feature string.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1061>
2021-10-06 07:19:50 +00:00
Xavier Claessens cf912f6d15 ci: Fix gst-indent path
It used to be downloaded into PATH, but we can now instead run it from
git. Also move it to top source dir instead of gstreamer subproject.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/931>
2021-10-05 23:44:03 +03:00
Sebastian Dröge 55222db66e rtsp-media: Also mark receive-only (RECORD) medias as prepared when unsuspending
Previously the status was only changed for other medias.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1058>
2021-10-05 16:40:07 +00:00
Tim-Philipp Müller c53bdeacf5 docs: update "Building from Source using Meson" for mono repo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1052>
2021-10-05 13:13:31 +00:00
Sebastian Dröge 4316be6571 splitmuxsink: Keep track of the pending input GOPs in a queue
This cleans up input GOP handling and makes it possible to handle more
than 2 pending GOPs, which could happen before if keyframes are arriving
with too short of a distance between them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
2021-10-05 12:35:19 +00:00
Sebastian Dröge ae8ceb801c splitmuxsink: Handle frame reordering due to B frames better
Instead of assuming that the PTS of a keyframe is the lowest PTS of a
GOP, wait until the DTS has passed this PTS and take the minimum PTS up
to that point. That way the minimum PTS of a GOP can be determined, at
least for closed GOP streams. Open GOP streams still can't be handled
properly.

By knowing the minimum PTS of each GOP, keyframes can be requested at
the correct time relative to the GOP (and thus fragment) start and
fragment overflow calculations can calculate the correct durations of
the GOPs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
2021-10-05 12:35:19 +00:00
Sebastian Dröge f83ed50c20 splitmuxsink: Reset timecodes when resetting the sink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
2021-10-05 12:35:19 +00:00
Sebastian Dröge ed6823ad67 splitmuxsink: Use GST_CLOCK_STIME_NONE instead of 0 to initialize max out running time
Otherwise streams with only DTS would misbehave while it is negative.

For outputting everything immediately at EOS, use G_MAXINT64 instead
which is bigger-or-equal to any other running time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
2021-10-05 12:35:19 +00:00
Sebastian Dröge eed843eea0 splitmuxsink: Only update max in/out running time if it's actually bigger
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
2021-10-05 12:35:19 +00:00
Sebastian Dröge 68683d15c4 splitmuxsink: Only count keyframes for the reference context, consistently
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
2021-10-05 12:35:19 +00:00
Robert Rosengren 62077b9d05 docs/running: Describe GST_REGISTRY_MODE
Change-Id: I45e9fe90137d4a8306c3a5e4f636fa43425b978f
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/825>
2021-10-05 10:49:27 +00:00
Robert Rosengren 69b3b1d6bf registrybinary: registry file mode via GST_REGISTRY_MODE
In an embedded system where all services run as seperate users it is
useful to have the gstreamer registry readable by all so it can be
re-used, in similar manner as a host system where one user have seperate
applications running but all share same registry.

To make this possible introducing GST_REGISTRY_MODE for adjusting the
changing mode of the registry binary when finishing up with the
temporary file (which has restricted access).

Fixes: #692
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/825>
2021-10-05 10:49:27 +00:00
Jan Alexander Steffens (heftig) 0596da1966 mpegtsparse: Don't assert the packet_size when filling for EOS
If the packetizer got reset for any reason (failure to find PCR?) then
the packet_size can be zero here even though we already enqueued some
packets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1038>
2021-10-05 09:38:27 +00:00
Ludvig Rappe b099ba649e pbutils: Remove sample entry code "raw"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1045>
2021-10-05 09:00:23 +00:00
Jan Alexander Steffens (heftig) 5aa825d004 multiqueue: Fix query unref race on flush
If the query has already been destroyed at this point, GST_IS_QUERY will
read garbage, can return false and we will try to unref it again.
Instead, make note of whether the item is a query when we dequeue it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1029>
2021-10-05 06:36:48 +00:00
Seungha Yang 7c557c2d65 codecs: mpeg2decoder: Use GstFlowReturn everywhere
boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1019>
2021-10-04 20:56:46 +00:00
Seungha Yang e322745763 codecs: h264decoder: Use GstFlowReturn everywhere
boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1019>
2021-10-04 20:56:46 +00:00
Seungha Yang 5b405d1585 codecs: h265decoder: Use GstFlowReturn everywhere
boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1019>
2021-10-04 20:56:46 +00:00
Seungha Yang 05496df0d1 closedcaption: Fix broken debug function macros with MSVC build
warning C4003: not enough arguments for function-like macro invocation 'warning'

G_STMT_END macro is extended to the below form with MSVC
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
while(0) \
__pragma(warning(pop))

So MSVC preprocessor will extend it further to
__pragma(VBI_CAT_LEVEL_LOG(push)) ...

Should rename warning() debug macro function therefore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1018>
2021-10-04 23:03:20 +09:00
Seungha Yang 90e5e0efea mpegtsmux: basetsmux: Don't try to return value from void function
gstbasetsmux.c(1508): warning C4098: 'free_splice': 'void' function returning a value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1018>
2021-10-04 13:37:09 +00:00
Víctor Manuel Jáquez Leal 2e6cd5c2e4 va: Make libgudev dependency optional.
libgudev is a problematic dependency, particularly in sandboxed
environments, such as flatpak.

This patch implements a way to get the available VA devices using
brute-forced traverse of /dev/drm/renderD* directory. Thus usable in
those sandboxed environments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1027>
2021-10-04 10:19:36 +00:00
Víctor Manuel Jáquez Leal e699aaeb16 va: meson: Move back libgudev dependency to plugin.
When move the libgstva, libgudev dependency was moved as part of the
library, though it's not use by the library but the plugin. This patch
moves back libgudev dependency to the plugin.

Also HAVE_LIBDRM is move to the library which is the one who use it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1027>
2021-10-04 10:19:36 +00:00
Seungha Yang da7f4e0a69 nvcodec: nvh264sldec: Add support for interlaced stream
Implement missing interlaced stream support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1026>
2021-10-04 08:04:00 +00:00
Seungha Yang ce8965b75b nvcodec: nvh264sldec: Consider additional render delay DPB pictures
At least additional 4 pictures are required

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1026>
2021-10-04 08:04:00 +00:00
Seungha Yang 613d380b97 nvcodec: nvvp9sldec: Fix for VP9 profile2 decoding
Fix for output video format to be selected correctly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1026>
2021-10-04 08:04:00 +00:00
Seungha Yang baf252b48b msdk: meson: Fix build on Windows
subprojects\gst-plugins-bad\sys\msdk\meson.build:160:2: ERROR: Unknown variable "libva_dep".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1022>
2021-10-04 07:14:33 +00:00
Seungha Yang 6a756b9f46 d3d11: d3d11vp9dec: Fix use_prev_in_find_mv_refs value setting
"last_show_frame" should be updated based on
GstVp9FrameHeader::show_frame, not show_existing_frame

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1021>
2021-10-03 02:25:50 +09:00
Seungha Yang 571aad3980 codecs: {vp8,vp9}decoder: Drain on new_sequence()
Decoder should drain queued frame (if any) and empty DPB before
starting new sequence.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang 834d6f4031 nvcodec: nv{vp8,vp9}sldec: Implement get_preferred_output_delay()
Equivalent to that of nvh264sldec. Use render delay in case of non-live
pipeline for the better throughput performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang aab3ea2736 codecs: {vp8,vp9}decoder: Cleanup drain code
Make them consistent with h26x decoder baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang 9f4ea145e0 codecs: vp8decoder: Fix typo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang c6ec7f3ea4 codecs: vp9decoder: add support for render delay
Some decoding APIs support delayed output for performance reasons.
One example would be to request decoding for multiple frames and
then query for the oldest frame in the output queue.

This also increases throughput for transcoding and improves seek
performance when supported by the underlying backend.

Introduce support in the vp9 base class, so that backends that
support render delays can actually implement it.

Co-authored by Seungha Yang <seungha@centricular.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Seungha Yang 505c794748 codecs: vp9decoder: Fix class struct documentation
s/GstVp9Decoder/GstVp9DecoderClass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
2021-10-02 12:11:48 +00:00
Thibault Saunier a2964eb1ad ges:uri-asset: Ignore streams with no ID
Since 0d95d9258b we respect the asset stream-id in `GESUriSource` so
we can not work with unknown or broken stream ID in the assets.

We just ignore them, warning about it and we should fix that in
demuxer so they don't expose pad without providing a stream id for them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1001>
2021-10-02 10:44:26 +00:00
Stéphane Cerveau 84b357dd5f typefindfunctions: differentiate h265 from h264
in some cases, the algo gives the same probability
to h264 and h265 for h26x stream resulting in a h265
stream detected as a h264.
if sps/pps/vps detected, increase the probabilty.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/957>
2021-10-02 10:03:21 +00:00
Víctor Manuel Jáquez Leal 5e08ede8f6 va: meson: Update and enhance meson syntax usage.
This patch contains two updates:

1. Instead of checking for dependency already checked just to verify a
   version, we use the dependency version API.
2. Update the deprecated function get_pkgconfig_variable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/997>
2021-10-02 00:54:56 +00:00