Commit graph

15 commits

Author SHA1 Message Date
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
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
François Laignel c971727193 Query: allow concrete query instantiation
Allow instantiating and dereferencing concrete queries. The motivation
for this proposal is to allow the following usability enhancements:

- Concrete queries mutability guaranteed by the borrow checker,
including for generic functions:
``` rust
    let mut p = Query::new_position(::Format::Time);
    p.get_mut_structure().set("check_mut", &true);
```

- Concrete queries functions available in place:
``` rust
    let mut q = gst::Query::new_duration(gst::Format::Time);
    let duration = if pipeline.query(&mut q) {
        Some(q.get_result())
    } else {
        None
    };
```
2018-02-16 10:33:40 +02:00
fengalin ce28fed070 Tutorials: message handlers: invoke generic Message method from the concrete message
Generic methods for events, messages and queries can now be invoked from the concrete type.
2018-01-29 17:33:49 +02:00
Sebastian Dröge e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +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 f895f484cc Fix up tutorials and examples for Message::get_src() returning an Option now 2017-11-16 13:58:56 +02:00
Kornel 10151b9f0d tutorials: Set up a runloop on macOS
Fixes https://github.com/sdroege/gstreamer-rs/pull/62
Fixes https://github.com/sdroege/gstreamer-rs/issues/58
2017-11-12 18:58:15 +01:00
Sebastian Dröge 246a54368d Clean up Query API a bit
There's now get_result() instead of get(), and separate getters for only
getting the constructor arguments of each query (otherwise query
handlers will get useless values when trying to answer a query).
2017-11-11 12:27:30 +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 b773c0b46a Fix compilation again now that GstRc::get_mut() requires &mut self again 2017-10-11 15:39:27 +03:00
Thijs Vermeir f253caac19 Add basic-tutorial-4 from the GStreamer tutorials
https://cgit.freedesktop.org/gstreamer/gst-docs/tree/examples/tutorials/basic-tutorial-4.c

Fixes https://github.com/sdroege/gstreamer-rs/pull/39
2017-10-11 11:29:35 +03:00