Commit graph

80 commits

Author SHA1 Message Date
Sebastian Dröge
451c198cec Run everything through cargo fmt again 2020-04-30 11:01:25 +03:00
Guillaume Gomez
a58cd4b5bc Manual code fixes 2019-11-11 11:34:09 +01:00
Sebastian Dröge
3a8d05075d Switch everything from mem::uninitialized() to MaybeUninit or mem::zeroed()
And also fix a few cases where mem::uninitialized() was simply wrong to
use.
2019-07-11 17:56:50 +03:00
Sebastian Dröge
d1e562b9f6 Explicitly add dyn keyword to trait objects
Trait objects without are deprecated with the latest nightly and this
makes it more clear that we're doing dynamic dispatch anyway.
2019-06-06 09:09:34 +03:00
Vivia Nikolaidou
05d936fcee gstreamer: Add binding for GstMessageType and gst_bus_timed_pop_filtered
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/168
2019-05-10 19:35:13 +03:00
Sebastian Dröge
b2b8bfab52 Add manual implementations for various new 1.16 functions 2019-04-23 20:45:39 +03:00
Sebastian Dröge
54705f959a message: DeviceAdded/Removed getters are transfer full 2019-04-23 20:45:39 +03:00
Sebastian Dröge
e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge
8c39da4e5b Update to Rust 1.31 linter-specific attributes 2019-03-04 15:16:01 +02:00
Sebastian Dröge
cc3c3876ab Implement Debug for EventView and MessageView 2019-01-22 16:55:59 +02:00
Sebastian Dröge
36bcb5630a Remove various unused use statements 2018-12-08 14:58:14 +02:00
Sebastian Dröge
fb0178a4f2 Call gst::init() in message::test_other_fields() test at the beginning 2018-11-03 20:15:27 +02:00
Sebastian Dröge
eb0a804a50 Run everything through latest rustfmt 2018-10-08 15:02:23 +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
Sebastian Dröge
a43c78f2c5 Run everything through rustfmt 2018-09-28 13:15:18 +03:00
Sebastian Dröge
33a6aab6d7 Run everything through latest rustfmt 2018-07-27 13:36:40 +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
Thibault Saunier
2962f186f7 Print pointer value when formatting debug strings 2018-05-14 09:22:25 +03: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
François Laignel
406eb119d3 message: add test_other_fields
Fixes https://github.com/sdroege/gstreamer-rs/pull/93
2018-03-19 10:32:07 +02:00
Sebastian Dröge
0112d22804 Various manual 1.14 API additions and remove deprecated functions 2018-03-19 10:32:07 +02:00
Sebastian Dröge
4117c01ff2 Run everything through latest rustfmt-nightly 2018-02-22 11:18:37 +01:00
fengalin
da924e5d4d Event & Message: factorize common attributes in generic builders
Concrete events and messages share common attributes which can be factorized in generic builder `struct`s. This reduces noise in the concrete implementations.
2018-01-29 17:33:49 +02:00
fengalin
2d1218e6d6 Event, Message & Query: allow dereferencing concrete types to access generic type methods
Implement `deref` for concrete derivatives of `Event`, `Message` and `Query`. This allows accessing generic methods such as `is_sticky` for events, `get_seqnum` for messages or `is_serialized` for queries and `get_structure` for all.
2018-01-29 17:33:49 +02:00
fengalin
86812c1a53 MessageBuilder: comment out other_fields related methods until GStreamer v1.14 is released
These methods are commented out in order to maintain consistency between messages with and without arguments. It will be restored and conditioned to feature "v1_14" when GStreamer v1.14 is released.
2018-01-29 10:07:42 +02:00
fengalin
3c65a50076 Fix building argument-less messages
Building an argument-less message such as eos yields an assertion failure due to the inner structure being null. The short term solution consists in checking that the inner `structure` is not `null` before attempting to insert `other_fields`. The consequence is that `others_fields` defined for argument-less messages will be ignored. A correction will be applied when GStreamer 1.14 is released thank to the introduction of `gst_message_writable_structure` (see https://bugzilla.gnome.org/show_bug.cgi?id=792928). Due to the dependency on GStreamer 1.14, the correction will be only available under the activation of a feature "v1_14".

Events are not affected as the build method the availability of `gst_event_writable_structure` and this function "will never return NULL". However, we can avoid a `structure` allocation for argument-less messages without `other_fields`.
2018-01-29 10:07:42 +02:00
Sebastian Dröge
9b6efb2339 Fix various clippy warnings 2017-12-20 21:46:58 +02:00
Sebastian Dröge
e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +02:00
Sebastian Dröge
62058ab1c3 Use &ToSendValue for the stream-status stream_object in the builder 2017-12-16 18:39:50 +02:00
Sebastian Dröge
ccf6c1a632 Owner of structure-change and stream-status messages is mandatory 2017-12-16 18:39:33 +02:00
Sebastian Dröge
bcf6b34c1b Code/text of progress messages is mandatory 2017-12-16 18:38:53 +02:00
Sebastian Dröge
974e681a5d Move optional taglist/entry_struct fields into the Redirect builder from the constructor 2017-12-16 18:13:25 +02:00
Sebastian Dröge
7bc1fce97d Move value for PropertyNotification message into the builder instead of constructor 2017-12-16 18:10:10 +02:00
Sebastian Dröge
b9c4e4cd6e Allow no value for the PropertyNotify message
It can contain no value.

Also use &ToSendValue instead of an actual value for building the
message.
2017-12-16 15:37:06 +02:00
Sebastian Dröge
c99928d030 Change FormatValue related API to be more convenient to use
FormatValue is now renamed to GenericFormattedValue and the API slightly
changed. In addition there is now a FormattedValue trait, and a
SpecificFormattedValue trait plus types for Bytes, Buffers and the
existing ClockTime.

This allows to create functions like
  Pad::query_duration<F: SpecificFormattedValue>() -> Option<F>
and doesn't require the caller to unwrap the generic value anymore,
which is completely unneeded in these cases.

In addition, Segment became FormattedSegment<T> with API to
upcast/downcast between the specific formatted values and the generic
formatted value. This greatly simplifies usage of Segments.
2017-12-09 19:45:18 +02:00
Sebastian Dröge
f1c6c4fd06 Change various integers to FormatValue and ClockTime in events/queries/messages 2017-12-05 22:43:37 +02:00
Sebastian Dröge
55f044dd83 Add newtype wrappers and INVALID constants for event/message GroupId and Seqnum 2017-12-05 21:33:04 +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
c57d5523d2 Implement ToOwned for Message/Event/QueryRef 2017-12-01 11:34:01 +02:00
Sebastian Dröge
1576ff6c32 Event/Message::get_structure() can return None 2017-12-01 11:33:21 +02:00
Sebastian Dröge
2508f432f4 Remove some unneeded lifetime annotations 2017-11-27 14:03:33 +02:00
Sebastian Dröge
1dbc63dcb3 Message::get_src() can return None
The src is optional
2017-11-16 13:58:42 +02:00
Sebastian Dröge
7eb8429046 Run everything through latest rustfmt-nightly again 2017-11-15 22:33:51 +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
d4bd1c2d76 Add dox feature to everything as needed 2017-11-12 13:33:02 +01:00
Sebastian Dröge
c39c0c7264 Implement ClockTime as ClockTime(Option<u64>)
And also implement a FormatValue type that holds a value together with
its format to make usage of the positions/durations/seek positions/etc
more convenient and safe.

Fixes https://github.com/sdroege/gstreamer-rs/issues/3
2017-11-11 11:57:29 +01:00
Sebastian Dröge
e1d134c4be Run everything through latest rustfmt-nightly 2017-10-17 12:06:51 +03:00
Sebastian Dröge
de10335167 Allow creating Error/Warning/Info messages only from specific kinds of glib::Error domains 2017-09-15 18:35:54 +03:00