Commit graph

79 commits

Author SHA1 Message Date
Guillaume Gomez
a3f6f710a9 tutorials/basic-tutorial-13: Add "\r" at each println to fix the raw terminal display 2021-01-09 16:08:06 +01:00
Guillaume Gomez
2fcaaa53ce Add basic tutorial 13 from C gstreamer examples 2021-01-08 15:49:30 +01:00
Sebastian Dröge
d84336dc12 tutorials/basic-tutorial-5: Don't unnecessarily cast float literals to f64
error: casting float literal to `f64` is unnecessary
   --> tutorials/src/bin/basic-tutorial-5.rs:141:13
    |
141 |             1.0 as f64,
    |             ^^^^^^^^^^ help: try: `1.0_f64`
    |
2020-12-29 16:56:13 +02:00
Fernando Jiménez Moreno
dfa3812ccc Playback tutorial 4: Progressive streaming 2020-12-16 11:10:51 +00:00
Marijn Suijten
5afca49a7b gstreamer: Propagate nullability changes into manual code 2020-12-04 19:37:07 +01:00
Sebastian Dröge
a6c8fe0c8a Use repr(transparent) where it is more correct and get rid of some unneeded repr(C) 2020-10-24 17:09:10 +00:00
Sebastian Dröge
ad1d78b599 examples: Move to Rust 2018 edition 2020-10-10 11:00:48 +03:00
Sebastian Dröge
096ce958a4 tutorials: Move from failure to anyhow 2020-10-10 10:52:15 +03:00
Sebastian Dröge
fb779b42a8 Use glib::timeout_add_local() instead of removed gtk::timeout_add() 2020-08-27 09:49:27 +03:00
Guillaume Gomez
6752ef8a69 tutorials: Add resample element to the pipeline in tutorials 3 2020-07-10 11:12:38 +02:00
Guillaume Gomez
7d28106c2e tutorials: Improve code of tutorial 3 a bit by removing unneeded downgrades and
using closure parameters instead of capturing variables
2020-07-10 11:12:36 +02:00
Sebastian Dröge
9cc99b27e0 gstreamer/element: Let post_message() and post_error_message() take ownership of the message
This is more in line with the C API and simplifies callers in Rust.
2020-06-30 23:55:02 +03:00
Sebastian Dröge
947ac8db5c Name functions returning a builder builder(), not new()
And also make the video event API more consistent with the normal event
API.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/269
2020-06-25 19:42:33 +03:00
François Laignel
c94baa4fe8 query: add constructor on target types
... and deprecate the `Query::new_*` forms.
2020-06-25 10:48:25 +02:00
François Laignel
f421d878b6 message: add constructor on target types
... and deprecate the `Message::new_*` forms.
2020-06-25 10:48:20 +02:00
Sebastian Dröge
bfde1fd9d5 Update for new_with_XXX/new_from_XXX function renaming 2020-06-16 11:45:12 +03:00
alleynb
86e6d3afa4 tutorials/tutorial-6: Improve caps output
Fixed printing of pad capabilites in tutorial6.
Output now displays the capability lists eg:
  layout:{ (string)interleaved, (string)non-interleaved }

The origional broken output was being displayed as:
  layout:SendValue(Value(GString(Foreign(0x557140c99d00, 40))))
2020-04-21 12:01:41 +01:00
Sebastian Dröge
be3c378f28 Use Results instead of Options where they signal an error instead of just a missing value
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 22:21:28 +02:00
Tony Jinwoo Ahn
c3b7f0f353 gstreamer-gl, gstreamer-pbutils, gstreamer-sdp: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 08:20:47 +00:00
François Laignel
514a05accd Manual update for new Value::get signature 2019-08-13 10:57:32 +02:00
Sebastian Dröge
f7cf709062 tutorials/basic-tutorial-5: Make sure to only declare GDK C functions for the right platform
Otherwise linking might fail depending on the compiler flags if the
linker does not remove all references to unused code.
2019-07-06 02:38:58 +03:00
Sebastian Dröge
6cef32a4dd Change various mini object references to references to the refcounted object
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/204
2019-05-24 10:04:16 +00:00
Sebastian Dröge
a986914bad Use Option<&T> instead of &Option<T> everywhere
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/203
2019-05-22 23:27:13 +03:00
Sebastian Dröge
8618085d46 Port examples/tutorials to the explicit Option parameter changes 2019-04-15 19:19:19 +03:00
Sebastian Dröge
86a31b4139 Silence/fix various clippy warnings 2019-03-07 14:05:35 +02:00
Sebastian Dröge
8c39da4e5b Update to Rust 1.31 linter-specific attributes 2019-03-04 15:16:01 +02:00
Víctor Manuel Jáquez Leal
066b22efc5 Fix examples and tutorial with GTK API updates 2019-02-28 12:02:51 +01:00
Sebastian Dröge
95f6844702 Fix various minor clippy warnings 2019-02-21 19:56:23 +02:00
Sebastian Dröge
b4ad105c1d basic-tutorial-5: Stop using deprecated GTK API
Disabling double buffering is deprecated since quite a while.
2019-02-07 10:26:37 +02:00
François Laignel
333d71f92b Update functions returning bool to use Result<(), glib::BoolError>
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/171
2019-01-17 23:13:44 +01:00
Sebastian Dröge
931c485150 Update manual code for glib API changes 2019-01-16 13:52:56 +02:00
François Laignel
948fb2ae4b Replace XXXReturn with Result<XXXSuccess, XXXError>
... in function signatures.

These breaking changes aim at improving usability by allowing users
to take advantage of Rust error management features sur as `ok_or`,
`map_err`, `expect` and the `?` operator. See the `examples` and
`tutorials` to get an idea of the impacts.
2019-01-11 18:33:04 +01:00
Philippe Normand
bef6d741d3 Fix examples and tutorials for GString support 2019-01-03 22:01:41 +00:00
Sebastian Dröge
69af6a5975 bus: Add iter() and iter_timed() that return Iterators around the corresponding pop() functions
And make use of them in the examples where it makes sense.
2018-12-28 00:06:03 +02:00
Sebastian Dröge
890b47eef9 Fix up some error handling in basic-tutorial-12
And minor code cleanup
2018-12-04 11:14:03 +02:00
Tony Jinwoo Ahn
b9fa4870ad Add basic-tutorial-12
Add basic-tutorial-12 from the GStreamer tutorials
2018-12-04 08:52:10 +00:00
Sebastian Dröge
352f1c80d4 Run everything through rustfmt 2018-11-03 20:28:58 +02:00
Charlie Turner
98c69609cc Cturner/add tutorial 9 (#142)
Add basic-tutorial 9
2018-10-31 23:43:04 +02:00
Sebastian Dröge
eb0a804a50 Run everything through latest rustfmt 2018-10-08 15:02:23 +03:00
Sebastian Dröge
2c7dff3b45 Run everything through rustfmt again 2018-10-08 09:32:08 +03:00
Sebastian Dröge
33a6aab6d7 Run everything through latest rustfmt 2018-07-27 13:36:40 +03:00
Sebastian Dröge
8f9c0a72e0 Get rid of all usage of send-cell 2018-07-27 13:25:47 +03:00
Sebastian Dröge
c0422acf66 Fix reference cycles and minor related problems in all examples and tutorials
These are now all leak-free.
2018-07-27 13:07:24 +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
Sebastian Dröge
8d0a0ee6b1 Directly use byte-slice-cast on the mapped buffer
No need to first get a byte slice from it anymore due to the buffer map
implementing AsRef/AsMut for byte slices
2018-06-01 11:55:13 +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