Commit graph

46 commits

Author SHA1 Message Date
Sebastian Dröge 4ad101b53b Use once_cell crate directly again
The glib crate does not depend on it anymore and also does not re-export
it anymore.

Also switch some usages of OnceCell to OnceLock from std.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1441>
2024-01-31 18:07:57 +02:00
Sebastian Dröge 855b03a9ea Use let-else instead of match for weak reference upgrades
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1375>
2023-10-30 11:34:35 +02:00
Arun Raghavan d27a04e067 hlssink3: Close the playlist giostreamsink on stop if possible
This is a property that will be available from GStreamer 1.24, and will
ensure that we are able to flush the playlist during the READY->NULL
transition instead of when the element is freed.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/423
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1360>
2023-10-24 21:03:14 +00:00
Seungha Yang 52117e4b11 hlsbasesink: Add enable-endlist property
Write "EXT-X-ENDLIST" tag at the end of stream if enabled, and
default to "TRUE" which is the hlssink2's behavior as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:34:05 +09:00
Seungha Yang 7835d78b3d hlssink3: Add hlscmafsink element
Adding cmafmux based hls sink element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:34:00 +09:00
Seungha Yang 5b563006f9 hlssink3: Add baseclass implementation
Adding HlsBaseSink class to make code reusable

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:32:16 +09:00
Seungha Yang 0fe69cea9f hlssink3: Various cleanup
* Simplify state/playlist management
* Fix a bug that segment is not deleted if location contains directory
and playlist-root is unset
* Split playlist update routine into two steps, adding segment
to playlist and playlist write

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:32:16 +09:00
Seungha Yang 8e4863e9cd hlssink3: Don't remove old files if max-files is zero
Follow hlssink2 element's behavior

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:32:16 +09:00
Seungha Yang a8d67cc607 hlssink3: Remove unused deps
gstreamer-base dep is unused. And use gst::glib

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:32:16 +09:00
Seungha Yang c4d371d163 hlssink3: Use Path API for getting file name
Current implementation does not support Windows path separator.
Use Path API instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:32:16 +09:00
Seungha Yang 7f16ac3915 hlssink3: Use sprintf for segment name formatting
The zero-padded naming requirement is unnecessary. Use simple
sprintf instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1306>
2023-09-25 21:32:16 +09:00
Arun Raghavan 8bbfb10cba hlssink3: Minor PDT-related naming fixups
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1332>
2023-09-20 16:52:55 -04:00
rajneeshksoni a7fe24a294 hlssink3: Add property track-pipeline-clock-for-pdt.
This is required to take care of clock skew between
system time and pipeline time.
`track-pipeline-clock-for-pdt: true` mean utd time is
sampled for first segment and for subsequent segments
keep adding the time based on pipeline clock. difference
of segment duration and PDT time will match.
track-pipeline-clock-for-pdt: false` mean utd time is
sampled for each segment. system time may jump forward
or backward based on adjustments. If application needs
to synchronization of external events `false` is
recommended.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1145>
2023-09-20 13:54:48 +03:00
rajneeshksoni 4be24fdcaf hlssink3: Allow adding EXT-X-PROGRAM-DATE-TIME tag.
- connect to `format-location-full` it provide the first
sample of the fragment. preserve the running-time of the
first sample in fragment.
- on fragment-close message, find the mapping of running-time
to UTC time.
- on each subsequent fragment, calculate the offset of the
running-time with first fragment and add offset to base
utc time

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1145>
2023-09-20 13:54:48 +03:00
Bilal Elmoussaoui dd2d7d9215 Use re-exported once_cell
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1268>
2023-07-06 17:50:49 +03:00
François Laignel 7ba0073052 use Pad builders for optional name definition
Also, apply auto-naming in the following cases

* When building from a non wildcard-named template, the name of the template is
  automatically assigned to the Pad. User can override with a specific name by
  calling `name()` on the `PadBuilder`.
* When building with a target and no name was provided via the above, the
  GhostPad is named after the target.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/448
Auto-naming discussion: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1255#note_1891181

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1197>
2023-05-12 12:55:31 +02:00
Sebastian Dröge cc3646640e Fix a couple of new Rust 1.69 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1186>
2023-04-20 16:47:45 +03:00
Arun Raghavan 487d7fb26b hlssink3: Allow GIOStream signal handlers to return None
If creating a playlist or fragment stream fails (disk is full, the
directory is removed, ...), we will currently crash because the signal
handler expects a non-None GIOStream. The actual callback is allowed to
return None values and we handle this in the caller, so let's not have
this restriction on the signal handler.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1093>
2023-02-14 11:25:44 -05:00
rajneeshksoni 0f383a6545 hlssink3: Allow setting i-frame-only playlist.
HLS allows manifest where all segments are single ifames.
This manifest requires `EXT-X-I-FRAMES-ONLY` tag in the
manifest.
I-FRAMES-ONLY playlist segments are video only segments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1070>
2023-02-08 14:04:46 +00:00
Sebastian Dröge 3b4c48d9f5 Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1062>
2023-01-25 10:31:19 +02:00
Sebastian Dröge 458b2386ed Update for glib API changes 2023-01-21 18:13:48 +02:00
Sebastian Dröge 6132788b02 Update for caps/structure-related string API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1048>
2023-01-15 22:58:44 +02:00
Sebastian Dröge 27435ad82e Update for API changes 2023-01-05 12:33:54 +02:00
Sebastian Dröge 9a68f6e221 Move from imp.instance() to imp.obj()
It's doing the same thing and is shorter.
2022-10-23 23:08:46 +03:00
François Laignel 6319d104a8 Take advantage of Into<Option<_>> args
Commit 24b7cfc8 applied changes related to nullability as declared
by gir. One consequence was that some functions signature ended up
requiring users to pass `Some(val)` when they could use `val`
before.

This commit applies changes on `gstreamer-rs` which, will honoring
the nullability stil allow users to pass `val` for the few affected
functions.

This commit also fixes the signature for `Element::request_new_pad`
which was updated upstream.
2022-10-21 11:54:24 +02:00
Sebastian Dröge 12400b6b87 Update everything for element factory builder API changes
And set properties as part of object construction wherever it makes
sense.
2022-10-19 19:43:29 +03:00
François Laignel 8011eadfd2 Use new format constructors
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1128
2022-10-18 10:36:59 +00:00
Sebastian Dröge 7ee4afacf4 Change *Impl trait methods to only take &self and not Self::Type in addition 2022-10-10 15:03:25 +03:00
François Laignel 0b7259afac Fixes for removal of SpecificFormattedValues ops on ref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/874>
2022-09-22 12:18:49 +02:00
Sebastian Dröge 1a40186485 Update for GLib ParamSpec builder API changes 2022-09-05 11:45:47 +03:00
Vivia Nikolaidou 5606111345 plugins: Simplify code using ParamSpecBuilder 2022-08-22 17:58:43 +03:00
Sebastian Dröge 374bb8323f Fix build after glib SignalBuilder::param_types() API change 2022-08-17 23:37:39 +03:00
Sebastian Dröge cbb55c2322 hlssink3: Update to m3u8-rs 5 2022-08-09 13:40:39 +00:00
Bilal Elmoussaoui 52973d975e Update per glib::SignalBuilder changes 2022-07-21 20:03:13 +02:00
Rafael Caricio adde6fc4e3
hlssink3: convert playlist type to an enum
Change the property `playlist-type` to an enum. We also expose the
new enum externally from the crate so users of Rust can directly use it.
2022-07-08 11:24:32 +02:00
Sebastian Dröge 817231b4d0 hlssink3: PadTemplate::name_template() returns a &str now instead of Option<String> 2022-05-08 13:31:10 +03:00
Sebastian Dröge 9e3f713aa9 Update to m3u8-rs 4.0 2022-04-14 07:41:18 +00:00
François Laignel 422ea740ca Update to gst::_log_macro_
See the details:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/980
2022-02-21 20:50:01 +01:00
Sebastian Dröge 65fcd55160 Update for event/message/query view API changes 2022-01-19 15:07:45 +02:00
Sebastian Dröge b2d0172422 Replace Foo::from_instance(foo) with foo.imp() 2022-01-17 19:36:41 +02:00
Rafael Caricio 9ae8f0d330 hlssink3: fix segment paths in playlist file 2021-12-09 12:38:35 +00:00
Sebastian Dröge 651ea7de5f hlssink3: Minor cleanup of debug output
Pass the object instance to the debug logs too to be able to distinguish
multiple instances.
2021-11-21 18:18:56 +02:00
Sebastian Dröge c68f6b2631 Update for GLib signal emit_by_name() API changes 2021-11-21 18:15:04 +02:00
Sebastian Dröge 55aad51141 Update for glib constructor renames
See https://github.com/gtk-rs/gtk-rs-core/pull/384
2021-11-20 14:31:06 +02:00
Sebastian Dröge 8722206be8 hlssink3: Update to m3u8-rs 3
This uses nom 7 now.
2021-11-18 21:44:09 +02:00
Rafael Caricio e87a7afe3e Add hlssink3 plugin 2021-11-16 08:23:44 +00:00