Commit graph

189 commits

Author SHA1 Message Date
Edward Hervey 63b598b409 adaptivedemux2: Don't allow stream selection while switching periods
The stream selection is done on the currently outputting tracks, but in order to
(de)activate the backing streams we can only do it if the input and output
period are identical.

Fixes crash when doing stream selection during period migration

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3525>
2022-12-05 11:03:26 +00:00
Bo Elmgreen 1f88f411bc qt: deactivate context if fill_info fails
Now the OpenGL context is deactivated if call to gst_gl_context_fill_info()
fails in gst_qt_get_gl_wrapcontext(), preventing that the context is left
activated, which could lead to invalid memory reads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3492>
2022-12-01 14:21:37 +00:00
Matthew Waters 18972fc942 add new plugin for Qt 6 rendering inside a QML scene
- Based heavily on the existing Qt5 integration however:
  - The sharing of OpenGL resources is slightly different
  - The integration with the scengraph is a bit different
- Wayland, XCB and KMS have been smoke tested.  Android, MacOS/iOS,
  Windows may or may not work.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3281>
2022-11-24 16:11:04 +11:00
Jan Schmidt 843f10f7f9 adaptivedemux2: Add GStreamer to the deps list
Explicitly dep on GStreamer so as not to accidentally
link to the system version in a git build

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3453>
2022-11-23 09:29:14 +00:00
Edward Hervey f9dbf91539 adaptivedemux2: Don't leak caps in debug statements
Instead just directly use the stream object (which will report the caps)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey a742c3bf27 adaptivedemux2: Don't leak tags
If we got them from GstStream, we should unref them when done

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey e36b1ae6ed adaptivedemux: Use gst_clear_tag_list_where applicable
Clearer and ensures fields are reset

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Jan Schmidt 8b08305ef9 adaptivedemux2: Fix sticky event storage.
Use the new gst_event_type_to_sticky_ordering() method to retrieve
the order that sticky events should be sent / stored in, instead
of assuming it's the event type value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3387>
2022-11-21 10:32:02 +00:00
Enrique Ocaña González aafe07a802 hlsdemux2: Expose EXT-X-PROGRAM-DATE-TIME as tags.
This allows an application to use timestamps associated
with fragments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1417>
2022-11-17 22:11:12 +00:00
Edward Hervey e68baffcd9 adaptivedemux2: Notify that we are streams-aware
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Tim-Philipp Müller 202dc49f8b gdkpixbufoverlay: fix docs - changing images at runtime is supported
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3415>
2022-11-15 22:43:01 +00:00
Rafał Dzięgiel 30c2bdad61 mpdparser: Fix missing baseURL query
When no initializationURL or mediaURL, return baseURL that also
contains original URI query if available. This fixes a problem
where URI query was being omitted in the HTTP requests.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Rafał Dzięgiel 548bbc3147 mpdparser: Be consistent about returning duplicated URL
Instead of returning a "const gchar" or a "gchar" that should not be freed, always
return a duplicated string as those functions were used together with g_strdup anyway.

This is needed to prepare support for returning modified strings in next commit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Rafał Dzięgiel 0d79dbedf3 mpdparser: Return correct mediaURL value
This fixes a problem where get_mediaURL was returning NULL when segmentURL
was unavailable instead of baseURL as a fallback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Rafał Dzięgiel 9e74c728cb adaptivedemux2: Fix parent object leak
gst_object_get_parent() method is transfer-full, thus unref is needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3396>
2022-11-13 11:35:09 +00:00
Tim-Philipp Müller edc2e8312e qt: initialize GError properly in gst_qt_get_gl_wrapcontext()
Spotted by Claus Stovgaard.

Fixes #1545

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3327>
2022-11-04 20:39:16 +00:00
Edward Hervey 7f86e925e2 adaptivedemux2: Fix collection leaks
* The collection on the period was never unreffed
* The collection in the message handler was never unreffed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Jan Schmidt b2f2a9125c mssdemux2: Update for adaptivedemux2 refactoring
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 04:00:31 +11:00
Jan Schmidt 565f47b4f3 adaptivedemux2: Move stream_seek() to the Stream class
Move the last stream specific vfunc from the demux
class to the stream class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 04:00:31 +11:00
Jan Schmidt 2fe641353d adaptivedemux2: Refactor stream methods into the stream
Unlike the legacy elements, GstAdaptiveDemuxStream is a GObject now,
so a bunch of things that were actually stream methods on the
parent demux object can directly become stream methods now.

Move the stream class out to a header of its own.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 04:00:31 +11:00
Jan Schmidt 9f89b8e3ef hlsdemux2/m3u8: Implement EXT-X-GAP parsing
Read the EXT-X-GAP tag and set is_gap on the segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt 55db033570 hlsdemux2/m3u8: Refactor parsing for readability
Small readability improvements in the parsing code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt bfeb3c5625 adaptivedemux2/downloadhelper: Remove return val for download_request_add_buffer()
The function can't actually fail, and the only caller
was ignoring the result anyway, so remove the return value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt 0f8c38c190 adaptivedemux2/downloadhelper: Add debug output of response headers
Dump the HTTP response headers at TRACE level

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt d1ae35f08a adaptivedemux2/downloadhelper: Don't mark transfer as complete/error if cancelled.
If the state of the download request was reset to UNSENT,
it was cancelled. Don't update the state to COMPLETE or ERRORED
in on_read_ready().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt 46517d5aca adaptivedemux2/downloadhelper: Ignore spurious read failure
Sometimes g_input_stream_read_all_finish() can return
0 bytes, but still succeed (return TRUE) and have more
data available later. Only finish the transfer
if it returns 0 bytes *and* FALSE with no error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt 1751f555f2 adaptivedemux2/downloadhelper: Fix function name
Fix a typo in the name of function download_request_despatch_progress()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt c9de81edd4 adaptivedemux2: Remove scheduler_lock mutex
Remove the old unused scheduler_lock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt b691aece65 adaptivedemux2: Hold tracks lock accessing input_period
The input_period is protected by the TRACKS_LOCK,
so make sure to hold that when accessing it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt 93f80bb061 adaptivedemux2: Add state checks and clean up obsolete variables
The cancelled flag was only set in the stream finalize()
method, after all activity on the stream has stopped anyway.
Replace uses of cancelled with checks on the stream state.

Remove the replaced flag, which was checked but never set
to TRUE anywhere any more.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Seungha Yang 786b7699d1 vpx: Complete high bitdepth vp9 en/decoding support
Adding 12bits variant formats to en/decoder, and high bitdepth
4:4:4 (except for GBR) encoding support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3298>
2022-11-04 05:37:58 +09:00
Seungha Yang 1ce38adfe3 vpx: Define formats for compatibility
ifdef for enum values never work. Instead, define new enum type
and use it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3298>
2022-11-04 05:14:23 +09:00
Jan Schmidt 4a8805ade7 hlsdemux2: m3u8: Use PDT to offset stream time when aligning playlist
When matching segments across playlists with Program-Date-Times,
use the difference in segment PDTs to adjust the stream time
that's being transferred. This can fix cases where the
segment boundaries don't align across different streams
and the first download gets thrown away once the PTS
is seen and found not to match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3309>
2022-11-01 13:04:44 +00:00
Jan Schmidt 6af3769511 hlsdemux2: Download new header when it changes
Check whether the init file / MAP data for a segment
is different to the current data and trigger an
update if so. Previously, the header would only
be checked in HLS after switching bitrate or
after a seek / first download.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3307>
2022-11-01 11:53:26 +00:00
Jan Schmidt 9b8c71d148 m3u8: Expose GstM3U8InitFile methods
Exposure ref/unref methods for the GstM3U8InitFile type,
and add a gst_m3u8_init_file_equal() comparison method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3307>
2022-11-01 11:51:44 +00:00
Edward Hervey 33db765f45 adaptivedemux2: Improve minimum buffering threshold
Previously the minimum buffering threshold was hardcoded to a specific
value (10s). This is suboptimal this an actual value will depend on the actual
stream being played.

This commit sets the low watermark threshold in time to 0, which is an automatic
mode. Subclasses can provide a stream `recommended_buffering_threshold` when
update_stream_info() is called.

Currently implemented for HLS, where we recommended 1.5 average segment
duration. This will result in buffering being at 100% when the 2nd segment has
been downloaded (minus a bit already being consumed downstream)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3240>
2022-10-31 16:16:50 +01:00
Thibault Saunier 1c1b0380cb dashdemux2: Fix the way we determine current_position after seeks
Without that the current_position was off after seeks, potentially
leading to not properly push a last fragment when a `.stop` time was
set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3159>
2022-10-27 19:45:44 +00:00
Thibault Saunier 8a9821e805 dash: Fix computing repeat_index when seeking in stream with a start !=0 on the first fragment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3159>
2022-10-27 19:45:44 +00:00
Junsoo Park 699f2ebb45 dashdemux2: Set timestamp relative to period start
These values will be referred to as timestamp relative to period start
so need to subtract period start time from the values.

Fixes a problem with determining the start position when playing Live content
with SegmentTimeline, presentationTimeOffset and a non-0 period start time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3025>
2022-09-27 00:00:49 +00:00
Jakub Adam cccc7a12e1 vp9: check if libvpx supports high bit depth
Detect at runtime if libvpx is compiled with --enable-vp9-highbitdepth
and enable 10bit video formats in element caps accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3067>
2022-09-23 13:55:12 +02:00
Seungha Yang a9144f5313 adaptivedemux2: Always wake up loop thread on unpause
Otherwise loop thread will sleep forever because
GstAdaptiveDemuxLoop.paused flag update is not signalled
when loop was marked as stopped already from other thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3057>
2022-09-21 09:26:22 +00:00
Jan Schmidt a03f3df626 adaptivedemux2: Rework input download wakeups
Change the way streams are woken up to download more data.

Instead of checking the level on tracks that are being
output as data is dequeued, calculate a 'wakeup time'
at which it should download more data, and wake up
the stream when the global output position crosses
that threshold.

For efficiency, compute the earliest wakeup time
for all streams and store it on the period, so the
output loop can quickly check only a single value
to decide if something needs waking up.

Does the same buffering as the previous method,
but ensures that as we approach the end of
one period, the next period continues incrementally
downloading data so that it is fully buffered when
the period starts.

Fixes issues with multi-period VOD content where
download of the second period resumes only after
the first period is completely drained.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3055>
2022-09-20 19:48:17 +00:00
Edward Hervey fdfa70997b hlsdemux2: Handle negative time mappings
Some servers can return playlists with "old" media playlists and different
Discont Sequence.

In those cases, the segment stream times would be negative when creating a new
time mapping. In order to properly handle such scenarios, shift the values to
stored accordingly to end up with non-negative reference stream time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3054>
2022-09-20 14:34:34 +00:00
Mart Raudsepp beece4e778 shout: fix minimum requirement to libshout >= 2.4.3
commit e64c6f0b93 added usage of the SHOUT_USAGE_UNKNOWN symbol, but this
became available in the Icecast-libshout 2.4.3 release, not 2.4.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3048>
2022-09-19 20:50:25 +03:00
Edward Hervey 124f93a05d hlsdemux2: Fix crash on live playlist with single entry
If there is a single entry, we would end up computing a minimum distance of 0,
and would therefore read entries from after the segment array

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3024>
2022-09-14 15:14:08 +01:00
Jan Schmidt e5e72ede26 adaptivedemux2: Always check bitrate in live
When advancing fragment in live, it's normal to return
GST_FLOW_EOS when playing at the live edge of the available
fragments. In that case, we still want to adjust bitrate
dynamically.

Fixes issue with dashdemux2 where the current bitrate of
each adaptation set is changed to the lowest one when
updating the mpd for a live stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3020>
2022-09-13 09:02:43 +00:00
Filip Hanes 29aec57ef6 pngenc: lower minimum width and height to 1x1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3003>
2022-09-09 09:59:56 +00:00
Edward Hervey 855dabb578 dashdemux2: Remove bogus limitation checks for duration fields
Just like for the seconds field, there are no limitations on the hours and
minutes fields. The specification for xml schema duration fields doesn't forbid
specifying durations with only (huge) minutes or hours values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2951>
2022-09-07 12:48:28 +00:00
Jan Schmidt 43209d0ee6 dashdemux2: Preserve current representation on live manifest updates
When updating a manifest during live playback, preserve the current
representation for each stream.

During update_fragment_info, if the current representation changed
because it couldn't be matched, trigger a caps change and new
header download.

This reverts commit e0e1db212f
and reapplies "dashdemux: Fix issue when manifest update sets slow start
without passing necessary header & caps changes downstream" with
changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2920>
2022-09-05 16:07:00 +00:00
Thibault Saunier 6a4425e46a meson: Call pkgconfig.generate in the loop where we declare plugins dependencies
Removing some copy pasted code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00