Commit graph

59 commits

Author SHA1 Message Date
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 Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03: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 69be1ce2fc Fix various new clippy warnings from 1.40 2019-12-22 12:10:27 +02: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
François Laignel 514a05accd Manual update for new Value::get signature 2019-08-13 10:57:32 +02:00
Sebastian Dröge 424a87efbf Use MaybeUninit::zeroed() everywhere possible instead of mem::zeroed() 2019-07-11 17:56:50 +03:00
Guillaume Desmottes 24d9dc6209 gstreamer: tags: make call to to_string() explicit
This one was actually working but better to be safe as it may be
ambigious.
2019-06-18 17:11:24 +05:30
Sebastian Dröge e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
François Laignel bec3d84627 TagList: add TagScope {get, set} 2019-03-20 13:58:28 +00:00
Sebastian Dröge ca791ae4fa Use an empty enum for the custom tag in the test
There's no point in allowing to have values of it, it's only a marker
type.
2019-01-23 16:11:52 +02:00
Sebastian Dröge 9d79280929 Add some more functions for generically handling tags 2019-01-23 15:54:00 +02:00
Sebastian Dröge 598e012568 Add bindings for gst::tags::register() 2019-01-23 15:52:51 +02:00
Sebastian Dröge bd0cbe99b3 Add more Debug impls to everything possible 2019-01-22 17:46:08 +02:00
Sami Jaktholm 6f867443c9 tags: fix album tag definition
The Album tag should be defined using the GST_TAG_ALBUM constant instead
of GST_TAG_ARTIST_SORTNAME.
2018-12-28 19:51:28 +02:00
Sebastian Dröge 36bcb5630a Remove various unused use statements 2018-12-08 14:58:14 +02:00
Sebastian Dröge 9f8ec3b35b Rename TagList::iter_tag_list() to TagList::iter_generic() and ::iter_tag_list_simple() to ::iter()
It's the generic iterator for going over values, and the simple one is
the one you usually want.

Also rename iterator types, but those are internal anyway.
2018-10-28 17:30:25 +00:00
Sebastian Dröge 8a6bcbcedb Run through rustfmt once again 2018-10-28 13:47:02 +00:00
Sebastian Dröge 54d8065dd3 Add TagList::iter_tag_list_simple() for getting a single value per tag 2018-10-28 13:46:28 +00:00
Sebastian Dröge ad62d08d65 Implement Display for Caps and TagList 2018-09-28 19:14:35 +03:00
Sebastian Dröge 6fd0ed4cb3 Move all minobjects to newtype wrapper types
For consistency with external crates and to help rustdoc, which gets
confused on impl blocks for type aliases.
2018-09-28 18:11:46 +03:00
François Laignel 0eb6bcf0c0 serde: restrain unneeded visibilities 2018-07-30 23:18:30 +03:00
François Laignel 23307a4795 Tags: ser/de: gather tags with the same name together 2018-07-30 23:18:30 +03:00
François Laignel 90b046fbcf serde: separate serde impl and tests from base module
+ fix erroneous `datetime` instead of `buffer` in `BufferRef::serialize`
+ remove ser/de for `Value`s with types `ULong` & `ILong`
2018-07-30 23:18:30 +03:00
François Laignel 20834e475b Tags: serde impl 2018-07-30 23:18:30 +03:00
Sebastian Dröge 33a6aab6d7 Run everything through latest rustfmt 2018-07-27 13:36:40 +03:00
Sebastian Dröge 632d5f4c57 Change some empty structs to empty enums
These should only really exist at the type-level.
2018-07-25 10:07:20 +03:00
Sebastian Dröge 93b32882ee tags: Use to_glib_none() to convert &str to a C string instead of as_ptr()
The latter does not necessarily give us a NUL-terminated string.

Fixes https://github.com/sdroege/gstreamer-rs/issues/122
2018-07-23 10:17:38 +03:00
Sebastian Dröge 694bcaa697 Fix all clippy warnings
Or silence the ones we don't care about.
2018-07-20 10:28:20 +03:00
François Laignel 02a8e9faa0 Tags: more and better getters/adder factorizations 2018-07-12 07:22:39 +02:00
François Laignel 7ca54cf1c5 Tags: factorize get_index unsafe code 2018-07-12 07:22:39 +02:00
François Laignel 0b9edee8d7 Tags: use SendValue for generic getters and iterator 2018-07-12 07:22:39 +02:00
François Laignel be9ef0d152 Tags: implement generic iterators
This is the continuation of PR #107 by @ystreet
2018-07-12 07:22:39 +02:00
Matthew Waters 2e1f1eadac tags: add dynamic tag retrieval based on string's and Value's
The rust compiler won't complain if you use the wrong types with the
dynamic getter/adder however GStreamer itself does.
2018-07-12 07:22:39 +02:00
Matthew Waters fa054fe3b0 gst/tags: combine the static tag references into the impl_tag macro
There's no real reason to have them separate when there's already a
macro making types for different tags.
2018-07-12 07:22:39 +02:00
Sebastian Dröge 2cefd9aea6 Re-run everything through rustfmt 2018-04-25 11:13:14 +03:00
Sebastian Dröge 492c3d656c Run everything through rustfmt again 2018-04-01 11:57:58 +03:00
Sebastian Dröge 4117c01ff2 Run everything through latest rustfmt-nightly 2018-02-22 11:18:37 +01:00
Sebastian Dröge e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +02:00
Sebastian Dröge e6da3554ee Use ClockTime for the Duration tag
And implement the Value traits for ClockTime
2017-12-05 22:54:03 +02:00
Sebastian Dröge 411f54afed Run everything to rustfmt again 2017-12-01 19:02:53 +02:00
Sebastian Dröge fccb1eca5e Implement fmt::Debug more consistently for miniobjects and various other types 2017-12-01 11:34:01 +02:00
Sebastian Dröge b198ee21da Let Sample::new(), TagList::add(), Structure::set() and others take more values by reference instead of by value 2017-11-27 14:34:02 +02:00
Sebastian Dröge 52d13c010a Add TagListRef::merge() and ::insert() 2017-11-27 14:03:33 +02:00
Sebastian Dröge 0629a0283e Use SendValue instead of Value for all our GValue usage
We require types that can be sent between threads.
2017-11-15 20:32:52 +02:00
Sebastian Dröge e1d134c4be Run everything through latest rustfmt-nightly 2017-10-17 12:06:51 +03:00
Sebastian Dröge 85b335fd89 Fix/hide various clippy warnings in gstreamer 2017-09-10 15:21:26 +03:00
Sebastian Dröge 380fb319ba Don't return &'static references from functions but give them a generic lifetime
https://github.com/rust-lang/rust/pull/42417#issue-233404573
2017-09-01 11:40:32 +03:00
Sebastian Dröge f0935d7e1e Add remaining gst_init() assertions 2017-08-30 14:39:09 +03:00
Sebastian Dröge 7991b4d8eb Don't export tag name strings directly
They can be accessed via the Tag trait impls instead
2017-08-17 12:49:58 +03:00