Commit graph

231 commits

Author SHA1 Message Date
Sebastian Dröge
911bb34dc2 Don't generate LAST/NONE variants of flags types
Those are automatically provided already.
2020-06-30 11:35:49 +03:00
Sebastian Dröge
af01f1bc67 gstreamer: Simplify MiniObject bindings by removing one layer of abstraction
And instead directly implementing this via the macro on the target
types.
2020-06-30 11:06: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
884e5e4e4a event: add constructor on target types
... and deprecate the `Event::new_*` forms.
2020-06-25 10:48:25 +02:00
Sebastian Dröge
bfde1fd9d5 Update for new_with_XXX/new_from_XXX function renaming 2020-06-16 11:45:12 +03:00
Guillaume Desmottes
a954c03bc0 functions: rename constructors in manual API
The idiomatic way for Rust constructors is to be named from_XXX()
instead of new_from_XXX() and with_XXX() instead of new_with_XXX().

Fix #460
2020-06-11 12:33:52 +02:00
Guillaume Desmottes
6cd711cfdf subclass: clean up subclassing prelude/re-exports
Use re-export pattern from glib.

Fix #255
2020-06-09 14:36:37 +02:00
Sebastian Dröge
30d51f0ca6 video: Don't panic when passing an invalid video info to VideoMeta::add()
Instead return an error that can be handled by the caller.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/259
2020-06-07 18:58:54 +03:00
Sebastian Dröge
9b4117ea71 examples: Add an example that registers a custom GstMeta and makes use of it
The meta contains a Rust String as a label for the buffer. It is added
on buffers passed into an appsrc and retrieved from the buffers provided
by an appsink.
2020-06-04 12:07:05 +03:00
Jan Schmidt
6c876a5681 examples: Add a VideoOverlayComposition example
Replicate the pango-cairo cairooverlay example, but
drawing into a gst::VideoOverlayComposition using the
overlaycomposition element.
2020-05-29 02:58:47 +10:00
Jan Schmidt
dd226e80f8 Add an example of setting up the VideoConvert API
Configure some custom cropping / scaling of a video frame
input to compositor via the converter-config property
and gst_video::VideoConverterConfig API.
2020-05-29 02:58:47 +10:00
Jan Schmidt
637a1ca670 examples: Add a custom event example.
Add an example of constructing and parsing a custom event using
a rust helper struct, and sending them / catching them in
a pipeline.
2020-05-29 02:58:47 +10:00
Otavio Salvador
2022890766 examples: Move out from 'failure' crate as it is deprecated
The 'failure' crate has been stale for quite some time and better
alternatives has been developed since its introduction. We choose the
'anyhow' and 'derive_more' to replace it.
2020-05-04 11:16:50 -03:00
Otavio Salvador
6fc70ee6b6 examples: Move to 2018 edition
This code rework the examples to use the new 2018 edition and also
rework the code to avoid using unnecessary 'extern crate' calls.

The 'use extern crate gstreamer as gst', as well as the other gstramer
related crates, were kept, otherwise we'd need to do it on 'Cargo.toml'
but it would make it more difficult to figure out the respective crate
name.
2020-05-03 18:42:57 -03:00
Vikram Fugro
0ca6be25c5 examples: remove the use of description() in Error
Replace the use of deprecated method "Error::description()"
with to_string() method
2020-04-01 17:30:17 +03:00
Sebastian Dröge
ca6bcf36ab examples: Stop using deprecated Error::description() 2020-03-19 14:20:52 +02:00
Sebastian Dröge
d0bfdda97f examples: Update for new GLib boxed deriving API 2020-03-19 14:20:52 +02:00
Sebastian Dröge
7e989631f8 rtsp_server: Add example making use of subclassing RTSPMediaFactory and RTSPMedia 2020-02-24 11:41:35 +02:00
Sebastian Dröge
7230aee069 Switch everything from lazy_static to once_cell::Lazy
Fewer macros, faster compile-time and the Lazy type will likely end up
in the standard library in a similar form to this.
2020-01-22 19:57:41 +02:00
Sebastian Dröge
b17f04e866 bus: Make bus Stream private and add functions on the bus directly for it
Also add a helper function that allows filtering the stream directly.
2020-01-22 10:05:36 +02:00
Sebastian Dröge
69be1ce2fc Fix various new clippy warnings from 1.40 2019-12-22 12:10:27 +02:00
Sebastian Dröge
d26ffc2c21 Update version to 0.16.0 2019-12-19 00:48:08 +02: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
3e3c5205db gstreamer-video/video_info: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-15 08:36:56 +00:00
Tony Jinwoo Ahn
c563fb6f44 gstreamer-audio/audio_info: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-14 14:10:06 +00:00
Sebastian Dröge
77c6741ae0 Update to futures 0.3 and require Rust 1.39
Also use async/await in the futures examples.
2019-11-11 12:18:49 +01:00
Sebastian Dröge
ccd01b93bf examples: Add an example for subclassing and providing Rust API on the subclass 2019-10-30 16:07:23 +01:00
Jordan Petridis
dc3a039a3b
Add license key for tutorials and examples 2019-10-22 16:36:32 +03:00
Sebastian Dröge
7ab4e8dafd examples: Update gl_generator dependency to 0.14 2019-10-04 09:30:51 +00:00
Sebastian Dröge
107ae588f2 examples: Fix various clippy warnings 2019-10-04 11:01:55 +03:00
Sebastian Dröge
06cfcd57fc Move to_string() methods into the Display trait or rename to to_str(), move from_string() into the FromStr trait
Fixes clippy warnings, prevents confusing errors and is more consistent.

The Display trait provides a to_string() method by itself and FromStr
provides from_str().
2019-10-04 11:01:55 +03:00
Sebastian Dröge
52509b4b95 Remove subclassing feature and make it the default 2019-09-09 11:51:07 +03:00
Sebastian Dröge
ea367bac14 Fix or ignore various clippy warnings
And ignore some common warnings we don't care about in general, while
also making clippy errors fail the build.
2019-09-07 19:39:19 +03:00
Sebastian Dröge
39ef834cfe examples: Fix compilation after GValue API changes 2019-08-13 18:30:40 +03:00
François Laignel
514a05accd Manual update for new Value::get signature 2019-08-13 10:57:32 +02:00
Sebastian Dröge
1eb5525a27 Update array-init to 0.1 and gl_generator to 0.13 2019-07-24 14:23:15 +03:00
Sebastian Dröge
d8325212f4 Fix various clippy warnings 2019-07-11 22:02:01 +03:00
Sebastian Dröge
3a8d05075d Switch everything from mem::uninitialized() to MaybeUninit or mem::zeroed()
And also fix a few cases where mem::uninitialized() was simply wrong to
use.
2019-07-11 17:56:50 +03:00
Sebastian Dröge
04ed22a356 examples/futures: Use future::pending() instead of future::empty()
It was renamed in the last release.
2019-07-06 09:56:34 +03:00
Sebastian Dröge
39ea788835 examples/gtkvideooverlay: 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
28a24a4fc0 Update versions to 0.15.0 2019-06-24 20:53:05 +03:00
Sebastian Dröge
d44c293753 Use TryFrom/TryInto traits where it makes sense instead of our previous ad-hoc solutions 2019-06-03 18:42:34 +03:00
Sebastian Dröge
4096869075 Update byte-slice-cast to 0.3 2019-05-24 13:26:49 +02:00
Sebastian Dröge
86e969d964 Remove various Into<Option<_>> trait bounds from functions
In autogenerated code these were already replaced but some manual code
still kept them.
2019-05-24 10:04:16 +00: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
5f1a50026d Update futures code to futures 0.3
Also clean it up a bit.
2019-05-02 21:35:12 +03:00
Sebastian Dröge
2b122a20c5 examples/glupload: Fix segmentation fault by ensuring the glutin context stays alive longer than the GStreamer GL display
Otherwise the GL display might still use a Wayland display that is
already freed.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/196
2019-04-29 15:43:51 +03:00
Sebastian Dröge
4af06f0dd2 examples/glupload: Clean up considerably and port to glutin 0.21 2019-04-24 16:07:15 +03:00
Sebastian Dröge
044e3985a3 Update dependencies 2019-04-24 09:45:56 +03:00