Commit graph

230 commits

Author SHA1 Message Date
Sebastian Dröge
52509b4b95 Remove subclassing feature and make it the default 2019-09-09 11:51:07 +03:00
Jan Alexander Steffens (heftig)
a30935ad1f
Iterator: Add a wrapper implementing std's Iterator
Transposing the item type lets us be a std-compatible Iterator.

The iterator is automatically resynced when resuming iteration after
yielding Resync. This lets some combinators like `collect` and `find`
work properly.
2019-09-04 14:34:05 +02:00
Sebastian Dröge
ae58a469d1 meta: Add support for ReferenceTimestampMeta 2019-07-14 22:32:10 +03:00
Sebastian Dröge
b87ffa17bb Run rustfmt also over all the generated code 2019-06-18 13:12:00 +03:00
Guillaume Desmottes
7a69a1137c gstreamer: plugin_feature: use Rank enum 2019-06-04 12:56:18 +03:00
Sebastian Dröge
004ce5d392 gstreamer: Re-export the paste crate for the gst_plugin_define! macro
And only depend on the paste crate if the subclass feature is requested.
2019-05-27 22:46:26 +02:00
Vivia Nikolaidou
32e1d68d36 allocator: Expose GstAllocator 2019-05-24 10:32:57 +00:00
Vivia Nikolaidou
922af1d606 Add GstMemory bindings
Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/12
2019-05-24 10:32:57 +00:00
Sebastian Dröge
b5dcbe3897 gstreamer/proxypad: Move default functions to extension trait 2019-05-24 10:04:16 +00:00
Vivia Nikolaidou
496fc61873 pipeline: Add to lib.rs 2019-05-12 16:41:18 +03:00
Vivia Nikolaidou
05d936fcee gstreamer: Add binding for GstMessageType and gst_bus_timed_pop_filtered
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/168
2019-05-10 19:35:13 +03:00
Sebastian Dröge
e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge
8c39da4e5b Update to Rust 1.31 linter-specific attributes 2019-03-04 15:16:01 +02:00
Sebastian Dröge
9d79280929 Add some more functions for generically handling tags 2019-01-23 15:54:00 +02:00
Sebastian Dröge
598e012568 Add bindings for gst::tags::register() 2019-01-23 15:52:51 +02:00
François Laignel
84ba2d7971 Use dedicated type DeviceMonitorFilterId
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/174
2019-01-19 14:52:15 +01:00
Sebastian Dröge
bfcdec782e Switch to stable rustfmt and add skip annotations for the generated code to the lib.rs 2019-01-16 17:10:01 +02:00
Sebastian Dröge
43ec33a1db Remove some code that is nowadays generated by the glib_wrapper! macro 2019-01-16 15:23:53 +02:00
Sebastian Dröge
d780b92f21 Use an extension trait instead of a custom type for the GStreamer param specs
This way they can simply be created via glib::ParamSpec::fraction() for
example.
2018-12-11 12:37:15 +02:00
Sebastian Dröge
1515707655 Add bindings for the array/fraction param spec constructors 2018-11-29 19:18:45 +00:00
Sebastian Dröge
d2b911a629 Port GhostPad subclassing 2018-11-21 16:14:06 +02:00
Sebastian Dröge
ec2a0635ca Port Pad subclassing 2018-11-21 16:14:06 +02:00
Sebastian Dröge
97211e869b Port Pipeline subclassing 2018-11-21 16:14:06 +02:00
Sebastian Dröge
55dac7eeb4 Port Bin subclassing 2018-11-21 16:14:06 +02:00
Sebastian Dröge
56319f9294 Move subclassing infrastructure into the main bindings
And port Element bindings to the new infrastructure.
2018-11-21 16:14:06 +02:00
Sebastian Dröge
0947c8f087 Rename gst::Bin traits from BinExt to GstBinExt to prevent conflicts with gtk::Bin 2018-10-28 11:30:41 +00:00
Sebastian Dröge
cb23d20270 Implement support for buffer Metas
Fixes https://github.com/sdroege/gstreamer-rs/issues/103
2018-09-29 11:44:55 +03:00
Sebastian Dröge
6fd0ed4cb3 Move all minobjects to newtype wrapper types
For consistency with external crates and to help rustdoc, which gets
confused on impl blocks for type aliases.
2018-09-28 18:11:46 +03:00
Sebastian Dröge
a43c78f2c5 Run everything through rustfmt 2018-09-28 13:15:18 +03:00
Sebastian Dröge
564f9faf84 Add support for CapsFeatures
Fixes https://github.com/sdroege/gstreamer-rs/issues/13
2018-09-28 13:15:18 +03:00
Philippe Normand
58741b7ea2 gstreamer: Implement deinit() function
This function is especially usefull when using the leaks tracer. It was removed
in commit e7a0543c.
2018-08-04 18:39:53 +03:00
François Laignel
0eb6bcf0c0 serde: restrain unneeded visibilities 2018-07-30 23:18:30 +03:00
François Laignel
9f2f684188 format: serde: avoid redundant () for some types 2018-07-30 23:18:30 +03:00
François Laignel
90b046fbcf serde: separate serde impl and tests from base module
+ fix erroneous `datetime` instead of `buffer` in `BufferRef::serialize`
+ remove ser/de for `Value`s with types `ULong` & `ILong`
2018-07-30 23:18:30 +03:00
François Laignel
862afe5cc7 Buffer: serde impl 2018-07-30 23:18:30 +03:00
François Laignel
778e11742f value: serde impl 2018-07-30 23:18:30 +03:00
François Laignel
0d65b7f1ed DateTime: serde impl 2018-07-30 23:18:30 +03:00
Sebastian Dröge
33a6aab6d7 Run everything through latest rustfmt 2018-07-27 13:36:40 +03:00
François Laignel
be9ef0d152 Tags: implement generic iterators
This is the continuation of PR #107 by @ystreet
2018-07-12 07:22:39 +02:00
Sebastian Dröge
e0972ae1e5 Get rid of manual usage of callback_guard! 2018-06-24 14:52:50 +03:00
Sebastian Dröge
c31921e093 Further work-arounds for floating reference handling changes between 1.12 and 1.14
This fixes various memory-safety issues caused by broken reference
counting. We have to handle pre-1.14 and post-1.14 differently in
constructors.

See https://bugzilla.gnome.org/show_bug.cgi?id=743062#c30
2018-05-09 12:20:59 +03:00
Sebastian Dröge
2cefd9aea6 Re-run everything through rustfmt 2018-04-25 11:13:14 +03:00
Sebastian Dröge
a276c226fd Port BusStream to futures 0.2 2018-04-23 20:27:17 +03:00
Sebastian Dröge
492c3d656c Run everything through rustfmt again 2018-04-01 11:57:58 +03:00
François Laignel
cd56d60352 Bus::get_pollfd generate doc for both unix & windows
There are different implementations and signatures for `get_pollfd` depending
on whether the target platform is unix or windows. When generating the doc,
we need both implementations to appear regardless of the target platform. This
commit is inspired by the way Rust `std` library deals with `process::Command`
OS dependent variants
(https://doc.rust-lang.org/std/process/struct.Command.html#impl-CommandExt).

Documentation can't be accurate though as we can't use the`std::os::windows`
on `unix` and vice versa. As a workaround a fake fd class matching the other
platform is declared.

This could be further enhanced once `#[doc(cfg(...))]` is stabilized
(https://github.com/rust-lang/rust/issues/43781) by declaring `#[doc(cfg(unix))]`
or `#[doc(cfg(windows))]` instead of the hard coded comments `This is supported
on **Windows/Unix** only`. Unfortunately, these comments disappear when
generating will `--all-features` because they are not part of the documentation
in the gir file.
2018-03-19 13:48:59 +02:00
Sebastian Dröge
3a755219f4 Add Promise bindings 2018-03-19 10:32:07 +02:00
Sebastian Dröge
4864a1e089 Fix build 2018-03-19 10:32:07 +02:00
Sebastian Dröge
de8f4694f5 Add initial BufferPool bindings 2018-03-07 11:08:21 +02:00
Sebastian Dröge
a3b294f0f2 Add back callback guards 2018-03-02 21:34:29 +02:00
Sebastian Dröge
f1426c82ba Remove callback guards
Since Rust 1.24 it is safe to let panics go to the FFI boundary
2018-02-17 19:58:41 +02:00
Sebastian Dröge
ad219dd171 Remove PAD_PROBE_ID_INVALID and Default impls for PadProbeId and NotifyWatchId
These should never ever be 0, and passing 0 to any of the functions
using them will result in assertions.
2018-01-25 21:06:39 +02:00
Sebastian Dröge
9066cf0634 Add ErrorMessage type
This can be used to propagate an element error via a Result until the
place where it can be actually posted on an element.
2017-12-20 20:00:05 +02:00
Sebastian Dröge
e0dc84c10a Run everything through rustfmt again 2017-12-20 19:30:14 +02:00
Sebastian Dröge
95c9f92549 Add StreamCollection::iter() 2017-12-20 18:54:56 +02:00
Sebastian Dröge
6d8cfa5de0 Add support for TypeFind and implement Ord on Rank and TypeFindProbability
Fixes https://github.com/sdroege/gstreamer-rs/issues/11
2017-12-19 19:14:12 +02:00
Sebastian Dröge
5108c941ed Various nullability fixes to plugin bindings, and add add_dependency() API
Also fix structure ownership for the cache data API
2017-12-17 14:26:17 +02:00
Sebastian Dröge
7065d1d884 Add constants for COPY_ALL and COPY_METADATA buffer copy flags 2017-12-16 17:40:47 +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
55f044dd83 Add newtype wrappers and INVALID constants for event/message GroupId and Seqnum 2017-12-05 21:33:04 +02:00
Sebastian Dröge
fccb1eca5e Implement fmt::Debug more consistently for miniobjects and various other types 2017-12-01 11:34:01 +02:00
Sebastian Dröge
eee82fd402 Export FlowError/Success, ClockError/Success, PadLinkError/Success too 2017-11-26 20:40:05 +02:00
Sebastian Dröge
d4bd1c2d76 Add dox feature to everything as needed 2017-11-12 13:33:02 +01:00
Sebastian Dröge
126159c762 Run everything through rustfmt once again 2017-11-11 13:31:01 +01:00
Sebastian Dröge
f823ef9cf7 Add constants for SECONDS, etc in u64 2017-11-11 13:00:50 +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
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
b58f4cd1ed Add Object::connect_deep_notify() and test 2017-10-27 23:03:45 +02:00
Sebastian Dröge
ec6dde855a Replace ulong for the property notify watches with a custom NotifyWatchId type 2017-10-27 17:55:48 +02:00
Sebastian Dröge
f30121ec53 Add private utils module with a MutexGuard around GMutex 2017-10-25 12:58:16 +02:00
Sebastian Dröge
9206ddba61 Add StaticCaps and StaticPadTemplate bindings
No way to create them though, just use lazy_static from Rust instead if
something like this is needed.
2017-10-15 11:08:56 +03:00
Sebastian Dröge
5881dc7d53 Also export IteratorImpl trait 2017-09-17 18:51:45 +03:00
Sebastian Dröge
f7bce553cd Implement std::iter::Iterator<Item=Result<glib::Value, IteratorError> for gst::Iterator 2017-09-17 14:43:33 +03:00
Sebastian Dröge
3cb5b591ca Add bindings for Element::message_full() and _full_with_details() 2017-09-15 19:00:51 +03:00
Sebastian Dröge
de10335167 Allow creating Error/Warning/Info messages only from specific kinds of glib::Error domains 2017-09-15 18:35:54 +03:00
Sebastian Dröge
b4cb81cd56 Run everything through latest rustfmt-nightly 2017-09-10 15:21:26 +03:00
Sebastian Dröge
85b335fd89 Fix/hide various clippy warnings in gstreamer 2017-09-10 15:21:26 +03:00
Sebastian Dröge
ca6c597fad Add bindings for the GStreamer logging system 2017-09-09 16:35:01 +03:00
Sebastian Dröge
f05df73088 Add various gst_init() assertions to video/app bindings
audio and core should come next.

Also print something more meaningful than using assert_eq!().
2017-08-30 12:48:01 +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
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
767bd0537e Only re-export traits once 2017-08-17 16:32:17 +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
e7a0543c73 Clean up global functions 2017-08-17 15:31:00 +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
08e2f6d917 Add Element::get_metadata(), get_pad_template(), get_pad_template_list() and DeviceProvider::get_metadata()
As wrapper around the C class functions.

Fixes https://github.com/sdroege/gstreamer-rs/issues/28
2017-08-17 12:49:58 +03:00
Sebastian Dröge
77cb4da32a Add ClockId and related waiting API, and SystemClock
Fixes https://github.com/sdroege/gstreamer-rs/issues/23
2017-08-14 01:41:37 +03:00
Philippe Normand
8badc33df9 gstreamer: expose version functions 2017-08-11 15:41:20 +03:00
Sebastian Dröge
93cc21112c Don't re-export everything from the tags module
All the tags are supposed to be used via gst::tags::Title, etc to
prevent conflicts.
2017-08-11 15:32:28 +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
e1538b6ca5 Add bindings for various audio channel position functions 2017-08-10 14:39:57 +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
f1ac59a400 Autogenerate GstObject bindings again now that gir has support for renaming the trait 2017-08-07 10:24:43 +03:00
Sebastian Dröge
86fc001e35 Regenerate code with new GIR and suppress various clippy warnings in generated code
Now only a few are left in the manually written code.
2017-08-03 21:56:39 +03:00
Sebastian Dröge
3fdc4cf5fc Add GstContext bindings 2017-08-02 20:34:37 +03:00
Sebastian Dröge
32c5218e7d Fix indentation 2017-08-02 19:41:33 +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
ff12c054e3 Add all tags from core 2017-07-31 11:33:05 +01:00
Sebastian Dröge
7e24bae7c0 Improve Segment bindings to directly store the segment instead of a pointer to it 2017-07-31 10:54:22 +01:00
Sebastian Dröge
0a0b82d1b2 Get tag names from gstreamer-sys 2017-07-30 23:11:57 +01:00
Sebastian Dröge
2c949a9a05 Add Event bindings
And make Message bindings more consistent
2017-07-30 15:06:44 +01:00
Sebastian Dröge
5fa961f5b9 Add TagSetter and Preset bindings 2017-07-29 15:21:25 +01:00
Sebastian Dröge
9d35eff8d5 Add ChildProxy bindings 2017-07-29 15:10:10 +01:00
Sebastian Dröge
4730500662 Add Iterator bindings 2017-07-29 14:37:06 +01:00
Sebastian Dröge
21888daab6 Add GhostPad bindings 2017-07-29 14:19:15 +01:00
Sebastian Dröge
52dbf03d4f Add functions using queries 2017-07-29 14:04:34 +01:00
Sebastian Dröge
69e1fdd529 Add Query bindings 2017-07-29 13:52:31 +01:00
Sebastian Dröge
a76c51ac5c Add bufferlist bindings 2017-07-28 18:20:11 +01:00
Sebastian Dröge
210d641091 Implement Sample bindings 2017-07-28 18:04:15 +01:00
Sebastian Dröge
e3c9965eee Add getters/setters for all the segment fields 2017-07-28 17:47:23 +01:00
Sebastian Dröge
3dac0c8b30 Add constants for GST_BUFFER_OFFSET_NONE and GST_CLOCK_TIME_NONE 2017-07-25 15:31:45 +03:00
Sebastian Dröge
acd0fc7874 Add Buffer bindings from gst-plugin-rs 2017-07-25 15:01:24 +03:00
Sebastian Dröge
9fdf422e9b Random cleanup 2017-07-25 01:17:50 +03:00
Sebastian Dröge
e87c459099 Add bindings for pad probes
Missing for this to be actually useful: Buffer, BufferList, Event, Query bindings
2017-07-24 11:52:21 +03:00
Sebastian Dröge
ce33439465 Add GObjectExtManual trait and implement set_property_from_string() there 2017-07-20 11:39:44 +03:00
Sebastian Dröge
a94d4d583d Re-export gst::ObjectExt as gst::GstObjectExt to prevent conflict with glib::ObjectExt 2017-07-13 10:36:38 +03:00
Sebastian Dröge
9c357abf1a Add support for Fractions 2017-07-12 13:25:11 +03:00
Sebastian Dröge
796e37b4b6 Initial tag support 2017-07-12 10:27:43 +03:00
Sebastian Dröge
9cfb83d6a2 Add Source support to GstBus, and the sync message handler 2017-07-11 19:29:16 +03:00
Sebastian Dröge
4c5aa49fa2 Run manual code through rustfmt 2017-07-11 00:33:24 +03:00
Sebastian Dröge
c0707bed94 Add initial caps bindings 2017-07-11 00:11:55 +03:00
Sebastian Dröge
e43bf21ded Add initialization safety assertions
Ensure that GStreamer is initialized before allowing to call any
functions
2017-07-10 17:12:14 +03:00
Sebastian Dröge
992105b49f Implement basic GstStructure bindings 2017-07-10 17:10:15 +03:00
Sebastian Dröge
decf5da6d0 Add copyright notices 2017-07-07 14:47:28 +03:00
Sebastian Dröge
291f329fc3 Add Element::add_many(), ::remove_many(), Bin::link_many(), ::unlink_many() 2017-07-05 11:11:45 +03:00
Sebastian Dröge
fc8046b9bd Implement simple example application and clean up API 2017-07-03 18:08:43 +03:00
Sebastian Dröge
7a110ace10 Export parse_launch / parse_bin_from_description at the crate level 2017-07-03 17:57:57 +03:00
Sebastian Dröge
aa3581cee9 Add initial Message/MiniObject bindings 2017-07-03 14:01:08 +03:00
Sebastian Dröge
2546045593 Implement init() around gst_init_check() 2017-07-03 12:26:40 +03:00
Sebastian Dröge
15b08a4293 Initial commit
Requires
  https://github.com/gtk-rs/gir/pull/365
  https://github.com/gtk-rs/gir/pull/364
to be merged for autogeneration of the bindings.

Requires
  https://github.com/gtk-rs/gir/issues/367
for fixing memory leaks.
2017-05-12 14:24:03 +02:00