Commit graph

148 commits

Author SHA1 Message Date
Sebastian Dröge
42d09c2834 gstreamer/buffer: Move BufferCursor/BufferRefCursor into its own module
It's quite a bit of code and can be kept nicely separate.
2020-04-07 12:59:24 +03:00
Sebastian Dröge
5fc68e252d gstreamer: Add missing BufferCursorRef re-export 2020-04-06 21:00:42 +03:00
Sebastian Dröge
a884a419db gstreamer/buffer: Add a BufferCursor / BufferCursorRef helper structs
This implements Read/Seek or Write/Seek and allows to read/write/seek
into the buffer without merging the memories inside.

The writer also only maps the memory write-only as compared to all other
ways of accessing the buffer/memory data in a writable way, which have
to map it read-write.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/425
for a similar API proposal for GStreamer core.
2020-04-06 20:15:35 +03:00
Sebastian Dröge
d7e6c2e37f gstreamer/pad: Add support for filling the passed in buffer in the getrange function
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:58:09 +03:00
Sebastian Dröge
cddccf9502 gstreamer/promise: Add Future constructor for Promise
This returns a tuple that basically works like a oneshot channel: the
Promise acts as the "sender" and once the promise resolves the
"receiver" contains the result.
2020-02-09 19:08:41 +02:00
Valmir Pretto
6263922b6d gstreamer: BusStream tests 2020-02-04 10:33:34 -03:00
Valmir Pretto
7663589d94 gstreamer: BusStream cleanup
A few small readability changes
2020-02-04 10:33:25 -03:00
Sebastian Dröge
63a8afafa5 gstreamer: Use more accurate types for Seqnum, GroupId and MetaSeqnum
For the latter introduce an actual opaque type that allows using them
for comparison purposes but is not just a plain u64.

For the former represent them as opaque type around an NonZeroU32. 0 is
the invalid case and does not happen in the majority of functions. Where
it can happen, represent this case by using an Option<_> instead.

This makes it harder to mis-use these types.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/209
2020-01-25 00:07:36 +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
aa29567171 gstreamer/element: Add call_async_future() that returns a future
The future would resolve into the return value of the closure that is
called asynchronously on the thread pool, and allows asynchronous
awaiting for it to finish.

  let res = element.call_async(|element| {
      element.set_state(gst::State::Playing)
  }).await;

  assert_eq!(res, Ok(gst::StateChangeSuccess::Success))
2020-01-20 12:03:59 +02:00
Guillaume Desmottes
01c4d08501 gstreamer: use thiserror crate
Make code simpler and fix deprecated warning when building on nightly as
Error::description is being deprecated.
2020-01-10 18:54:50 +05:30
Guillaume Desmottes
c298577139 gstreamer: add MemoryRef::dump() 2019-12-24 09:15:34 +05:30
Sebastian Dröge
0c944cb26e gstreamer: Add documentation to gst::deinit() about when it's safe to be called 2019-11-14 12:11:10 +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
Guillaume Gomez
9e30687d8e Fix glib reexports 2019-11-11 11:34:09 +01:00
Sebastian Dröge
2d2459ed52 Export traits from the crate level and ensure that all traits are in the preludes 2019-10-17 13:30:35 +03:00
Sebastian Dröge
bacf4998ce clock: Add some more ClockId API for being able to implement clock subclasses 2019-09-25 17:22:15 +03:00
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