Commit graph

370 commits

Author SHA1 Message Date
Sebastian Dröge 53aae7ddba Remove gst_ prefix from all macros except for the logging macros
The latter stay e.g. gst_debug! to be more clear and not conflict with
e.g. the debug! macro from the log crate.
2020-12-20 19:40:34 +02:00
Sebastian Dröge ce1148b474 Update everything for glib macro renamings 2020-12-18 00:56:47 +02:00
Sebastian Dröge f3b5340875 Update for new simplified glib::Object::new() API 2020-12-17 17:43:17 +02:00
Guillaume Gomez fb56af8d84 Update from_glib calls and put them in unsafe blocks 2020-12-08 15:50:15 +01:00
Marijn Suijten 9ff39bae6f audio,video: Use autogenerated Display impl 2020-12-07 12:12:16 +01:00
Marijn Suijten 75bcc8402d example/glupload: Update to separated GL windowing crates 2020-11-28 11:15:22 +01:00
Sebastian Dröge 1b288add4c examples: Fix build 2020-11-22 19:15:21 +02:00
Sebastian Dröge 3d3bdf9aa3 gstreamer-rtsp-server: Make virtual methods take wrapper of type, not parent 2020-11-14 19:39:27 +02:00
Sebastian Dröge 145f0ed6f5 gstreamer-base: Make virtual methods take wrapper of type, not parent 2020-11-14 19:39:27 +02:00
Sebastian Dröge 1d53b66858 Fix compilation with GLib subclassing changes 2020-11-14 19:39:27 +02:00
Sebastian Dröge be2f5c690b examples/rtsp-server-subclass: Fix some clippy warnings 2020-11-12 10:20:31 +02:00
Sebastian Dröge 447e53bcca examples: Update for simplified glib_wrapper! macro for subclasses 2020-11-05 16:41:48 +02: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 ba719ac90c Update for glib changes in glib::Value handling 2020-10-20 13:50:35 +00:00
Sebastian Dröge 5ad45cef42 examples: Rename crates in Cargo.toml and get rid of extern crate 2020-10-10 11:10:20 +03:00
Sebastian Dröge 9379098a3f examples/appsrc: Make use of the VideoFrame API for accessing the data
This is not really needed here but useful to have an example for the
videoframe API usage.
2020-10-03 17:55:36 +03:00
Sebastian Dröge da4efdfa90 examples: Update for glib API changes
Timeouts now use std::time::Duration instead of plain integers.
2020-09-14 16:44:46 +03:00
Sebastian Dröge 2ac5a68896 examples: Remove unused imports
Not required anymore after a fix in glib.
2020-09-01 09:53:09 +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
Jan Schmidt 2ead28defe examples: Add an example of using the debug ringbuffer
A simple example of using the GStreamer debug ringbuffer to only
dump logs on a specific event (in this case EOS).
2020-08-26 00:07:02 +10:00
Sebastian Dröge 9ffe2238a7 examples: Add example that creates a thumbnail of a given position in a stream using the image crate 2020-08-03 00:25:19 +03:00
Sebastian Dröge a426c03720 Fix various new clippy warnings 2020-07-28 14:13:22 +03:00
Sebastian Dröge 4f5b2f5060 Update for removal of ObjectImpl::get_type_data() 2020-07-26 18:02:05 +03:00
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 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
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 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 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 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 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 b2b8bfab52 Add manual implementations for various new 1.16 functions 2019-04-23 20:45:39 +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 e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Víctor Manuel Jáquez Leal 2a6343a671 Support Wayland display on glupload example 2019-04-10 19:08:12 +02:00
Víctor Manuel Jáquez Leal 4b3a011882 Support GLX on glupload example 2019-04-10 19:08:12 +02:00
Víctor Manuel Jáquez Leal 1e4d63d77f examples/glupload: Sync and wait for GL fence
Fixes: #192
2019-03-27 16:37:21 +01:00
Sebastian Dröge 811e8c1dba examples/glupload: Fix build with glutin API changes 2019-03-12 08:27:50 +01:00
Sebastian Dröge e0c0c7d417 examples/glupload: Fix build after glutin API changes
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/191
2019-03-07 14:05:35 +02: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
Víctor Manuel Jáquez Leal c378167573 glupload: panic if target OS is not Linux
For now this is the only OS supported by this test.
2019-02-28 12:02:51 +01:00
Víctor Manuel Jáquez Leal 07ddf2f370 glupload: update glutin API
GlWindow was dropped in favor of CombinedContext and ContextTrait

Fixes: #190
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
François Laignel e2d448f002 examples: fix ges warnings 2019-02-12 16:10:02 +01:00
Sebastian Dröge f2d79fb352 Make use of Bus::add_watch_local() 2019-02-10 12:06:40 +02:00
Sebastian Dröge d8085a5d79 Fix GES example
Some constructors are returning None now based on the annotations
2019-01-29 16:45:35 +02:00
Guillaume Desmottes 3f6424d2ac examples: playbin: show how to use debug_to_dot_file() 2019-01-28 15:53:07 +01: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 98d0bc01ac examples: Fix v1.10 feature build
GLib-rs macros are needed for this feature.
2019-01-03 22:01:41 +00: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
Víctor Manuel Jáquez Leal 2778f9c3fb examples: glupload example 2018-12-05 23:03:49 +01:00
Sebastian Dröge 237fd55a4a Remove left-over HELP comment from the GES example 2018-11-30 23:04:02 +02:00
Markus Ebner 466e02df3a Add verbose documentation to the examples
Added verbose documentation to all of the repository's examples.
2018-11-29 19:59:57 +01:00
Sebastian Dröge db6a6543b4 Update for some more glib-rs API changes 2018-11-29 00:22:43 +02:00
Sebastian Dröge ab626adc4a Use new GLib boxed-type definition feature for carrying Rust types over GStreamer error messages 2018-11-28 08:57:17 +02:00
Markus Ebner fbe6d5ce38 Add transmuxing example showing typefind, multiqueue and dynamic pad usage
This adds a usage example for the typefind and multiqueue elements, and dynamic pads.
2018-11-05 13:06:01 +01:00
Thibault Saunier 7360e50280 ges: Work around trait naming conflicts
Fixes #151
2018-11-04 16:55:33 -03:00
Thibault Saunier 8639aed456 Generate bindings for the GStreamer Editing Services 2018-11-04 11:35:54 -03:00
Sebastian Dröge 8a6bcbcedb Run through rustfmt once again 2018-10-28 13:47:02 +00: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 2d45d3840f Clean up imports a bit 2018-10-08 09:31:39 +03:00
Thiago Santos 382138b75a More encoding_profile binding improvements
- enable is_equal function again (unsure why it was disabled)
- remove restriction-caps property, encoding-profile objects are
immutable
- remove cast need by using IsA<EncodingProfile> in parameters and
returning the correct type of encodingprofile subclass from the build()
functions. It used a internal hack for storing those IsA objects in
order to keep the API clean and ready to be used, this should be sorted
out as soon as we figure out how to store them in the buidlers.
- encodebin example: remove Result error propagation when it is caused
by programming mistakes. A panic will happen in those cases.
- run rustfmt
2018-10-08 09:06:46 +03:00
Thiago Santos f3c8dfeb9b EncodingProfile: remove setters and constructors, use builders
Provide builders for the EncodingProfile so that the created objects are
imutable and can have the Send and Sync traits
2018-10-08 09:06:46 +03:00
Thiago Santos 861f052c3d encoding_profile: add builders for all types 2018-10-08 09:06:46 +03:00
Thiago Santos 67bdfee1f6 encodebin: add an example for encodebin usage 2018-10-08 09:06:46 +03:00
Sebastian Dröge 3119593292 Add pango-cairo example 2018-08-30 11:14:59 +03:00
Sebastian Dröge 06bd23f833 Fix compilation of iterator example 2018-08-13 23:46:22 +03:00
Sebastian Dröge 33a6aab6d7 Run everything through latest rustfmt 2018-07-27 13:36:40 +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 dc219af36e Add another comment to the appsrc example about the need-data callback not being mandatory 2018-05-18 11:42:24 +03:00
Sebastian Dröge 7734725da1 Change appsrc example to directly push data from the need-data callback
There's no need to start yet another thread just to push data in this
case, we can simply use the callback and store the frame counter in the
mutable environment of the closure.
2018-05-18 11:38:50 +03:00
Sebastian Dröge 5ef13a11b0 Fix compiler warning about too many parenthesis 2018-04-23 20:46:29 +03:00
Sebastian Dröge a4c3c7cd76 Add futures example using the GLib futures executor 2018-04-23 20:31:27 +03:00
Sebastian Dröge 4b4f369200 Rename tokio example to futures
It has nothing to do with tokio anymore with the newer futures version,
tokio would only come in if actual tokio API (e.g. for sockets) is used.
2018-04-23 20:27:51 +03:00
Sebastian Dröge 492c3d656c Run everything through rustfmt again 2018-04-01 11:57:58 +03:00
Sebastian Dröge cd95920436 Run everything through rustfmt 2018-03-02 21:06:45 +02:00
Thiago Santos c81e177cfb pbutils: add discoverer APIs
Fixes https://github.com/sdroege/gstreamer-rs/pull/84
2018-03-02 21:02:24 +02:00
Mathieu Duponchelle e6265341d5 Add rtsp-server-record example with authentication and TLS
Update the generated files to include TLS related functions,
override some auth and token functions.
2018-02-26 20:35:23 +02:00
Mathieu Duponchelle ab0df6ddf0 examples: use Cargo.toml required-features
This lets us avoid #ifdef forests
2018-02-26 20:35:23 +02:00
Mathieu Duponchelle 45bb8fe3e0 rtpfecserver example: mux-seq property was removed from rtpulpfecenc 2018-02-26 19:19:59 +02:00
Sebastian Dröge 4117c01ff2 Run everything through latest rustfmt-nightly 2018-02-22 11:18:37 +01:00
Mathieu Duponchelle 1fbc5e7644 examples: add rtpfec example
Fixes https://github.com/sdroege/gstreamer-rs/pull/73
2018-02-22 07:45:22 +01:00
Sebastian Dröge 828f639cc7 Fix unused import compiler warning in tokio example 2018-02-21 13:26:07 +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
Mathieu Duponchelle a00243d529 Add initial libgstsdp, libgstrtsp and libgstrtspserver bindings
Only automatic bindings for now, which is enough to allow
implementing a simple rtsp-server example.

Depends on https://github.com/sdroege/gstreamer-sys/pull/8

Uses a new gir feature proposed at
https://github.com/gtk-rs/gir/pull/539 to make doc regeneration
easier.

Fixes https://github.com/sdroege/gstreamer-rs/pull/80
2018-02-14 18:57:58 +02:00
fengalin 21c687f256 Examples: 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 f4da93aadb Add gst::TagSetter example 2017-12-24 14:49:56 +02:00
Sebastian Dröge 9b6efb2339 Fix various clippy warnings 2017-12-20 21:46:58 +02:00
Sebastian Dröge e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +02:00
Sebastian Dröge 396dae666f Make appsink/appsrc callbacks builder more consistent with other code
Move the constructor of the builder to the main type
2017-12-16 11:37:00 +02:00
Sebastian Dröge 49a6eb6a1f Replace AppSrcCallbacks/AppSinkCallbacks with a builder so that no empty closures have to be provided for unused callbacks 2017-12-10 15:19:44 +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 b198ee21da Let Sample::new(), TagList::add(), Structure::set() and others take more values by reference instead of by value 2017-11-27 14:34:02 +02:00
Sebastian Dröge b6d13272df Fix some clippy warnings in examples/tutorials 2017-11-27 14:03:33 +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 86b787ac81 Add failure-based error handling to the decodebin example
This also makes use of directly reporting errors from a callback, by
transferring it via the error message to the main thread.
2017-11-16 13:39:34 +02:00
Sebastian Dröge 4ab5893359 Allow to return something from the examples/tutorials main() wrapper 2017-11-12 20:11:25 +01:00
Sebastian Dröge a01f1385ec examples: Set up a runloop on macOS 2017-11-12 19:07:02 +01:00
Sebastian Dröge 1c0e802bc8 Remove utils module from examples
It's unused now
2017-11-12 10:15:54 +01:00
Sebastian Dröge c9027fb244 Switch appsrc example to failure based error handling 2017-11-12 10:15:37 +01:00
Sebastian Dröge eb99694ed3 Minor cleanup of appsink example 2017-11-11 16:56:37 +01:00
Sebastian Dröge 90700aa9b2 Switch appsink example to failure based error handling 2017-11-11 16:43:29 +01:00
Sebastian Dröge 126159c762 Run everything through rustfmt once again 2017-11-11 13:31:01 +01:00
Zeeshan Ali d18cbe5943 examples: More robust cli arg handling 2017-11-11 12:28:34 +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
Philippe Normand bdcf0246eb player example: Error management with the failure crate 2017-11-11 09:47:48 +01:00
Sebastian Dröge 95204c2294 Add Success/Error variants of #[must_use] enums
And implement basically the Try trait for them. This will be replaced by
the Try trait once it is stable.

Fixes https://github.com/sdroege/gstreamer-rs/issues/44
2017-11-06 11:43:54 +02:00
Sebastian Dröge 0f9241dbb6 Fix unused import compiler warning 2017-10-29 18:14:20 +02:00
Sebastian Dröge 50c8f32961 Clean up player example code a bit 2017-10-26 13:16:06 +02:00
Luis de Bethencourt d94bb0e0fb Unnecessary reference
This creates a reference to a reference, clean it.

Fixes https://github.com/sdroege/gstreamer-rs/pull/48
Fixes https://github.com/sdroege/gstreamer-rs/issues/47
2017-10-24 23:41:48 +02:00
Sebastian Dröge 884c9790ef Fix compilation of GTK examples with latest gio 2017-10-01 16:32:33 +02:00
Sebastian Dröge 19c5556239 Regenerate with latest GIR 2017-10-01 15:52:15 +02:00
Sebastian Dröge d608cff9e9 Fix build with latest GApplication API changes 2017-09-26 10:41:03 +03:00
Sebastian Dröge ce5c01a88e Implement gst::Iterator as a generic type to not require using glib::Values everywhere 2017-09-17 18:45:38 +03:00
Sebastian Dröge 8085c4ce8e Add gst::Iterator example with Resync handling 2017-09-17 14:59:01 +03:00
Sebastian Dröge f1025170d9 Use while-let and CLOCK_TIME_NONE for the bus.timed_pop() loops in the examples/tutorials 2017-09-13 19:35:35 +03:00
Sebastian Dröge 0f5f55c64d Fix various clippy warnings in examples 2017-09-10 15:27:53 +03:00
Sebastian Dröge b4cb81cd56 Run everything through latest rustfmt-nightly 2017-09-10 15:21:26 +03:00
Sebastian Dröge e0e0f56b52 Fix/hide various clippy warnings in gstreamer-player
And let PlayerGMainContextSignalDispatcher::new() return the correct
type
2017-09-10 15:21:26 +03:00
Sebastian Dröge 7dfab61390 Conditionally use glib crate in player example 2017-09-01 14:12:26 +03:00
Sebastian Dröge 062b596432 Fix-up various unused external crate warnings 2017-09-01 13:42:59 +03:00
Philippe Normand facaae6be9 examples: Quartz support for the gtkvideooverlay example
Fixes https://github.com/sdroege/gstreamer-rs/pull/31
2017-08-30 18:08:00 +03:00
Sebastian Dröge da1a0c31d8 Add video overlay example, using GTK and only support Unix/X11 for now 2017-08-29 15:44:33 +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 c235d90834 Fix compilation with --features tokio in the examples 2017-08-17 18:16:48 +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 50a1535771 Add ParseContext bindings and corresponding functions
And use it in the launch example to print more useful error information,
like which elements are missing.
2017-08-17 16:17:02 +03:00
Sebastian Dröge 165d85646f Move futures based BusStream from examples to the bindings
And hide behind the "futures" feature.

Fixes https://github.com/sdroege/gstreamer-rs/issues/26
2017-08-17 13:07:59 +03:00
Sebastian Dröge 56847216a0 Use byte-slice-cast trait instead of our own minimal version of it 2017-08-14 20:45:35 +03:00
Sebastian Dröge b392c82ba9 Use gstreamer-video API in appsrc example and make frame generation a bit more efficient 2017-08-11 17:59:05 +03:00
Sebastian Dröge b655c838b2 Add helper for converting a raw audio buffer to an array of integers/floats 2017-08-11 17:09:32 +03:00
Sebastian Dröge 4276cb6228 Simplify player example a bit 2017-08-11 15:48:12 +03:00
Philippe Normand 1e12354cd5 GstPlayer: make it build and add simple example 2017-08-11 15:42:28 +03:00
Sebastian Dröge c36c8189ce Add example to playbin example about how to connect/emit dynamic signals
... and get the audio track's tags whenever they change.
2017-08-11 15:31:59 +03:00
Sebastian Dröge 1a3b556fb6 Make Buffer map bindings more simple and consistent 2017-08-11 15:20:43 +03:00
Sebastian Dröge 07e9383ddf Simplify toc example a bit
There's not need for checking audio/video if both are going directly to
a fakesink anyway.
2017-08-09 19:40:20 +03:00
fengalin 04f09ebc86 Add bindings for GstToc/TocSetter
https://github.com/sdroege/gstreamer-rs/pull/22

Fixes https://github.com/sdroege/gstreamer-rs/issues/10
2017-08-09 19:38:39 +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 c9423471b0 Fix some clippy warnings in the examples 2017-08-04 15:36:12 +03:00
Philippe Normand 7326377f5f examples: app*: refactor error enum to a utils module
The module also contains create_element, link_elements and set_state functions
to help reduce boilerplate.
2017-08-04 15:09:29 +03:00
Philippe Normand e218f7a93c examples: appsink: improved error handling
The program should now exit gracefully with human readable messages.
2017-08-03 19:48:26 +03:00
Philippe Normand 50e6e2e108 examples: appsrc: improved error handling
The program should now exit gracefully with human readable messages.
2017-08-03 18:09:29 +03:00
Sebastian Dröge b08a101cc6 Fix clippy warnings in the examples 2017-08-02 20:15:16 +03:00
Sebastian Dröge 594418e1f4 Add appsink example 2017-08-01 21:45:26 +03:00
Sebastian Dröge dc640249ef Add simple appsrc example 2017-08-01 21:30:51 +03:00
Sebastian Dröge 23ef3c1f08 Add a function to unset the Bus' current sync handler
And use it in the Tokio example to unset the handler once the BusStream
is dropped.
2017-08-01 20:52:29 +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 38496eca7d Pass events by value instead of reference 2017-08-01 13:59:12 +01:00
Sebastian Dröge 96a0668c5f Add playbin example 2017-07-31 16:24:30 +01:00