Commit graph

994 commits

Author SHA1 Message Date
Marijn Suijten
f89e840d27 Remove redundant prelude imports
When importing the prelude of a crate like `gst` the `glib` prelude is
provided too.  Shedding these imports saves quite a few lines and
adheres to keeping it simple; we're not reexporting base/parent preludes
for no reason :)
2021-04-29 12:05:13 +02:00
Sebastian Dröge
3ad7a18792 gstreamer: Remove unused leftover ToGlib import
And directly call from_glib_borrow() instead of adding a use statement
for it.
2021-04-28 09:28:54 +03:00
Bilal Elmoussaoui
890cd03632 manual renames of to_glib into into_glib 2021-04-27 19:44:41 +02:00
Bilal Elmoussaoui
060a7df448 regen with renamed ToGlib into IntoGlib 2021-04-27 19:14:52 +02:00
Marijn Suijten
da156e8ce7 Update gir and regenerate without unused glib::ToValue imports 2021-04-27 10:14:19 +02:00
Marijn Suijten
5dade6a93c Disallow unused_imports in auto module again
This was temporarily allowed by Value trait refactoring, but the root
cause of the unused imports has been found (`glib::ToValue` for property
getters) and fixed in https://github.com/gtk-rs/gir/pull/1117.
2021-04-27 10:14:12 +02:00
Sebastian Dröge
1d59ea91c5 Clean up various imports everywhere 2021-04-26 15:16:58 +03:00
Marijn Suijten
1a07bfc710 Update gir and regenerate without trait reexports in crate root 2021-04-26 13:24:02 +02:00
Marijn Suijten
2c40ce10ab gstreamer,pbutils: Only import traits from prelude
Future changes will make all traits - both manual and auto - unavailable
from the crate root; they can then only be imported from the `prelude`.
2021-04-26 13:24:02 +02:00
Marijn Suijten
827ff99965 lib: Only export traits (Ext and ExtManual) from prelude
In gir it was brought up [1] that some traits (in particular
`*ExtManual`) are exported from the crate root in addition to the
prelude, cluttering the environment unnecessarily.  This commit removes
all these reexports, leaving those in prelude (that were already there)
only.

After this commit everything matching `Ext(Manual)?\b` in `lib.rs` sits
within `pub mod prelude {};`.

[1]: https://github.com/gtk-rs/gir/pull/1111
2021-04-26 11:25:23 +02:00
Sebastian Dröge
5b7b39c448 gstreamer: Add CapsFeatures API using glib::Quarks instead of strings
The same API for Structures already exists.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/141
2021-04-26 10:54:23 +03:00
Sebastian Dröge
eda1d3d4a7 Update for Value trait refactoring 2021-04-25 14:45:08 +03:00
Sebastian Dröge
0eb5845934 Regenerate with latest gir 2021-04-25 14:45:01 +03:00
Marijn Suijten
1b2b3a75bc Update gir with generator.py included and regenerate
The `gir` repository now includes `generator.py` for easier sharing of
improvements with other projects like `gtk(4)-rs`.
2021-04-24 09:39:04 +02:00
Sebastian Dröge
9d3888d294 gstreamer: Fix PromiseFuture implementation
We can't return a plain reference to something stored inside the future
as that would go out of scope after `await`. Instead return a struct
that wraps the `gst::Promise`, derefs to a structure and keeps the
promise alive as long as needed.
2021-04-23 11:52:02 +00:00
François Laignel
1395d773c3 manual fixes remove get prefix round 2 2021-04-20 18:18:02 +02:00
François Laignel
6ab9164dca fix-getters-calls 0.3.0 pass 2021-04-20 18:18:02 +02:00
François Laignel
e80a29372a fix-getters-def 0.3.0 pass 2021-04-20 18:18:02 +02:00
François Laignel
b8b944b72b subclass: remove get prefix where applicable 2021-04-20 18:18:02 +02:00
François Laignel
f7472c82e3 regen: relaxed get fn identification 2021-04-20 18:18:02 +02:00
François Laignel
172a4d47ab regen: use type_ for glib macros
This also includes a new substitution for bool getters:
get_need_... -> needs_...
2021-04-20 18:18:02 +02:00
Sebastian Dröge
bf6669a9cb gstreamer: Add TagList::remove() for removing tags
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/327
2021-04-20 10:22:14 +03:00
Marijn Suijten
9cc488db4c gstreamer/miniobject: Make get_type function optional
Static typing is needed for `Value` interop, but not every type
(GLMemory in this instance) requires that.
2021-04-17 07:54:40 +00:00
François Laignel
99616ec0b4 post fix-getters manual updates 2021-04-13 17:54:40 +02:00
François Laignel
53be8e5f58 fix-getters-{def,calls} pass 2021-04-13 17:54:40 +02:00
François Laignel
08545cbefc regen - remove get prefix for getters 2021-04-13 17:54:38 +02:00
Sebastian Dröge
7e7f358ba2 gstreamer/tags: Replace removed glib TypedValue with local TagValue
See https://github.com/gtk-rs/gtk-rs/pull/449.  This struct remains
vital in GStreamer code to tie a type to an (untyped) SendValue, so that
the underlying value can be retrieved without having to guess its type.
That type is anyway stored in a private member T::TagType.

Co-authored-by: Marijn Suijten <marijns95@gmail.com>
2021-04-12 10:04:26 +02:00
Sebastian Dröge
a775f58753 Use glib::Error::into_raw() for passing GErrors without copying back to C 2021-04-11 10:45:56 +03:00
Sebastian Dröge
8d983066f5 gstreamer: Store ffi::GstCaps inside gst::Caps and equivalent for other miniobjects
Simplifies code and prepares for the next changes.
2021-04-03 17:43:50 +03:00
Sebastian Dröge
21ff418b0f gstreamer: Store ffi::GstCapsFeatures inside gst::CapsFeatures
Simplifies code and prepares for the next changes.
2021-04-03 17:35:22 +03:00
Sebastian Dröge
b6f6758454 gstreamer: Store ffi::GstStructure inside gst::Structure
Simplifies code and prepares for the next changes.
2021-04-03 17:35:10 +03:00
Marijn Suijten
6ec0e3ac4b Update gir and regenerate with extended gir-dirs comments
Gir now prints all directories and their hashes in the version file and
comments; useful now that gstreamer-rs is being generated from both
gir-files/ and gst-gir-files/ submodules.
2021-04-01 15:58:41 +02:00
Marijn Suijten
a38561fbcd Update gir and regenerate with redundant #[cfg]/#[cfg_attr] removed
Also ignores `clippy::upper_case_acronyms` introduced with 1.51 which
can't be adhered to in bindings.
2021-04-01 15:53:18 +02:00
Sebastian Dröge
15505cc5b8 Re-export interface ImplExt traits from the preludes 2021-03-14 14:06:30 +02:00
Sebastian Dröge
27385104d8 Update for glib interface API changes 2021-03-14 10:45:52 +02:00
Sebastian Dröge
ea239c587e Store panic information not in a custom instance struct but in the instance data provided by the subclassing infrastructure
This scales better as there will only be only such data instead of two
or more when having deeper class hierarchies with multiple Rust
elements, and also makes it unnecessary to use a special instance struct
so the default works well.
2021-03-09 16:36:35 +02:00
Sebastian Dröge
6fa48890bc Update for the subclassing glib bindings API changes 2021-03-09 16:04:32 +02:00
Sebastian Dröge
0b61713398 gstreamer/uri_handler: Update for glib bindings API changes 2021-03-09 11:17:15 +02:00
Sebastian Dröge
a311591310 Regenerate with latest gir 2021-03-08 12:25:37 +02:00
Sebastian Dröge
0803dd411e Update for glib subclass API cleanup 2021-03-08 12:18:24 +02:00
Sebastian Dröge
b8c20c07ce Update for new #[glib::object_subclass] attribute macro 2021-03-07 13:08:06 +02:00
Sebastian Dröge
932b8f813d gstreamer/pad: Add support for removing pad probes from the probe callback
While this allows to remove the pad probe multiple times, which would
cause a g_warning(), this is not actually making the situation worse
than before while making some code patterns easier to implement:

  - Probes could already be removed twice by return
    gst::PadProbeReturn::Remove and then calling pad.remove_probe()
  - Probes could be removed from a different pad than where they were
    added

As such let's go with the simple solution here for now and allow giving
owned access to the probe id from the probe callback.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/286
2021-02-28 19:08:59 +02:00
Sebastian Dröge
5822785191 Regenerate with latest gir 2021-02-28 18:30:54 +02:00
Sebastian Dröge
a316d610eb gstreamer: Update for glib::Type API changes 2021-02-25 12:49:47 +02:00
Sebastian Dröge
2b0b3910ee Regenerate everything with latest gir 2021-02-22 17:13:45 +02:00
Jan Alexander Steffens (heftig)
59d91b2abf gstreamer/plugin_feature: Make load downcast to Self
The loaded plugin feature is always of the same type as the unloaded
one. Move `fn load` to PluginFeatureExtManual to implement this.
2021-02-19 11:23:56 +00:00
Sebastian Dröge
d746bf91e1 gstreamer: Provide better bindings for ElementFactoryListType
Make it an actual bitflags type instead of just an u64 alias and add all
the constants. As it's not defined as bitflags in C this needs to be
done manually.
2021-02-19 12:56:54 +02:00
Marijn Suijten
ce67076f26 gstreamer,video: Do not zero-initialize designated struct members
This should be analogous to C struct initalizers where all unspecified
fields are initialized to zero. Without mut this reads a bit nicer as
well.

Note that two out of three structs have all members specified, hence
need no zero-initialization of the remainder at all.
2021-02-15 20:19:38 +01:00
Marijn Suijten
89c7883202 gstreamer: Automatically generate Allocator::alloc
Parameter mutability has been fixed (and reverted, hence overridden with
const=true)for this function in gstreamer; it can now be automatically
generated.
2021-02-15 20:19:38 +01:00
Marijn Suijten
6b94083a07 gstreamer/allocation_params: Implement to_glib_none
This is needed by the now-autogenerated implementation of
Allocator::alloc, and later on the GL bindings.
2021-02-15 20:19:38 +01:00
Marijn Suijten
439db15c20 Regenerate with 1.18.3 and preliminary changes for 1.18.4 2021-02-15 20:19:38 +01:00
Sebastian Dröge
5da6e82b5e gstreamer/datetime: Silence new 1.50 clippy warning 2021-02-10 13:09:51 +02:00
Sebastian Dröge
faa6463bda gstreamer/clock: Move away from deprecated atomic API 2021-02-10 13:09:51 +02:00
Vivia Nikolaidou
0a119cada6 gstreamer-audio: Add AudioConverterConfig 2021-02-09 19:13:30 +02:00
Sebastian Dröge
3c0281db0c gstreamer/uri_handler: Update for glib class data API changes
Based on a patch by Bilal Elmoussaoui
2021-02-07 17:40:45 +02:00
Sebastian Dröge
9d86cef2da Regenerate everything with latest gir 2021-02-07 17:07:17 +02:00
Sebastian Dröge
32a96dd72c gstreamer/log: Handle compiled out GStreamer debug system properly
By mirroring the no-op behaviour of the C code instead of failing
because of a NULL debug category.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/306
2021-01-31 12:25:48 +02:00
Marijn Suijten
1ffa02fc1f Update gir to c85699a with import cleanups; regenerate
Apply import cleanups from https://github.com/gtk-rs/gir/pull/1043,
omitting `use` statements where unnecessary or guarding them with
versioning constraints to prevent `unused_imports` warnings.

Removes unnecessary `mut_override` with
https://github.com/gtk-rs/gir/pull/1044 as well.
2021-01-30 15:49:38 +01:00
Jan Alexander Steffens (heftig)
796f93f7f4 gstreamer/clock_time: Improve Display formatting
- Add support for precision, padding and alignment.
- Format the invalid time using dashes (`--:--:--.---------`) instead of
  a technically valid `99:99:99.999999999`

The latter is something C's `GST_TIME_FORMAT` can't do, though something
obviously invalid like `-1👎-1.000000000` would be possible.
2021-01-29 16:31:07 +00:00
Sebastian Dröge
0e8b95f1d0 urihandler: Provide URIType as associated constant when implementing the gst::URIHandler interface
The supported protocols still stay a function because they might have to
be probed at runtime, but they return a static string array now as they
must not randomly change at runtime.
2021-01-25 13:56:55 +02:00
Sebastian Dröge
ea0eb4fa70 gstreamer/paramspecs: Add bindings for GST_PARAM_CONTROLLABLE and related custom paramspec flags 2021-01-25 13:56:55 +02:00
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
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
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
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
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
92df13eeb1 Regenerate with trusted nullability 2020-12-04 19:37:06 +01:00
Marijn Suijten
47102b0e76 Regenerate with fresh gir files 2020-12-04 19:34:09 +01:00
Guillaume Gomez
8f9d76bb8c Revert "Remove unnecessary dox feature"
This reverts commit 9dd8bd9095.
2020-11-27 14:37:49 +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
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
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
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
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
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
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
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
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
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