Commit graph

20 commits

Author SHA1 Message Date
Sebastian Dröge 9b6efb2339 Fix various clippy warnings 2017-12-20 21:46:58 +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
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 884c9790ef Fix compilation of GTK examples with latest gio 2017-10-01 16:32:33 +02:00
Sebastian Dröge d608cff9e9 Fix build with latest GApplication API changes 2017-09-26 10:41:03 +03:00
Sebastian Dröge 58998af124 Fix examples build again 2017-08-29 11:56:30 +03:00
Sebastian Dröge 8013169e09 Add constants for SECOND, MSECOND, USECOND, NSECOND
And use them in the examples.
2017-08-29 11:07:59 +03:00
Sebastian Dröge 0bc43ed053 Make gtk dependency optional in the examples 2017-08-17 18:07:48 +03:00
Sebastian Dröge f751afc0fb Add prelude modules to all cratest that only re-export the traits
And use those in the examples instead of blanket * imports
2017-08-17 18:02:25 +03:00
Sebastian Dröge 5cd94a279e Minor simplification in gtksink example 2017-08-07 18:59:44 +03:00
Sebastian Dröge 8accac8d75 Clean up gtksink example imports a bit 2017-08-07 14:18:24 +03:00
Sebastian Dröge be6f03a1af Use SendCell from the newly created crate 2017-08-04 22:57:12 +03:00
Sebastian Dröge 43a014b6fa Add into_inner() / try_into_inner() functions for SendCell 2017-08-04 20:23:51 +03:00
Sebastian Dröge 5676aeb3ef Add a borrow() function to SendCell
To allow doing the thread check only once for performance reasons.
2017-08-04 19:56:39 +03:00
Sebastian Dröge c23498039d Clean up SendCell implementation and implement some more traits
For moving it elsewhere later as public API.
2017-08-04 18:31:54 +03:00
Sebastian Dröge 0dcf9c2be7 Move gtksink example to GtkApplication
And have an example for using GTK objects from closures that require Send
2017-08-04 17:42:08 +03:00
Sebastian Dröge e55c7d4088 Rename ObjectExt trait to GstObjectExt
This works around a bug in the compiler with multiple traits having the
same name, but being re-exported with a different one.

https://github.com/gtk-rs/glib/issues/211
2017-08-01 14:04:42 +01:00
Sebastian Dröge 03285a6311 Run everything through latest rustfmt-nightly 2017-07-31 12:16:42 +01:00
Sebastian Dröge d0ac8b7fd3 Add gtksink example 2017-07-31 12:09:59 +01:00