Commit graph

1198 commits

Author SHA1 Message Date
Sebastian Dröge
e11b12df7c gstreamer: Provide class metadata, pad templates and basetransform configuration via trait methods
This is closer to how this works in Python and also how properties and
signals work now in the glib bindings.

class_init() only has to be implemented for more special uses now.
2021-01-25 13:56:55 +02:00
Jonas Platte
72f191b79b
Use std::future::ready instead of futures_util::future::ready 2021-01-19 13:33:11 +01:00
Sebastian Dröge
927cca106d Use async/await in a few places and reduce dependencies as a result 2021-01-14 15:25:03 +02:00
Zeeshan Ali
4a92966ed5 Add get_current_state & get_pending_state to ElementExtManual
Convenient API to simply get the current or pending state of the
element.
2021-01-10 08:52:28 +00:00
Marijn Suijten
c4a06e515b gstreamer/format,value: Skip init in functions that contain self
These functions were changed to return Self instead of the direct name
of the type, and are hence caught by the init checker.

Also remove some tabs that sit in the macro but are not cleaned up by
the formatter.
2021-01-08 11:50:31 +01:00
Marijn Suijten
4cb6b64e2d gstreamer/format,value: Use Self in more places 2021-01-08 11:49:46 +01:00
Marijn Suijten
9890803cc6 gstreamer: Fix clippy::from_over_into 2021-01-08 11:43:14 +01:00
Marijn Suijten
46cb1595c0 gstreamer/tags: Fix redundant_semicolons lint warning 2021-01-08 11:01:02 +01:00
Marijn Suijten
7ed20090d1 Fix clippy::field_reassign_with_defaults instead of ignoring it
Fixes: fc2d7fc4 ("ci: Add some more ignored lints to the clippy configuration")
2021-01-08 11:01:02 +01:00
Marijn Suijten
3c610e12e5 gst,base,sdp: Use specific copy/free or (un)ref instead of g_boxed
SDPMessage, FlowCombiner and ParseContext have specific functions
available to perform copying, freeing and (un)ref'ing. Calling them
directly on versions where they are supported prevents us from going
through GType machinery and locks that end up the same functions in the
end.
2021-01-08 10:41:06 +01:00
Sebastian Dröge
ec2a287842 gstreamer/datetime: Update for glib::DateTime API changes 2020-12-24 12:46:27 +02:00
Sebastian Dröge
03f928ee0c gstreamer/serde: Update for glib::Date API changes 2020-12-23 10:31:49 +02:00
Sebastian Dröge
3428e5c0c7 Update CHANGELOG.md for 0.16.6 2020-12-20 20:50:51 +02:00
Sebastian Dröge
477b00cce8 Update CHANGELOG.md for 0.16.5 2020-12-20 20:50:48 +02:00
Sebastian Dröge
68839c0e79 Re-export all dependency crates and their preludes
This makes code in examples potentially simpler.
2020-12-20 19:40:34 +02:00
Sebastian Dröge
53aae7ddba Remove gst_ prefix from all macros except for the logging macros
The latter stay e.g. gst_debug! to be more clear and not conflict with
e.g. the debug! macro from the log crate.
2020-12-20 19:40:34 +02:00
François Laignel
87446d4d8e ClockTime: const for zero & none constructors 2020-12-18 18:00:47 +01:00
François Laignel
a216f85abf ClockTime: use matches! now that MSRV allows it 2020-12-18 18:00:35 +01:00
Guillaume Gomez
2f0e386037 Regen with more doc alias for enums and consts 2020-12-18 15:23:05 +01:00
Sebastian Dröge
ce1148b474 Update everything for glib macro renamings 2020-12-18 00:56:47 +02:00
Sebastian Dröge
d0b0006d27 Regenerate 2020-12-18 00:34:53 +02:00
Sebastian Dröge
f3b5340875 Update for new simplified glib::Object::new() API 2020-12-17 17:43:17 +02:00
Sebastian Dröge
38b94abc59 Add COPYRIGHT file as links into all crates and change LICENSE files to links too 2020-12-16 12:49:49 +02:00
Guillaume Gomez
ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
François Laignel
0dce894b13 gstreamer/message: 2d attempt at printing src for Debug impl
1st attempt in c987bb0c was reverted by 89c4f68f due to
clippy "redundant clone" warning.
2020-12-13 19:44:34 +01:00
Marijn Suijten
132477f51f cargo.toml: Add v1_20 feature to all crates 2020-12-12 13:17:20 +01:00
Marijn Suijten
0ff16c589f Regenerate sys Cargo.toml with 1.20 version 2020-12-12 13:17:03 +01:00
Marijn Suijten
bc5b44ddad gstreamer: new_from_g_date_time only returns NULL if arg is NULL 2020-12-12 13:15:11 +01:00
Marijn Suijten
1d726d6a1e gir.toml: Add 1.20 to extra_versions 2020-12-12 13:15:11 +01:00
Guillaume Gomez
fb56af8d84 Update from_glib calls and put them in unsafe blocks 2020-12-08 15:50:15 +01:00
Guillaume Gomez
959568f124 regen 2020-12-08 14:00:17 +01:00
Marijn Suijten
15d8774e6b Update gir to 1c1a8d7 and regenerate with associated enum/flag functions 2020-12-07 12:11:27 +01:00
Marijn Suijten
01ae47c90c gstreamer: Manually implement StateChange::get_name on < v1_14
By setting the version to 1.8 and using `manual = true` an unconditional
trait implementation calling get_name is generated, while the
autogenerated version is omitted.
2020-12-07 12:09:39 +01:00
Marijn Suijten
18d6823dd8 gstreamer: Ignore Gst.Format::register; needs manual implementation 2020-12-07 12:09:39 +01:00
Marijn Suijten
c4e82ce7b9 gstreamer: Add EventTypeFlags to autogenerated 2020-12-07 12:09:39 +01:00
Marijn Suijten
8a309b39f2 gstreamer: Add Glib.Quark to manual list and sort 2020-12-07 12:09:39 +01:00
Marijn Suijten
f260fa4f8d gstreamer/event: Use autogenerated EventType::get_name 2020-12-07 12:09:39 +01:00
Marijn Suijten
0763d2645d video: Reuse Self::Err in from_str 2020-12-07 12:09:39 +01:00
Marijn Suijten
2447664df6 Replace Result<(), fmt::Error> with fmt::Result 2020-12-07 12:09:39 +01:00
Marijn Suijten
9f0befa033 gstreamer: macro_use is for use statements, not macro calls 2020-12-07 12:09:39 +01:00
Sebastian Dröge
15722ec5d2 gstreamer/datetime: Check invariants on the bindings side instead of asserting in the C code
Newer versions of GStreamer (1.20 and above) will not assert any longer
but handle it more gracefully, so let's do the same here for all
versions.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/297
2020-12-06 19:23:32 +02:00
Marijn Suijten
88321a4d61 Gir.toml: Remove unnecessary non-nullable return annotations 2020-12-04 19:37:07 +01:00
Marijn Suijten
92df13eeb1 Regenerate with trusted nullability 2020-12-04 19:37:06 +01:00
Marijn Suijten
ceeaf97793 gst,base,check,net: Trust return value nullability 2020-12-04 19:36:22 +01:00
Marijn Suijten
47102b0e76 Regenerate with fresh gir files 2020-12-04 19:34:09 +01:00
Marijn Suijten
9577965782 sys/Gir.toml: Drop default target_path in current directory 2020-11-28 11:07:48 +01:00
Marijn Suijten
a87cc4c3a3 cargo: Update ffi crate paths to direct "./sys" subdirectory 2020-11-28 11:05:51 +01:00
Guillaume Gomez
1eba80c04b Fix cargo files features 2020-11-27 14:48:11 +01:00
Guillaume Gomez
8f9d76bb8c Revert "Remove unnecessary dox feature"
This reverts commit 9dd8bd9095.
2020-11-27 14:37:49 +01:00
Guillaume Gomez
2d87561193 Revert "Remove unnecessary dox feature in cargo files"
This reverts commit 128b3b251e.
2020-11-27 14:37:40 +01:00
Guillaume Gomez
7daac635c4 regen 2020-11-27 14:37:24 +01:00
Marijn Suijten
513cf47447 gstreamer/query: Fix clippy::single_match 2020-11-25 21:16:40 +01:00
Marijn Suijten
56c2b730f8 gstreamer/buffer: Fix clippy::needless_lifetimes 2020-11-25 21:16:40 +01:00
Guillaume Gomez
128b3b251e Remove unnecessary dox feature in cargo files 2020-11-25 16:02:51 +01:00
Guillaume Gomez
9dd8bd9095 Remove unnecessary dox feature 2020-11-25 15:54:02 +01:00
Guillaume Gomez
28438d245a regen 2020-11-25 15:53:45 +01:00
Sebastian Dröge
7dc5a90b8a Remove unneeded extern crate 2020-11-22 19:15:21 +02:00
Sebastian Dröge
9d9522016b gstreamer: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
Sebastian Dröge
b933931d6c gstreamer: Regenerate 2020-11-22 19:15:20 +02:00
Sebastian Dröge
9889bc990a sys: Update to Rust 2018 2020-11-22 19:15:20 +02:00
Sebastian Dröge
4d52ab7d37 gstreamer: Fix plugin version for v1_18 2020-11-21 18:08:24 +02:00
François Laignel
75f6babb57 Event: impl structure_mut getter 2020-11-19 21:12:18 +01:00
Sebastian Dröge
89c4f68fa3 gstreamer: Remove redundant clone of element name
error: redundant clone
   --> gstreamer/src/message.rs:162:63
    |
162 |             .field("src", &self.get_src().map(|s| s.get_name().to_owned()))
    |                                                               ^^^^^^^^^^^ help: remove this
    |
    = note: `-D clippy::redundant-clone` implied by `-D warnings`
2020-11-19 20:30:51 +02:00
Sebastian Dröge
389fa306aa Regenerate with latest gir 2020-11-19 19:53:22 +02:00
Marijn Suijten
e88994a0b7 use cfg_if to refactor some #[cfg()] / #[cfg(not())] pairs 2020-11-19 16:39:31 +01:00
Marijn Suijten
aeb1b70581 Remove doc(cfg()) from expressions
warning: unused doc comment
       --> gstreamer-video/src/video_info.rs:655:37
        |
    655 |           #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
        |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    656 | /         {
    657 | |             VideoInfoBuilder {
    658 | |                 format,
    659 | |                 width,
    ...   |
    674 | |             }
    675 | |         }
        | |_________- rustdoc does not generate documentation for expressions

Also simplify some blocks into expressions which are allowed to have
attributes as well since Rust 1.43.
2020-11-19 16:39:31 +01:00
Marijn Suijten
bd75778fcb Add doc(cfg()) on all manual files 2020-11-19 16:39:31 +01:00
Marijn Suijten
9daa8d20a9 Regenerate with doc(cfg()) attribute on all symbols
This is enabled by a new version of gir, as updated in the previous
commit.
2020-11-19 16:39:31 +01:00
Marijn Suijten
3f373f623a Enable feature(doc_cfg) in all lib.rs
The next version of gir is going to generate doc(cfg()) attributes on
many symbols to show feature-dependence hints. While autogenerated sys
crates get this attribute in their own (generated) lib.rs file the safe
wrapper crates do not have such an autogenerated lib.rs file.
2020-11-19 16:39:31 +01:00
François Laignel
8aba0597e4 Pad: use Result<FlowSuccess, FlowError> for flow return type 2020-11-18 16:59:25 +01:00
François Laignel
755496d0f9 Pad: allow handling Events in PadProbes 2020-11-18 16:59:23 +01:00
François Laignel
9fb0c4937b ProxyPad: impl ExtManual functions as trait functions, not associated functions 2020-11-17 16:35:31 +01:00
Sebastian Dröge
4eaf574cf8 gstreamer: Make virtual methods take wrapper of type, not parent 2020-11-14 19:39:27 +02:00
Sebastian Dröge
1d53b66858 Fix compilation with GLib subclassing changes 2020-11-14 19:39:27 +02:00
François Laignel
ca96014c47 Use fully qualified path for plugin_desc in gst_plugin_define
This is required when gst_plugin_define is used from a a submodule
mod.rs (not from the crate's lib.rs).
2020-11-12 13:24:16 +01:00
Sirius Wu
a7b0d42964 Check if LoggedObject really a GObject. 2020-11-09 17:33:52 +08:00
Sebastian Dröge
9379c730b9 gstreamer: Update for removal of ElementClass/DeviceProviderClass type aliases 2020-11-07 12:49:19 +02:00
Sebastian Dröge
f6ace04caf Regenerate everything with latest gir 2020-11-07 12:17:25 +02:00
François Laignel
5903496e5b regenerate all 2020-11-05 18:29:47 +01:00
Sebastian Dröge
b91123d298 Simplify IsSubclassable::override_vfunc() implementations 2020-11-05 17:12:06 +00:00
Sebastian Dröge
99fbbc32cb Use glib::Class instead of glib::object::Class 2020-11-05 17:12:06 +00:00
Sebastian Dröge
027de84349 Update for class struct handling changes in the glib bindings
See https://github.com/gtk-rs/gtk-rs/pull/10
2020-11-05 16:41:48 +02:00
François Laignel
60d48f838b gstreamer: regenerate 2020-11-05 12:34:39 +01:00
Sebastian Dröge
67f5c0767a Regenerate everything with latest gir 2020-11-01 09:48:40 +02:00
Sebastian Dröge
4cd6e09f3d Update documentation link of sys crates 2020-11-01 09:48:37 +02:00
Sebastian Dröge
ef120ce923 Update sys versions to 0.17.0
All crates have the same version now, which should cause less confusion
with matching them up.
2020-10-30 18:35:57 +02:00
Sebastian Dröge
c9ab2527e8 Remove spurious Cargo.lock 2020-10-30 18:35:57 +02:00
Sebastian Dröge
35f19e17bf Update repository URLs 2020-10-30 18:35:52 +02:00
Sebastian Dröge
c833e9ed69 Update dependency paths 2020-10-30 18:27:22 +02:00
Sebastian Dröge
b5c376d315 Move every gtk-rs dependency to the combined gtk-rs repository 2020-10-30 18:15:53 +02:00
Sebastian Dröge
109eac2b9a Move sys crates into subdirectories of the non-sys crates 2020-10-30 18:06:07 +02:00
Sebastian Dröge
f657a56947 Move Gir.toml into the corresponding subdirectories 2020-10-30 18:06:01 +02:00
Sebastian Dröge
a7749b7933 gstreamer/log: Don't provide direct access to the logged object as glib::Object
It might just be constructed or might be finalized currently and it's
not safe to use any APIs on it.

Instead provide a small wrapper type that allows to get the underlying
pointer and that implements the Display trait to print the name of the
object.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/287
2020-10-26 10:42:33 +02:00
Sebastian Dröge
a6c8fe0c8a Use repr(transparent) where it is more correct and get rid of some unneeded repr(C) 2020-10-24 17:09:10 +00:00
Sebastian Dröge
4c216bca3a Remove unneeded PhantomData markers
And as a side-effect also get rid of the lifetime parameter of
gst::TypeFind that was completely unused anyway.
2020-10-24 17:09:10 +00:00
François Laignel
ae9d97dfca ClockTime & opt Formats: fix PartialOrd impl, remove Ord and add min & max
- `PartialOrd` was returning `true` for expressions such as
  - `ClockTime::none() < ClockTime::from_seconds(1)`.
  - `ClockTime::from_seconds(1) > ClockTime::none()`.
- Remove `Ord` because `ClockTime` is not a total order due to
  `ClockTime::none()`. See test `not_ord`.

This also applies to others `Format(Option<{u32,u64}>)` types.
2020-10-20 23:40:18 +02:00
François Laignel
9efe39ff81 ClockTime: add staturating_{add,sub} and ops tests 2020-10-20 23:40:18 +02:00
Sebastian Dröge
ba719ac90c Update for glib changes in glib::Value handling 2020-10-20 13:50:35 +00:00
Sebastian Dröge
0207e41160 gstreamer/clock: Creating new clock ids can't fail gracefully but invalid arguments should be checked 2020-10-20 12:00:13 +03:00
Sebastian Dröge
fff69b3a23 Update muldiv dependency to 1.0 2020-10-13 09:35:59 +00:00
François Laignel
c987bb0c7d gstreamer/message: enhance Debug impl for Message[Ref]
When "{:?}" printing a Message[Ref], the following issues lower the
experience:

- If the Message seqnum is GST_SEQNUM_INVALID (0), a panic occurs due
  to an assertion failure in MessageRef::get_seqnum.
- The src of the Message displays the GString address.

Origin issue for an occurrence of the first case above fixed in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/860
2020-10-13 11:11:38 +02:00
François Laignel
fa3f6eefc9 message: get_seqnum: return next seqnum if Message seqnum is invalid
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/601
2020-10-13 11:11:38 +02:00
raytiley
a8ed2ac6e0 Update location of documentation. 2020-10-10 15:51:59 -04:00
Sebastian Dröge
531014a35c gstreamer/clock: Improve ClockId bindings
There is now a separate type for Single and Periodic clock ids. This
allows to have API that is only for one type on that specific type
instead of doing runtime checks, and allows for more refined async
waiting API.
2020-10-10 10:25:44 +00:00
Marijn Suijten
cb362e6fbc gstreamer: plugin: Prefix glib:: with $crate:: in gst_plugin_define
Crates using gst_plugin_define might not (need to) import `glib`
directly into their scope; use the one imported in `gstreamer`s root
to make this macro more portable.
Besides, `glib` is prefixed with `$crate::` just below.
2020-10-10 11:54:20 +02:00
Marijn Suijten
10bc09ba82 gstreamer: error: Prefix gst_error_msg with $crate
This macro might not have been imported in the surrounding scope where
gst_panic_to_error is used, thus reference it directly by the full
namespace.
2020-10-10 11:47:41 +02:00
Sebastian Dröge
dc9a9c4d78 Update CHANGELOG.md for 0.16.4 2020-10-09 13:41:11 +03:00
Sebastian Dröge
6e404f1831 gstreamer/meta: Don't collect iterators just to check their length in the tests 2020-10-09 11:35:19 +03:00
Sebastian Dröge
7aeb0e8f92 gstreamer/buffer: Don't implement ExactSizeIterator on meta iterator
We don't actually know the number of items and using the trait would
panic.
2020-10-09 11:35:19 +03:00
Sebastian Dröge
323bb1269b gstreamer: Update to cfg-if 1.0 2020-10-09 11:35:19 +03:00
Sebastian Dröge
b59b5ada7e gstreamer/clock: Unschedule clock ID when the receiver end of the channel is disconnected 2020-10-01 11:25:40 +03:00
Sebastian Dröge
4778d05238 gstreamer/clock_time: Add From/TryFrom impls to convert between ClockTime and std::time::Duration 2020-10-01 11:00:21 +03:00
Sebastian Dröge
c01f7072fb gstreamer/clock: Add ClockID::wait_async_stream()
This provides an async stream with the values of each timeout.
2020-10-01 11:00:21 +03:00
Alexey Galakhov
4120ded424 Add gstreamer-controller 2020-09-30 16:28:51 +00:00
Sebastian Dröge
4f10eefe1e Update CHANGELOG.md for 0.16.3 2020-09-08 22:02:31 +03:00
Sebastian Dröge
8aaec57dac gstreamer: Fix compilation after glib API change 2020-09-08 16:11:39 +03:00
Sebastian Dröge
55efe30258 Regenerate everything 2020-09-08 15:42:28 +03:00
Sebastian Dröge
ea3d0246bf gstreamer/log: Fix debug_remove_default_log_function() to actually work
We have to pass `NULL` / `None` instead of the actual default log
function as because of `-Bsymbolic` or how DLLs work on Windows the
external function pointer is different to the internal one.
2020-09-03 10:13:09 +03:00
Sebastian Dröge
160728965b gstreamer: Update pretty-hex dependency to 0.2 2020-09-01 09:55:31 +03:00
Sebastian Dröge
a4239c3462 gstreamer: Remove API that was deprecated in 0.16 2020-08-24 17:33:35 +03:00
Ruben Gonzalez
4e6766e6ed gstreamer: Delete duplicated assert_initialized_main_thread 2020-08-14 09:27:10 +02:00
Sebastian Dröge
70fd572a46 Regenerate everything 2020-08-11 12:53:27 +03:00
Sebastian Dröge
746741f910 gstreamer: Update paste dependency from 0.1 to 1.0 2020-08-09 10:33:22 +03:00
Sebastian Dröge
43d1d0a4e9 gstreamer/pad: Factor out PadProbeInfo handling from pad probe trampoline into separate functions
This makes that part of the code non-generic and thus allows the
compiler to not put a copy of it into every caller with a different
closure.

For a test with 3 pad probes this overall reduced the number of LLVM IR
lines needed for the pad probes to about 8.5% of what it was before
(4485 -> 381 lines).
2020-08-05 10:33:12 +03:00
Sebastian Dröge
9cb40878f0 Update CHANGELOG.md for 0.16.2 2020-07-27 12:43:53 +03:00
Sebastian Dröge
b8eaef3d02 gstreamer: Add parse_bin_from_description_with_name_full()
The non-full variant existed already.
2020-07-27 10:38:31 +03:00
Sebastian Dröge
4f5b2f5060 Update for removal of ObjectImpl::get_type_data() 2020-07-26 18:02:05 +03:00
Philippe Normand
3adc3d9337 functions: Add new parse_bin_from_description_with_name utility
This is basically `parse_bin_from_description()` but additionally the returned
bin has the passed name. It is sometimes convenient to name those bins so they
can later be easily retrieved by name from the pipeline they belong to.
2020-07-16 09:57:42 +01:00
Sebastian Dröge
81aba1b8a2 gstreamer/ghost_pad: Add convenience constructors with target pad
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/275
2020-07-10 12:12:03 +00:00
Sebastian Dröge
4246a560fc gstreamer/ghost_pad: Move GhostPad specific code into the ghost_pad module 2020-07-10 12:12:03 +00:00
Sebastian Dröge
0db75a5186 Update CHANGELOG.md for 0.16.1 2020-07-10 10:44:40 +03:00
Jan Alexander Steffens (heftig)
a430fd93c8
log: Allow calling DebugCategory::new before gstreamer::init
This is safe.
2020-07-09 16:06:01 +02:00
Sebastian Dröge
f40821ba66 Update versions to 0.17.0 2020-07-06 15:22:55 +03:00
Sebastian Dröge
ca8b8f6a38 Update CHANGELOG.md for 0.16.0 2020-07-06 15:22:07 +03:00
Sebastian Dröge
448c1e10a0 Regenerate 2020-07-06 13:01:57 +03:00
Sebastian Dröge
3bf5215872 Update configuration for new API 2020-07-06 12:08:36 +03:00
Sebastian Dröge
01eaf76b31 gstreamer/buffer: Add bindings for foreach_meta() and foreach_meta_mut()
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/268
2020-07-03 10:28:59 +03:00
Sebastian Dröge
f01b590a0c gstreamer/bufferlist: Add bindings for foreach() and foreach_mut()
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/273
2020-07-03 10:28:47 +03:00
François Laignel
275d93e3d2 memory: fix typo 2020-07-02 17:46:20 +02:00
Sebastian Dröge
0cc32a02cc gstreamer/element: Don't catch panics in post_message() vfunc
Otherwise we would post a message, which calls into this code again and
then does the whole thing recursively forever.
2020-07-01 01:36:16 +03:00
Sebastian Dröge
4fbbf48622 gstreamer/element: Change post_message() vfunc return type to bool
It regularly fails in normal situations, e.g. when the element is not
inside a bin and has no bus, and we don't really want to log errors for
that.
2020-07-01 01:15:57 +03:00
Sebastian Dröge
9cc99b27e0 gstreamer/element: Let post_message() and post_error_message() take ownership of the message
This is more in line with the C API and simplifies callers in Rust.
2020-06-30 23:55:02 +03:00
Sebastian Dröge
5b3d6418f0 gstreamer/element: Add support for overriding post_message vfunc 2020-06-30 23:46:51 +03:00
Sebastian Dröge
dbc76f1053 gstreamer/miniobject: Remove DerefMut and AsMut impls
They were side-stepping the miniobject writability mechanism.
2020-06-30 15:23:50 +03:00
Sebastian Dröge
911bb34dc2 Don't generate LAST/NONE variants of flags types
Those are automatically provided already.
2020-06-30 11:35:49 +03:00
Sebastian Dröge
45402b5e95 Add specific version configurations for various enum/flags values
gobject-introspection does not support this yet so we have to do that
manually.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/271
2020-06-30 11:23:37 +03:00
Sebastian Dröge
af01f1bc67 gstreamer: Simplify MiniObject bindings by removing one layer of abstraction
And instead directly implementing this via the macro on the target
types.
2020-06-30 11:06:02 +03:00
Sebastian Dröge
947ac8db5c Name functions returning a builder builder(), not new()
And also make the video event API more consistent with the normal event
API.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/269
2020-06-25 19:42:33 +03:00
François Laignel
ddd3bbbf84 query: remove unused Jitter & Rate
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/532#note_548884
2020-06-25 10:48:25 +02:00
François Laignel
c94baa4fe8 query: add constructor on target types
... and deprecate the `Query::new_*` forms.
2020-06-25 10:48:25 +02:00
François Laignel
884e5e4e4a event: add constructor on target types
... and deprecate the `Event::new_*` forms.
2020-06-25 10:48:25 +02:00
François Laignel
f421d878b6 message: add constructor on target types
... and deprecate the `Message::new_*` forms.
2020-06-25 10:48:20 +02:00
Sebastian Dröge
07e786b44f gstreamer/pad: Add support for setting proxy pad functions on a ghost pad during construction 2020-06-22 21:20:20 +00:00
Sebastian Dröge
a80471747c gstreamer/pad: Borrow the pad when taking the stream lock
Instead of taking a new reference to the pad.
2020-06-22 11:48:56 +03:00
Sebastian Dröge
79c457c8c4 gstreamer/pad: Rename Pad::builder_from_template() to builder_with_template()
Sounds more natural as it creates a build that is initialized *with* a
template.

But keep Pad::from_template() as it creates a new pad *from* a template.
2020-06-22 11:26:24 +03:00
Sebastian Dröge
0c0d671922 gstreamer/pad: Don't provide constructors anymore but instead a builder
This handles safely setting the pad functions during construction and
also has special support for ghost pads.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/247
2020-06-22 10:55:24 +03:00
Sebastian Dröge
750f8f5bb5 gstreamer/pad: Don't allow changing a pad's template after construction
That's generally not a good idea and not safe to do.
2020-06-21 20:02:52 +03:00
Sebastian Dröge
059dc5b2cb gstreamer/object: Don't provide bindings for functions to modify an object name
It's generally not safe to change the object name after construction and
not really a good idea.
2020-06-21 20:02:52 +03:00
Sebastian Dröge
210e7c8777 gstreamer/pad: Mark pad function setters as unsafe
This is not thread-safe and changing the function at a bad time will
cause crashes or worse. It's only really safe to set the functions right
after construction of the pad before any other code can know about it.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/247
2020-06-21 20:02:52 +03:00
Sebastian Dröge
c68df282e8 gstreamer/caps: Fix clippy warning
No need to provide the field name if it's initialized with a variable of
the same name.
2020-06-21 20:02:52 +03:00
Sebastian Dröge
801998c717 Generate documentation from the docs crate directly 2020-06-19 13:16:19 +03:00
Sebastian Dröge
8dfbc9e811 Regenerate 2020-06-19 13:09:11 +03:00
Sebastian Dröge
d22b1b5981 gstreamer: Update num-rational dependency to 0.3 2020-06-18 13:06:20 +03:00
Sebastian Dröge
bfde1fd9d5 Update for new_with_XXX/new_from_XXX function renaming 2020-06-16 11:45:12 +03:00
Guillaume Desmottes
a954c03bc0 functions: rename constructors in manual API
The idiomatic way for Rust constructors is to be named from_XXX()
instead of new_from_XXX() and with_XXX() instead of new_with_XXX().

Fix #460
2020-06-11 12:33:52 +02:00
Guillaume Desmottes
7b2fe31cc1 update gir generator and regenerate 2020-06-11 12:33:49 +02:00
Guillaume Desmottes
6cd711cfdf subclass: clean up subclassing prelude/re-exports
Use re-export pattern from glib.

Fix #255
2020-06-09 14:36:37 +02:00
Sebastian Dröge
a56b3cb5a0 Update CHANGELOG.md for 0.15.7 2020-06-08 13:29:06 +03:00
Sebastian Dröge
22113dc9cb gstreamer/iterator: Store filter types in a hash table
Static variables in generic functions only exist once and not once per
type parameter, so before we were only able to register exactly one
filter type.
2020-06-04 12:36:03 +03:00
Guillaume Desmottes
1b0a20e52f regenerate 2020-06-03 20:04:18 +03:00
Sebastian Dröge
ede4588e0c gstreamer: Add bindings for ProtectionMeta 2020-06-02 16:05:01 +03:00
Sebastian Dröge
9dbddc9fef gstreamer: Allow calling various global functions before gst::init()
Including most debugging related functions.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/211
2020-06-01 07:27:51 +00:00
Sebastian Dröge
e9317d0a48 Update CHANGELOG.md for 0.15.6 2020-05-28 15:51:43 +03:00
Sebastian Dröge
40c14ccc03 gstreamer: Update ron dependency to 0.6 2020-05-28 13:18:02 +03:00
Sebastian Dröge
dbf6d1fd1a gstreamer/promise: Return a borrowed StructureRef for the reply from the Future
Prevents an usually unneeded copy of the structure.
2020-05-27 14:48:48 +03:00
Sebastian Dröge
9d851bfc48 gstreamer/promise: Allow resolving the Promise with None and handle None explicitly in the change function
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1300
2020-05-27 13:55:51 +03:00
Sebastian Dröge
7086a754be Add various glib::Value trait impls for borrowed versions of types
For SDPMessageRef, StructureRef and CapsFeatureRef this involves the
conversion from and to a glib::Value. Specifically this means that e.g.
a StructureRef can be retrieved from a glib::Value via borrowing, i.e.
without creating a copy of the structure first.

For all mini objects only retrieval from a glib::Value is implemented as
the other direction would allow to get multiple immutable references
from a mutable reference without borrowing, which is not allowed and
would make it possible to observe a mini object changing while having an
immutable reference to it.
2020-05-27 13:17:54 +03:00
Sebastian Dröge
0b3bfa7ea2 gstreamer/promise: Convert None promise replies to an empty structure in the change_func
webrtcbin likes to put a NULL structure into the reply under some
circumstances when the promise successfully resolved.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1300
for details.
2020-05-27 12:24:11 +03:00
Sebastian Dröge
dfdf01b868 gstreamer/datetime_serde: Use glib::BoolError instead of a &'static str as TryFrom error type 2020-05-26 19:26:35 +03:00
Sebastian Dröge
d417656707 Use thiserror more widely for deriving Error/Display impls of error types 2020-05-26 19:26:35 +03:00
Sebastian Dröge
1b7e99938f gstreamer/event: Add setter/getter for the gst::Stream in the stream-start event 2020-05-17 13:38:45 +03:00
Sebastian Dröge
4097c15c96 Don't include LGPL docs in the docs if both embed-lgpl-docs and purge-lgpl-docs features are selected
This makes usage of RLS/rust-analyzer on the repository much faster and
less annoying as the docs don't have to be included and removed on every
change.
2020-05-14 10:44:58 +03:00
Sebastian Dröge
93bc5c9324 gstreamer/gstreamer-app: Don't store strong references in futures Stream/Sink adapters
This applies to the ones of the appsink, appsrc and bus. If we would
store a strong reference then they would keep alive the underlying
object forever even if their pipeline disappeared in the meantime.

Like this e.g. the bus stream would start returning None once the bus
was destroyed, similar to how other channels are working in Rust.
2020-05-13 22:13:11 +03:00
Sebastian Dröge
3f495ce1da gstreamer/plugin: Register plugins with the correct minor version when building for 1.18 2020-05-08 14:32:50 +03:00
Sebastian Dröge
781c5785b1 Regenerate 2020-05-05 17:29:14 +00:00
Vivia Nikolaidou
ec4a43be89 Regenerate 2020-05-03 16:48:35 +03:00
Vivia Nikolaidou
e986119df6 Update Cargo.toml to 1.18 2020-05-03 16:48:35 +03:00
Vivia Nikolaidou
3ac7631ea0 gstreamer/bin: Implement iterate_all_by_element_factory_name manually 2020-05-03 16:48:35 +03:00
Sebastian Dröge
3192d74389 Update CHANGELOG.md for 0.15.5 2020-05-03 10:17:18 +03:00
Vivia Nikolaidou
118c7d4ad9 Regenerate 2020-04-30 17:16:23 +03:00
Jan Alexander Steffens (heftig)
1d2609d448
gstreamer: Return any lifetime instead of 'static
Following https://github.com/gtk-rs/glib/pull/633
2020-04-30 09:50:00 +02:00
Guillaume Desmottes
a6c20922ff update documentation links 2020-04-28 11:17:24 +02:00
Sebastian Dröge
6e431ce060 Run everything through rustfmt again
It got some improvements for applying consistent formatting to code
blocks in macros.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/468>
2020-04-24 12:46:16 +03:00
Sebastian Dröge
834b6d8d69 gstreamer/proxypad: Convert default pad functions to plain functions on ProxyPad instead of a trait
This allows to use them properly when overriding these functions.
2020-04-23 15:37:18 +03:00
Guillaume Desmottes
6a72f65b3b gstreamer: ignore cognitive_complexity warnings
Those are just long tests.
2020-04-21 10:17:46 +02:00
Guillaume Desmottes
a12b51abd6 gstreamer: stream_collection: ignore new_ret_no_self clippy warning 2020-04-21 09:00:35 +02:00
Guillaume Desmottes
872024c372 fix option_as_ref_deref clippy warnings 2020-04-21 09:00:35 +02:00
Guillaume Desmottes
932c940102 gstreamer: caps: add new_from_iter(_with_features)() 2020-04-20 17:12:24 +02:00
Guillaume Desmottes
97026d7f86 gstreamer: structure: add new_from_iter()
Allow to easily create a new Structure from an iterator.

Fix #250
2020-04-20 15:53:28 +02:00
Sebastian Dröge
caae679d6f gstreamer: Add some API to calculate the next state convert state changes into their component states and back 2020-04-18 09:23:08 +03:00
Sebastian Dröge
ada06502b5 gstreamer: Remove redundant stream/stream collection property getters
There are also actual functions for these and we had both enabled
because the properties are missing the "Since: 1.10" markers.
2020-04-15 14:40:37 +03:00
Sebastian Dröge
aea43c428c gstreamer: Add Stream::debug() and StreamCollection::debug()
These provide more helpful debug output than just the pointer when
printing.
2020-04-14 17:31:54 +00:00
Sebastian Dröge
2ef7d70ba3 gstreamer: Enforce that stream collections are immutable after creation by using the builder pattern 2020-04-14 17:31:54 +00:00
Sebastian Dröge
185eb188ca Fix various signal handler trampoline usages 2020-04-13 19:24:04 +03:00
Sebastian Dröge
5021994237 Regenerate everything 2020-04-13 19:11:33 +03:00
Sebastian Dröge
76a0410d41 Replace unneeded transmute calls with a safer alternative 2020-04-12 19:47:49 +03:00
Sebastian Dröge
d1665b8114 Regenerate with latest gir 2020-04-12 18:55:06 +03:00
Guillaume Gomez
1ef3bf52d2 gstreamer: Add missing init calls in tests 2020-04-12 17:25:54 +03:00
Guillaume Gomez
c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge
62e9af58c6 Fix some clippy warnings 2020-04-11 21:18:18 +03:00
Sebastian Dröge
d7ed8d1e35 gstreamer: Add Element::get_current_clock_time() and ::get_current_running_time()
This was added in GStreamer 1.18 but we can easily implement it
ourselves here for the time being and for older versions.
2020-04-11 21:12:03 +03:00
Sebastian Dröge
94ace06883 Remove deprecated std::error::Error::description() impls 2020-04-11 19:39:04 +03:00
Sebastian Dröge
d05f8cace8 gstreamer: Add bindings for Plugin::get_plugin_name()
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/248
2020-04-11 19:33:34 +03:00
Sebastian Dröge
62c0f5ef42 Use mem::ManuallyDrop instead of mem::forget() everywhere
It makes the intentions clearer and potentially results in simpler
assembly, at least in debug builds.
2020-04-09 16:57:06 +03:00
Sebastian Dröge
9f96c5e573 gstreamer/buffer: Unmap memory in flush() of the Write impl of the buffer cursor
This makes sure that any remaining data is actually written out as part
of the unmapping, which might be necessary depending on the memory type.
2020-04-07 13:47:04 +03:00
Sebastian Dröge
2fbb10ec92 gstreamer/buffer: Only unmap memory in buffer cursor seek impl if we have to move to a different memory
Prevents some unnecessary unmaps.
2020-04-07 13:45:36 +03:00
Sebastian Dröge
35f7c910a9 gstreamer/buffer: Refactor buffer cursor implementation with macros to reduce code duplication 2020-04-07 13:45:36 +03:00
Sebastian Dröge
42d09c2834 gstreamer/buffer: Move BufferCursor/BufferRefCursor into its own module
It's quite a bit of code and can be kept nicely separate.
2020-04-07 12:59:24 +03:00
Sebastian Dröge
5fc68e252d gstreamer: Add missing BufferCursorRef re-export 2020-04-06 21:00:42 +03:00
Sebastian Dröge
ee3a8caa7d gstreamer/buffer: Add various tests for the BufferCursor / BufferCursorRef 2020-04-06 20:15:51 +03:00
Sebastian Dröge
a884a419db gstreamer/buffer: Add a BufferCursor / BufferCursorRef helper structs
This implements Read/Seek or Write/Seek and allows to read/write/seek
into the buffer without merging the memories inside.

The writer also only maps the memory write-only as compared to all other
ways of accessing the buffer/memory data in a writable way, which have
to map it read-write.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/425
for a similar API proposal for GStreamer core.
2020-04-06 20:15:35 +03:00
Sebastian Dröge
9b782b4dfa gstreamer/buffer: Add tests for various memory related buffer API 2020-04-06 19:29:19 +03:00
Sebastian Dröge
9e0c980a49 gstreamer/buffer: Add iterators for iterating over the memories inside a buffer
With immutable, mutable and owned variant.
2020-04-06 19:28:28 +03:00
Sebastian Dröge
2b70db3a9e gstreamer/buffer: Add BufferRef::peek_memory_mut() function
This gives a mutable reference to the given memory and fails if the
memory is not actually writable.
2020-04-06 19:27:40 +03:00
Sebastian Dröge
019afd54f9 Update for new from_glib_borrow signature
See https://github.com/gtk-rs/glib/pull/605
2020-04-05 18:48:48 +03:00
Sebastian Dröge
7120d54a46 gstreamer/pad: Add tests for getrange functions 2020-04-02 19:58:15 +03:00
Sebastian Dröge
d7e6c2e37f gstreamer/pad: Add support for filling the passed in buffer in the getrange function
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:58:09 +03:00
Sebastian Dröge
7c2f3bafa0 gstreamer/pad: Add get_range_fill() and pull_range_fill() functions
These allow providing an already allocated, writable buffer.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:57:28 +03:00
Sebastian Dröge
962da8a63d gstreamer/datetime: Add TryFrom impls for converting between glib::DateTime and gst::DateTime 2020-03-22 14:01:32 +02:00
Sebastian Dröge
7dd0404927 gstreamer/datetime: new_from_g_date_time() can actually return NULL
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/411
2020-03-22 14:01:32 +02:00
Sebastian Dröge
d0bfdda97f examples: Update for new GLib boxed deriving API 2020-03-19 14:20:52 +02:00
Sebastian Dröge
8bb64bb825 gstreamer/log: Replace % with %% in the debug message
Otherwise gst_debug_log() will look for further arguments that don't
exist, and will likely crash or worse.
2020-03-18 23:54:46 +02:00
Jan Alexander Steffens (heftig)
af27d73e5c
gstreamer: Return &'static str from StructureRef
The names are backed by Quarks and thus eternally valid.
2020-03-12 19:25:12 +01:00
Sebastian Dröge
755ef9da33 Update CHANGELOG.md for 0.15.4 2020-03-10 10:57:33 +02:00
Sebastian Dröge
8e038572cb gstreamer/caps: Assert on ANY caps in fixate() and work around bug in handling EMPTY caps
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/388
2020-03-09 13:02:20 +02:00
Sebastian Dröge
8d0fa62275 Minor cleanup in various places 2020-03-09 12:55:14 +02:00
Sebastian Dröge
9d5ae8ed14 gstreamer: Don't take mini objects by value for append() and similar operations
Compared to
  let foo = Foo::bar(foo);
the new form is easier to follow
  foo.bar();
2020-03-07 00:31:30 +02:00
Sebastian Dröge
b21f576430 Add #[must_use] attribute to mutex guards / stream lock
It's usually a mistake if creating one of these and immediately dropping
them again as that would immediately unlock the mutex again.
2020-02-28 16:29:48 +02:00
Sebastian Dröge
98ecef7153 Make sure to hold MutexGuard for the remainder of the function in various places
Not assigning it to a variable would cause it to be dropped immediately
and the lock to be released again immediately.
2020-02-27 12:10:14 +02:00
Sebastian Dröge
71497e77de gstreamer/log: Allow any glib::Object as target for logging
gst::Object is not actually required. For plain glib::Objects only the
pointer address is printed instead of a name but it works fine.
2020-02-22 18:42:02 +02:00
Sebastian Dröge
e585b37923 Update CHANGELOG.md for 0.15.3 2020-02-15 15:23:12 +01:00
Sebastian Dröge
d58cf01e3a Allow changing bus sync handler and appsink/src callbacks when running with 1.16.3 or newer
Previously it was not thread-safe to change them and could lead to
crashes but with 1.16.3 it is now.

Unsetting the bus sync handler before 1.16.3 will have no effect at all,
setting a new bus sync handler or appsink/src callbacks will panic.

This partially reverts 2f88dc6576
2020-02-15 10:25:19 +01:00
Sebastian Dröge
2f88dc6576 Only allow setting Bus sync handler and AppSrc/Sink callbacks once
Re-setting them is not thread-safe and can cause segfaults or worse.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/506
and https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/729
2020-02-09 21:37:03 +02:00
Sebastian Dröge
cddccf9502 gstreamer/promise: Add Future constructor for Promise
This returns a tuple that basically works like a oneshot channel: the
Promise acts as the "sender" and once the promise resolves the
"receiver" contains the result.
2020-02-09 19:08:41 +02:00
Valmir Pretto
6263922b6d gstreamer: BusStream tests 2020-02-04 10:33:34 -03:00
Valmir Pretto
7663589d94 gstreamer: BusStream cleanup
A few small readability changes
2020-02-04 10:33:25 -03:00
Sebastian Dröge
8b3049d098 impl Clone for BufferPoolConfig and PlayerConfig 2020-01-30 23:10:26 +02:00
Sebastian Dröge
5102bfd324 Update CHANGELOG.md for 0.15.2 2020-01-30 00:40:56 +02:00
Sebastian Dröge
fe4f074e90 bus: Don't use the bus sync handler in the bus Stream to notify about messages being available
This is racy and can cause the consumer of the messages to never be
woken up anymore:

1. Waker is stored because no message on the bus
2. Sync handler is called, waker is woken up
3. Bus is polled again and no message is on it (yet),
   new waker is registered
4. Bus stores the message from 2. in its queue (after
   the sync handler has returned BusSyncReply::Pass)
5. No new message ever appears on the bus because all
   this happened for the very last message

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/235
2020-01-28 23:39:36 +02:00
Sebastian Dröge
63a8afafa5 gstreamer: Use more accurate types for Seqnum, GroupId and MetaSeqnum
For the latter introduce an actual opaque type that allows using them
for comparison purposes but is not just a plain u64.

For the former represent them as opaque type around an NonZeroU32. 0 is
the invalid case and does not happen in the majority of functions. Where
it can happen, represent this case by using an Option<_> instead.

This makes it harder to mis-use these types.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/209
2020-01-25 00:07:36 +02:00
Sebastian Dröge
0bd2903896 Update CHANGELOG.md for 0.15.1 2020-01-23 08:28:19 +02:00
Sebastian Dröge
7230aee069 Switch everything from lazy_static to once_cell::Lazy
Fewer macros, faster compile-time and the Lazy type will likely end up
in the standard library in a similar form to this.
2020-01-22 19:57:41 +02:00
Sebastian Dröge
2b5f16391d gstreamer/childproxy: Fix unused variable compiler warnings 2020-01-22 19:57:41 +02:00
Sebastian Dröge
196a9891cb Regenerate with latest gir
This switches the RTP constant strings over to once_cell::Lazy
2020-01-22 19:57:41 +02:00
Sebastian Dröge
d3c77f400d Don't derive Debug impls for generic types where the type parameters don't have to impl Debug themselves
This allows to use MappedBuffer and similar types to be properly
debug-printed.

Also change VideoFrame/VideoFrameRef/RTPBuffer from a tuple struct to a
struct with proper field names to make the code easier to understand.
2020-01-22 19:10:04 +02:00
Sebastian Dröge
280fe38fe4 gstreamer/childproxy: Don't require implementing child_added/removed() signal vfuncs
Most implementers will not care about default handlers for these signals
so requiring to implement them is only unnecessarily verbose.
2020-01-22 17:14:38 +02:00
Sebastian Dröge
b17f04e866 bus: Make bus Stream private and add functions on the bus directly for it
Also add a helper function that allows filtering the stream directly.
2020-01-22 10:05:36 +02:00
Sebastian Dröge
217bbc3e94 bus: Take the mutex before popping messages for the bus stream
Otherwise a message might arrive between popping, getting None and
locking the mutex for storing the waker. In that case we would never
be woken up.
2020-01-22 09:21:10 +02:00
Sebastian Dröge
aa29567171 gstreamer/element: Add call_async_future() that returns a future
The future would resolve into the return value of the closure that is
called asynchronously on the thread pool, and allows asynchronous
awaiting for it to finish.

  let res = element.call_async(|element| {
      element.set_state(gst::State::Playing)
  }).await;

  assert_eq!(res, Ok(gst::StateChangeSuccess::Success))
2020-01-20 12:03:59 +02:00
Guillaume Desmottes
01c4d08501 gstreamer: use thiserror crate
Make code simpler and fix deprecated warning when building on nightly as
Error::description is being deprecated.
2020-01-10 18:54:50 +05:30
Guillaume Desmottes
e151ee75f8 gstreamer: error: add tests 2020-01-10 18:54:50 +05:30
Guillaume Desmottes
1f79bf3e02 gstreamer: caps: Builder: prevent re-adding features
Rework the API to statically prevent users re-adding features or
adding features if any_features() has been previously called.
2020-01-10 15:09:06 +05:30
Guillaume Desmottes
fe5ebd82cc gstreamer: caps: BuilderFull: prevent adding features if using any
Rework the API to statically prevent users adding extra features if the
builder has been created with builder_full_with_any_features(). It
doesn't make sense to add extra features if all are already included.
2020-01-10 14:21:23 +05:30
Guillaume Desmottes
a9adac85aa gstreamer: pad: fix build on Windows
GstPadProbeInfo.id is a gulong which are 32 bits on Windows.
2020-01-09 10:14:21 +00:00
Guillaume Desmottes
38db96859b gstreamer: add Caps::builder_full()
API to create a caps containing multiple structures.
Fix #231
2020-01-09 15:01:18 +05:30
Sebastian Dröge
775c5bfe27 gstreamer: Add getters/setters for BinFlags and fix flags API for PadFlags
The BinFlags API was accidentally used for PadFlags, allowing to set
BinFlags on pads which is not very useful.
2020-01-06 17:23:39 +02:00
Sebastian Dröge
8aac047af5 Use NonZeroU64/U32 for PadProbeId, NotifyId and DeviceMonitorFilterId
This allows for some further optimizations.
2020-01-05 11:09:46 +02:00
Guillaume Desmottes
c298577139 gstreamer: add MemoryRef::dump() 2019-12-24 09:15:34 +05:30
Sebastian Dröge
69be1ce2fc Fix various new clippy warnings from 1.40 2019-12-22 12:10:27 +02:00
Sebastian Dröge
d26ffc2c21 Update version to 0.16.0 2019-12-19 00:48:08 +02:00
Sebastian Dröge
bb321f7fa8 Update CHANGELOG.md for 0.15.0 2019-12-18 19:15:21 +02:00
Sebastian Dröge
2ba5105b80 Implement Sync/Send for more types and don't implement Send for TypeFind
They can actually be shared with multiple threads at the same time
safely as all functions requiring an immutable reference are
thread-safe.

OTOH TypeFind can't be shared safely between different threads as not
all implementations of the TypeFind struct are thread-safe.
2019-12-18 18:37:44 +02:00
Sebastian Dröge
be3c378f28 Use Results instead of Options where they signal an error instead of just a missing value
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 22:21:28 +02:00
Sebastian Dröge
eaafbd14f7 Regenerate 2019-12-15 12:19:33 +02:00
Sebastian Dröge
f417d68820 Remove usage of glib_floating_reference_guard!()
It's not needed anymore.
2019-12-07 23:05:14 +02:00
Sebastian Dröge
2375c9da59 gstreamer/element: Don't steal floating references passed into release_pad()
They are apparently not part of this element so we can directly return
here instead of stealing the reference.
2019-12-07 22:58:26 +02:00
Sebastian Dröge
802fa4fcb4 gstreamer/bin: Take a strong reference of the element passed into remove_element()
It might be gone once we called into the parent class' implementation so
we need to keep a strong reference around here. Also we need to ensure
that we don't accidentally steal a floating reference from the caller
here: if the element is still floating it is apparently not part of this
bin and we can directly return FALSE.
2019-12-07 22:56:11 +02:00
Sebastian Dröge
bef1143df3 gstreamer/device: Preserve floating reference flag from create_element() parent class' implementation 2019-12-07 22:51:57 +02:00
Sebastian Dröge
84ac2ef073 bin: Use from_glib_none() in Bin::add() for subclasses
This way we take ownership of any floating references passed in here, as
required by the GstBin API, instead of just borrowing the reference and
having someone else sink it or not.
2019-12-04 18:49:12 +02:00
François Laignel
fd6bbf5929 Fully qualify glib_bool_error! in gst_loggable_error! 2019-11-21 19:18:01 +01:00
Sebastian Dröge
175863668d Regenerate everything with latest gir 2019-11-21 09:52:51 +02:00
François Laignel
dc7937a8d4 Don't leak missing Safety doc clippy warnings
With rustc 1.40.0, clippy checks that the `unsafe` functions come with
a `Safety` section. When running clippy on a downstream crate, the
macros such as `gst_plugin_define!` leak the clippy warnings for the
unsafe functions.

Silence the warnings for now.
2019-11-18 10:25:06 +01:00
Sebastian Dröge
9f121b1f12 gstreamer/sample: Silence clippy warning
warning: methods called `new` usually return `Self`
   --> gstreamer/src/sample.rs:107:5
    |
107 | /     pub fn new<'a>() -> SampleBuilder<'a> {
    | |_____^
2019-11-14 12:11:10 +00:00
Sebastian Dröge
0c944cb26e gstreamer: Add documentation to gst::deinit() about when it's safe to be called 2019-11-14 12:11:10 +00:00
Sebastian Dröge
8b687ab4a7 Remove header from the README.md about the move from github to gitlab
At this point everybody should've noticed.
2019-11-14 10:21:02 +00:00
Guillaume Desmottes
1206dc5b15 gstreamer: typefind: add binding for gst_type_find_get_length() 2019-11-14 09:33:29 +00:00
Sebastian Dröge
043af60126 iterator: Fix leak of the closure in Iterator::filter() 2019-11-13 12:18:21 +01:00
Sebastian Dröge
3d1b3211bf promise: Add unit test for change func handling 2019-11-13 12:13:14 +01:00
Sebastian Dröge
d69e8e237f promise: Remove unneeded feature gates 2019-11-13 12:05:25 +01:00
Sebastian Dröge
cd55f02e20 promise: Change change_func to get the actual reply of the promise passed 2019-11-13 11:40:41 +01:00
Sebastian Dröge
77c6741ae0 Update to futures 0.3 and require Rust 1.39
Also use async/await in the futures examples.
2019-11-11 12:18:49 +01:00
Guillaume Gomez
9e30687d8e Fix glib reexports 2019-11-11 11:34:09 +01:00
Guillaume Gomez
a58cd4b5bc Manual code fixes 2019-11-11 11:34:09 +01:00
Guillaume Gomez
457ac9118b Regenerate with latest gir 2019-11-11 11:34:09 +01:00
Sebastian Dröge
8dcf3fec20 gstreamer: Change Sample constructor to the builder pattern
Simplifies construction of Samples considerably.
2019-10-23 09:55:56 +03:00
Sebastian Dröge
2d2459ed52 Export traits from the crate level and ensure that all traits are in the preludes 2019-10-17 13:30:35 +03:00
Sebastian Dröge
132eb891ed Fix dox feature and docs.rs Cargo.toml metadata 2019-10-05 00:13:29 +03:00
Sebastian Dröge
991f2e1576 Update and regenerate everything with latest gir 2019-10-05 00:03:57 +03:00
Fernando Jimenez Moreno
591468f53b gstreamer/log: Use non-panicking UTF8 conversion in log handler
Make sure that `log_handler` and `DebugMessage::get` do not panic while
processing non-UTF8 characters by using lossy instead of strict UTF8
string conversion.
2019-10-04 09:03:28 +00:00
Sebastian Dröge
06cfcd57fc Move to_string() methods into the Display trait or rename to to_str(), move from_string() into the FromStr trait
Fixes clippy warnings, prevents confusing errors and is more consistent.

The Display trait provides a to_string() method by itself and FromStr
provides from_str().
2019-10-04 11:01:55 +03:00