The following code in a `[test]`:
``` rust
let info = Structure::builder("sample.info")
.field("f3", &123i32)
.build();
let sample = Sample:🆕:<GenericFormattedValue>(
None,
None,
None,
Some(info.as_ref())
);
```
generates one of the followings executing `cargo test`:
```
- segmentation fault
- signal: 6, SIGABRT: process abort signal
- signal: 11, SIGSEGV: invalid memory reference
```
This is due to `ffi::gst_sample_new` expecting to take ownership of the `info`
`Structure`.
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.