Commit graph

327 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal 497890f678 jpegparse: refactor renegotation
Instead of comparing caps, just signal when renegotation is needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5838>
2023-12-22 04:38:06 +00:00
Víctor Manuel Jáquez Leal 03d51244c0 jpegparse: pass colorimetry in caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5838>
2023-12-22 04:38:06 +00:00
Víctor Manuel Jáquez Leal 20b636ee9a jpegparse: add support interlaced mjpeg
Interlaced MJPEG is a big hack. Most of the streams we've found are from old
AVID tools. There are two methods to detect interlaced stream: the container
offers a height bigger (or double) than the image's height in SOF. The other
is from a APP0 marker.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5838>
2023-12-22 04:38:06 +00:00
Mengkejiergeli Ba 141cd38715 h264parse: Remove dead code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5833>
2023-12-20 13:03:25 +00:00
Robert Mader c481fe7059 camerabin: Correctly relink viewfinderbin_queue
This reverts a part of de92a6c7f2. Unlike `image_filter` and
`video_filter`, `viewfinder_filter` does not get linked to `src` but
`viewfinderbin_queue`. Thus the fix in the mentioned commit does not
apply for it and should be reverted.

This was not spotted earlier as only the other filters are used in
the project that uncovered the issue.

Fixes: de92a6c7f2 ("camerabin: Fix source updates with user filters")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5689>
2023-12-18 17:07:31 +00:00
Seungha Yang 890d59e97e av1parser: Fix array sizes in scalability structure
Since the AV1 specification is not explicitly mentioning about
the array size bounds, array sizes in scalability structure
should be defined as possible maximum sizes that can have.

Also, this commit removes GST_AV1_MAX_SPATIAL_LAYERS define from
public header which is API break but the define is misleading
and this patch is introducing ABI break already

ZDI-CAN-22300

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5823>
2023-12-18 10:58:24 +00:00
Daniel Morin 49f200cb54 h264parse: Improved AU boundary detection
- AU boundary detection reviewed to follow more closely H.264 spec. and more
  specifically clauses 7.4.1.2.3 and 7.4.1.2.4.
- The gist of the changes is a look-a-head in then next AU required identify the
  last vcl-nal of current AU and firt vcl-nal of next AU (according to
  7.4.1.2.4) followed by the identification of the first nal of next AU
  (according to 7.4.1.2.3).
- A backlog of all nals of current AU and next AU up to the point where current
  AU can identified completed is kept.
- In NAL alignement mode vcl-nal are sent immediatly but the history is kept to
  allow AU boundary detection. Non-vcl-nal can be delayed up to the reception of
  the next vcl-nal to allow a correct AUD insertion.
- Based on this improved AU boudary detection we can avoid erronous AUD
  insertion, like the one highlighted by test
  test_parse_sliced_with_prefix_and_sei_nal_au.
- Add support for MVC AU boundary detection. (H.7.4.1.2.4)
- Explicitly report SVC not supported. We don't have the SVC NAL parsing
  required to identify boundary. (missing dependency_id and quality_id fields
  from SVC, see G.7.4.1.2.4)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5741>
2023-12-17 21:42:47 +00:00
Xavier Claessens f076a9bf2f unixfd: Serialize buffer metas
Serialize every GstMeta that supports serialization into the NEW_BUFFER
payload. This is especially important for GstVideoMeta in the case of
multiplanar buffers, or if stride!=width.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5355>
2023-12-17 16:13:26 +00:00
Ruben Gonzalez 97817ef44c gstgaussblur: delete unused code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5737>
2023-12-04 18:54:31 +00:00
Aaron Boxer b405ff34d3 mpegtsmux: allow attaching PCR to non-PES streams
There is an existing PMT mapping between PCR_%s and an mpegtsmux sink
pad name, where %s equals the program number that the PCR corresponds
to. We re-purpose this functionality to also support a mapping between
PCR_%s and an arbitrary PID. If this mapping is set, then the header PCR
PID is set to this value, and PCR is attached to the stream with this
PID.

Note: the current implementation also attaches PCR to the video stream,
so this may be inefficient.

Co-authored-by: Jordan Yelloz <jordan.yelloz@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5726>
2023-12-01 18:01:34 +00:00
Jordan Yelloz 66f51f642f bad: Added W3C Media Source Extensions library
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2992>
2023-11-19 13:48:43 +00:00
Alexander Slobodeniuk 2922c6182d insertbin/doc: add "Since" markers to pass CI
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5514>
2023-11-17 01:09:49 +01:00
Alexander Slobodeniuk 709913b1d2 insertbin: make it available in the registry
so it could also be used from the gst-parse-launch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5514>
2023-11-16 21:36:32 +01:00
Robert Mader de92a6c7f2 camerabin: Fix source updates with user filters
Take the case into account when user filters have been set before the
source gets updated.

Note that the further linking of the filters, if present, happens below
in the `gst_camera_bin_check_and_replace_filter()` calls.

The audio filter is still affected by the same issue but left out for
now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5527>
2023-11-16 17:26:03 +00:00
Stéphane Cerveau fdc3db68cd codecparsers: introduce h265 level enum
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5644>
2023-11-13 16:37:46 +00:00
Sebastian Dröge 274551d450 mxfdemux: Store GstMXFDemuxEssenceTrack in their own fixed allocation
Previously they were stored inline inside a GArray, but as references to
the tracks were stored in various other places although the array could
still be updated (and reallocated!), this could lead to dangling
references in various places.

Instead now store them in a GPtrArray in their own allocation so each
track's memory position stays fixed.

Fixes ZDI-CAN-22299

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3055

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5635>
2023-11-10 14:38:40 +00:00
Mathieu Duponchelle 39efd788a8 timecodestamper: set drop-frame property default to TRUE
After talking with Vivia on IRC, she does not remember why the default
was FALSE and it is in my opinion preferable to stick to whatever
representation best represents time for a given framerate as a default
behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5628>
2023-11-09 21:05:02 +00:00
Xavier Claessens 47c56e3865 unixfd: Add support for abstract socket
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:01 +00:00
Xavier Claessens d44aa71f24 unixfd: Use DMABuf allocator when needed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:01 +00:00
Xavier Claessens f1a1901b8b unixfd: New plugin with unixfdsink and unixfdsrc elements
This pair of elements, inspired from shmsink/shmsrc, send unix file
descriptors (e.g. memfd, dmabuf) from one sink to multiple source
elements in other processes.

The unixfdsink proposes a memfd/shm allocator, which causes for example
videotestsrc to write directly into memories that can be transfered to
other processes without copying.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Tim-Philipp Müller 67d7df247b fpsdisplaysink: fix copy'n'paste-o in license header
It's LGPL licensed, remove confusing GPL reference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5557>
2023-10-27 10:54:44 +00:00
Tim-Philipp Müller 3438b7a880 kate: remove plugin
Bitrotten and not really used in the wild.

The actual render library (libtiger) is not just unmaintained
but the upstream location has disappeared, and it's also not
even packaged by e.g. debian/ubuntu.

Closes #3071

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5408>
2023-10-27 07:34:39 +00:00
Jan Alexander Steffens (heftig) 6053dd0d1b tsmux: Fix default get_es_descrs_func
`tsmux_stream_default_get_es_descrs` is missing the `user_data`
parameter and shouldn't be cast to `TsMuxStreamGetESDescriptorsFunc`.

Prefer not casting at all to make sure we don't miss such an issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:28 +00:00
Jan Alexander Steffens (heftig) 2d72008361 tsmux: Fix default new_stream_func
`tsmux_stream_new` is missing the `user_data` parameter and shouldn't be
cast to `TsMuxNewStreamFunc`.

Prefer not casting at all to make sure we don't miss such an issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:28 +00:00
Jan Alexander Steffens (heftig) 5bac956b58 tsmux: Add missing include
We need `GstMpegtsPMTStream` here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:28 +00:00
Jan Alexander Steffens (heftig) db88612853 tsmux: Simplify tsmux_section_write_packet
- Don't try to make the parameters match `GHFunc`. Use a dedicated
  callback for `g_hash_table_foreach`.
- Don't try to be clever with buffer memories. We're allocating a full
  packet anyway, might as well memcpy and save on a lot of complexity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:28 +00:00
Jan Alexander Steffens (heftig) 950789f61b tsmux: tsmux_packet_out should always consume its buffer
Consuming the buffer only when successful is an antipattern and easily
leads to leaks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:28 +00:00
Jan Alexander Steffens (heftig) 55658ad166 tsmux: Don't memset in pad_stream when writing a PCR packet
tsmux_write_ts_header will write a stuffing adaptation field, so we
don't need to prefill the buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:28 +00:00
Jan Alexander Steffens (heftig) 2dbd89b036 tsmux: Move out parameters of tsmux_write_ts_header
Move them to the end of the parameter list and also allow passing NULLs
to ignore the payload information, but assert that the payload length is
zero in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:27 +00:00
Jan Alexander Steffens (heftig) 5128975a36 tsmux: Fix two more uses of gst_buffer_map
The buffers should be used for writing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
2023-10-19 22:34:27 +00:00
Diego Nieto e290555367 mpegtsdemux: Fix comment about the jitter description
According to the information provided below, the Jitter (J) is
defined by a network delay (D) + a noise(i)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5494>
2023-10-17 08:22:41 +00:00
Jan Alexander Steffens (heftig) 8a7d0efd96 tsmux: Fix error handling in pad_stream
Don't leak the map or the buffer if we encounter an error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5490>
2023-10-16 15:46:00 +02:00
Jan Alexander Steffens (heftig) b1810d83bc tsmux: Fill padding packets with stuffing bytes
Instead of leaving it uncleared, emitting probably old packet data but
potentially also random or sensitive application data.

Also fix the mapping mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5490>
2023-10-16 15:46:00 +02:00
Guillaume Desmottes dd0896f05a audiobuffersplit: disable max-silence-time if set to 0
According to the property documentation max-silence-time is supposed to be
disabled when set to 0 but it was not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5442>
2023-10-06 14:48:46 +02:00
Nicolas Dufresne aaed9272c1 video-filters: Fix passthrough with ANY caps feature
With the support for DRM modifiers, passthrough caps must now include DMA_DRM
format, otherwise pipeline using thhese filters unconditionally may fail
to negotiate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
2023-10-03 21:13:00 +00:00
Jonas K Danielsson f4fb4a5606 ristsrc: Add support for dynamic payload
This commit ports functionality from the `rtpsrc` to make the `ristsrc`
work with dynamic payload types.

It adds two properties:
  - `caps`
  - `encoding-name`

These can be used to make the `ristsrc` receive other payload types than
the MPEG TS one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5422>
2023-10-03 20:17:07 +00:00
Philippe Normand 886bd7e4e0 interaudiosink: Ensure adapters don't store buffers with audio meta
The interaudiosrc might take buffers of different sizes from the audio adapter,
so keeping metas consistency would be an issue. So the sink now strips the audio
metas away and the src adds them back (for non-interleaved layouts only) when
taking buffers from the adapter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5324>
2023-09-28 10:26:33 +00:00
Philippe Normand 46dbe2a372 interaudiosrc: Add audio meta to buffers containing non-interleaved samples
Without this a downstream audioconverter wouldn't be able to map the
GstAudioBuffer prior to conversion.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5324>
2023-09-28 10:26:33 +00:00
Sebastian Dröge 72742dee30 mxfdemux: Check number of channels for AES3 audio
Only up to 8 channels are allowed and using a higher number would cause
integer overflows when copying the data, and lead to out of bound
writes.

Also check that each buffer is at least 4 bytes long to avoid another
overflow.

Fixes ZDI-CAN-21661, CVE-2023-40475

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2897

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5362>
2023-09-20 15:40:07 +00:00
Sebastian Dröge ce17e968e4 mxfdemux: Fix integer overflow causing out of bounds writes when handling invalid uncompressed video
Check ahead of time when parsing the track information whether
width, height and bpp are valid and usable without overflows.

Fixes ZDI-CAN-21660, CVE-2023-40474

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2896

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5362>
2023-09-20 15:40:07 +00:00
Sebastian Dröge 889a3fe932 rtmp2: Set default flash version to NULL
This is consistent with the librtmp-based old rtmp plugin and ffmpeg.
While some servers require a valid flash-version, others are failing
with a too long or any flash-version at all.

By changing to the same default as in the old plugin and in ffmpeg,
GStreamer will at least behave the same and will work and fail with the
same servers without setting a flash-version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5293>
2023-09-11 08:23:33 +00:00
Seungha Yang efe35a3f6c h264parse, h265parse: Fix potential integer overflow
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2961
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5295>
2023-09-08 12:45:12 +00:00
Seungha Yang 2c4cb82afc h264parse, h265parse: Fix timecode parsing
The scaling factor for nFrame part should be "(1 + nuit_field_based_flag) / 2"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5254>
2023-09-01 06:44:52 +00:00
Jan Alexander Steffens (heftig) 14c097e87d rtmp2: Allow NULL flash version, omitting the field
rtmpsink omits it by default. Allow us to do the same.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5241>
2023-08-25 09:50:39 +02:00
Guillaume Desmottes 17ebfc7cb7 rtmp2sink: fix crash if message conversion failed
The message pointer is not set so we can't display it in logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5197>
2023-08-18 09:27:36 +02:00
Jan Schmidt 8b5833c546 audiolatency: Fix event refcounting bug handling latency events
Fix a refcounting bug introduced in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5146
If upstream returns FALSE when processing a latency event, it will
be unreffed an extra time

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5150>
2023-08-06 08:00:56 +00:00
Jan Schmidt fd95f5682e audiolatency: Forward latency query and event upstream
Make sure the pipeline still configures the latency that it would configure
if audiolatency was not in the pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5146>
2023-08-04 14:13:12 +00:00
Guillaume Desmottes 501e53b033 rtmp2src: add 'no-eof-is-error' property
There is currently no way for applications to know if the stream has
been properly terminated by the server or if the network connection
was disconnected as EOS is sent in both cases.

Adding a property so connection errors can be reported as errors
allowing applications to distinguish between both scenarios.

Fix #2828

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5115>
2023-08-04 11:07:36 +00:00
Philippe Normand c506748c6f transcodebin: Fixes for upstream selectable support
The upstream selectable query was not performed in all situations where we
handle the stream-start event. This could potentially lead to unlinked pads
between decodebin3 and encodebin later on.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5089>
2023-08-02 17:12:48 +00:00
Seungha Yang 3679713519 rtponviftimestamp: Fix drop-out-of-segment=false mode
Fixing unexpected buffer dropping and flow error in case that:
* use-reference-timestamps=false
* drop-out-of-segment=false
* Calculated utc offset is not valid because buffer is out-of-segment

The above case should be considered as a valid data flow without returning
errors.

Fixing regression introduced by
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1683

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5116>
2023-07-28 23:36:34 +09:00