Commit graph

39 commits

Author SHA1 Message Date
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 9a3ef2e9f1 Regenerate with latest GIR and update for the non-bitflags flags in -sys now 2018-04-04 10:47:12 +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
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 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 e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +02:00
Sebastian Dröge fa05ee7b08 Various fixes for nullability in the event bindings
The origin in protection events is optional, the stream id in
stream-start events is not.

Also return a segment reference instead of a segment copy when parsing a
segment event.
2017-12-16 17:30:50 +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 801a7ed43c Use ClockTime instead of u64 for the Gap event 2017-12-05 21:36:56 +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 88ff4289d1 Add Event::set_running_time_offset() 2017-12-03 17:13:46 +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 7342a0fb98 Implement some functions on EventType and implement PartialOrd for serialized events 2017-11-29 18:55:56 +02:00
Sebastian Dröge 2508f432f4 Remove some unneeded lifetime annotations 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 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 499ca3eff3 Also implement Sync+Send for Event and Message 2017-09-14 15:52:40 +03:00
Sebastian Dröge 608279c6d4 Fix various clippy warnings 2017-09-13 23:54:22 +03:00
Sebastian Dröge 17cce1a3d7 Add support for setting custom fields in message/events during construction 2017-09-13 22:38:19 +03:00
Sebastian Dröge 85b335fd89 Fix/hide various clippy warnings in gstreamer 2017-09-10 15:21:26 +03:00
Sebastian Dröge dae1a51764 Work around rustdoc bug with impls on type aliases
https://github.com/rust-lang/rust/issues/44182
2017-08-30 15:12:11 +03:00
Sebastian Dröge f0935d7e1e Add remaining gst_init() assertions 2017-08-30 14:39:09 +03:00
Sebastian Dröge 14adb331ec Implement StaticType on the actual MiniObjects, not the GstRc wrapper 2017-08-18 16:21:49 +03:00
fengalin 04f09ebc86 Add bindings for GstToc/TocSetter
https://github.com/sdroege/gstreamer-rs/pull/22

Fixes https://github.com/sdroege/gstreamer-rs/issues/10
2017-08-09 19:38:39 +03:00
Sebastian Dröge d7baadee22 Fix various other compiler/clippy warnings 2017-08-02 20:09:00 +03:00
Sebastian Dröge 09db28bbf5 Fix various clippy warnings 2017-08-02 19:40:31 +03:00
Sebastian Dröge 03285a6311 Run everything through latest rustfmt-nightly 2017-07-31 12:16:42 +01:00
Sebastian Dröge f06bc0d6ef Add event example and clean-up event/message constructor API 2017-07-30 15:49:25 +01:00
Sebastian Dröge 70a98cdc59 Fix compilation of 1.10 API 2017-07-30 15:15:34 +01:00
Sebastian Dröge 35160bedbc Add support for Events in pad probes 2017-07-30 15:11:47 +01:00
Sebastian Dröge 2c949a9a05 Add Event bindings
And make Message bindings more consistent
2017-07-30 15:06:44 +01:00