Commit graph

182 commits

Author SHA1 Message Date
Sebastian Dröge
a354116336 Make ObjectImpl and subtraits generic over T: ObjectType 2017-09-26 00:25:03 +03:00
Sebastian Dröge
f45723c04e Remove redundant ObjectType::RsType associated type
It's supposed to be the same as Self
2017-09-25 23:40:17 +03:00
Sebastian Dröge
5e9f42e7f8 Remove some more boilerplate 2017-09-25 15:35:27 +03:00
Sebastian Dröge
b25e612458 Remove some boilerplate 2017-09-25 15:29:39 +03:00
Sebastian Dröge
f322395918 Rename ObjectClassStruct to ObjectClass 2017-09-25 13:49:53 +03:00
Sebastian Dröge
cd23c993ae Rename panic_to_error2() to panic_to_error()
No usage of the other one left.
2017-09-24 23:22:58 +03:00
Sebastian Dröge
0423264fea Hack around floating references
By unsetting the floating flag in our virtual method trampolines if it
was set, and resetting it at the end of the function again if it was
set.

Otherwise we can't safely use any bindings, as the assumptions about
floating references are invalid then and things just crash.
2017-09-24 23:21:15 +03:00
Sebastian Dröge
395a002f4a Store type ids in a static BTreeMap
static variables inside generic functions are shared between all
instances of the function, we can't use that for storing our generated
type id.
2017-09-24 22:47:14 +03:00
Sebastian Dröge
1260dc42bb Port sink over to new infrastructure 2017-09-24 22:28:28 +03:00
Sebastian Dröge
6e1c89d1df Add GstBaseSink bindings 2017-09-24 22:22:20 +03:00
Sebastian Dröge
1f880caee1 Port Source over to the new infrastructure 2017-09-24 22:18:12 +03:00
Sebastian Dröge
540011a4a0 Add some more boilerplate for impl trait inheritance
This needs some macros added.
2017-09-23 19:58:18 +03:00
Sebastian Dröge
b7c396d70b Complete basesrc subclassing infrastructure 2017-09-23 19:54:36 +03:00
Sebastian Dröge
a0bac4a722 Add interface infrastructure and GstURIHandler support 2017-09-23 19:20:23 +03:00
Sebastian Dröge
4ee8b12e66 Add infrastructure for installing various kinds of properties
From both the subclass and the implementation
2017-09-23 12:57:15 +03:00
Sebastian Dröge
1c997c171d Make some unnecessarily mutable variables immutable 2017-09-22 14:37:15 +03:00
Sebastian Dröge
950a7d5b0d Mark the abstract base types as actually abstract
Without implementation they can't be instantiated
2017-09-22 14:08:45 +03:00
Sebastian Dröge
0d22579297 Get rid of demuxer wrapper
It was just an unneeded layer of indirection now after all the
refactoring
2017-09-22 13:49:19 +03:00
Sebastian Dröge
cda23d5c41 Implement generic object subclass creation in a more... generic... way
That actually works for subclasses of subclasses too without too much
boilerplate, and also keeps the GObject boilerplate in a single file
instead of having it for every single subclass.
2017-09-22 13:35:17 +03:00
Sebastian Dröge
8d253fd46a Minor cleanup 2017-09-19 16:05:21 +03:00
Sebastian Dröge
62a237ff0c Implement a generic Element implementation infrastructure
And implement the Demuxer base class on top of that, with no unsafe code
left whatsoever
2017-09-19 14:56:04 +03:00
Sebastian Dröge
2781e0b3d8 Port demuxer to plain Rust 2017-09-18 21:29:42 +03:00
Sebastian Dröge
7e7433037d Port everything over to gstreamer-rs
And remove all unneeded code and unused external crates.
2017-09-16 20:35:01 +03:00
Sebastian Dröge
5ae66e191c Run everything through latest rustfmt-nightly 2017-09-15 11:54:38 +03:00
Sebastian Dröge
71dcb979c7 Fix various compiler warnings in demuxer C code 2017-09-10 14:02:46 +03:00
Sebastian Dröge
338f2dcb92 Remove versions of git dependencies 2017-09-09 00:51:19 +03:00
Sebastian Dröge
d68effa8e4 Update all kinds of dependencies 2017-08-18 12:52:17 +03:00
Sebastian Dröge
dd5af12ebe Rename used crates (gst -> gst_ffi, etc) and import gstreamer code 2017-07-31 23:26:52 +01:00
Sebastian Dröge
6f04ddf797 Run everything through rustfmt-nightly 2017-07-31 14:36:35 +01:00
Sebastian Dröge
94016c39b0 Update to nom 3.0, bitflags 0.9 2017-06-06 13:29:19 +03:00
Sebastian Dröge
d962acc8c3 Update to released versions of glib-sys/gstreamer-sys 2017-05-10 11:25:17 +02:00
Sebastian Dröge
52981968f6 Use raw pointers instead of &'static references
&'static is wrong here is the pointers are only valid for the lifetime
of the surrounding struct.

Also place a PhantomData<T> inside the structs as conceptually we own a
T, see std::ptr::Unique and
https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md#phantom-data

Need to add the PhantomData<T> elsewhere too.
2017-04-27 12:33:28 +03:00
Sebastian Dröge
c6addbfe48 Remove From<&T> impls for GstRc<T>
Instead of this, ToOwned should be used.
2017-04-24 17:28:26 +03:00
Sebastian Dröge
139c9be958 Minor cleanup 2017-04-24 10:13:32 +01:00
Sebastian Dröge
9b593136da Rewrite MiniObject bindings
These now use references were applicable and GstRef became useless
2017-04-24 10:06:38 +01:00
Sebastian Dröge
2232af41b6 Refactor Structure bindings and allow getting Structures from Caps 2017-04-21 22:04:08 +01:00
Sebastian Dröge
df51424631 Structure/Caps API improvements 2017-04-21 12:18:41 +01:00
Sebastian Dröge
757d7532c1 Fix various clippy warnings 2017-04-20 20:37:08 +01:00
Sebastian Dröge
154e996e2d Implement Iterator::size_hint(), ExactSizeIterator and DoubleEndedIterator for our iterators 2017-04-20 20:28:03 +01:00
Sebastian Dröge
deef22cd28 Add bindings for GstStructure 2017-04-19 20:57:33 +01:00
Sebastian Dröge
8ea9e66797 Add Tag iterator for iterating one specific tag 2017-04-19 12:26:33 +01:00
Sebastian Dröge
e45ff7241e Remove some unneeded trait bounds in the taglist bindings 2017-04-19 12:11:31 +01:00
Sebastian Dröge
1bf20bfea4 Implement ValueRef and TypedValueRef for wrapping around a unowned GValue pointer without copying
Also rename new_from*() functions to from*() for consistency.
2017-04-19 11:59:44 +01:00
Sebastian Dröge
2d97baaf96 Rewrite GValue bindings 2017-04-18 20:42:23 +01:00
Sebastian Dröge
a808c34794 Use g_strndup() instead of creating a CString and then g_strdup() it
Creating a CString involves potentially some additional allocations.
2017-04-14 12:41:39 +03:00
Sebastian Dröge
9864413be2 Run everything through new rustfmt 2017-04-12 16:46:11 +03:00
Sebastian Dröge
021de8af1f Update to slog 2.0 2017-04-12 16:44:34 +03:00
Sebastian Dröge
0cf169aa20 Fix some clippy warnings 2017-04-10 20:00:22 +03:00
Sebastian Dröge
7139551773 Port sink C code to Rust 2017-04-10 19:52:00 +03:00
Sebastian Dröge
d72f1f716b Port C code for the source to pure Rust 2017-04-10 19:52:00 +03:00
Sebastian Dröge
50829bdec9 Store GWeakRef in a Box
Its memory location is important, and having it stored directly inside
the struct allows it to possible be moved to a different address.
2017-04-10 16:59:34 +03:00
Sebastian Dröge
24a10bb614 Port everything else over to glib/gobject/gstreamer-sys 2017-04-10 00:29:07 +03:00
Sebastian Dröge
e4ababa98f Switch to gstreamer-sys crate and port buffer bindings to it 2017-04-06 15:10:22 +03:00
Sebastian Dröge
1dda357b86 Move MiniObject::is_writable() from the trait to the reference containers 2017-04-05 23:52:38 +03:00
Sebastian Dröge
2b799910fc Update to bitflags 0.8 2017-02-19 12:12:06 +02:00
Sebastian Dröge
b3e01add5c Remove FlowError::NotLinked
This will never appear in Rust code as all forwarding of buffers will
happen at the C/Rust binding layer.
2017-02-16 17:54:20 +02:00
Sebastian Dröge
e64facc254 Change license from LGPLv2.1+ to Apache2/MIT
https://github.com/sdroege/rsplugin/issues/7
2017-02-16 17:52:27 +02:00
Sebastian Dröge
6b7e6d8e6c Add unit test for buffers that checks the miniobject writability wrapping 2017-02-04 17:51:05 +01:00
Sebastian Dröge
9e59eff973 Fix some clippy warnings 2017-02-03 15:57:49 +01:00
Sebastian Dröge
7b5764e759 Implement GstRc/GstRef wrapper for GstMiniObject
Keeps the miniobject specific code local and provides a more similar API
to Rc/Arc. Also makes it impossible to accidentially try writing to an
unwritable miniobject.
2017-02-03 15:57:49 +01:00
Sebastian Dröge
974a689fd7 Keep amount of unsafe code a bit smaller for the GstStream* stream IDs 2017-01-23 21:17:36 +02:00
Sebastian Dröge
2ec438e5b8 Add Eq/PartialEq instances for TagList and Caps 2017-01-23 18:31:51 +02:00
Sebastian Dröge
1ee7c8b9e3 Return stream IDs directly instead of creating an owned String 2017-01-23 18:26:42 +02:00
Sebastian Dröge
7a33a4177f Improve C string handling a bit
These are always going to be valid UTF-8 or things are very wrong.
2017-01-23 14:35:16 +02:00
Sebastian Dröge
e2b18a91e0 Add bindings for GstStream and GstStreamCollection
To be used in the demuxer for tracking streams and their related
information.
2017-01-22 20:13:07 +02:00
Sebastian Dröge
509810e87a Add tags support 2017-01-18 14:36:11 +02:00
Sebastian Dröge
aa54f1a4e6 Use num_rational instead of home-baked (u32, u32) fractions 2017-01-15 20:56:20 +01:00
Sebastian Dröge
3e17102166 Add API to create a Buffer from a Vec<u8> with memory reuse and use it for the Speex headers 2017-01-14 18:04:55 +01:00
Sebastian Dröge
745a6a3c17 Implement From<_> for Value to simplify code a lot 2017-01-13 21:45:23 +01:00
Sebastian Dröge
ac9ba47403 Move Value code into its own module 2017-01-13 19:16:12 +02:00
Sebastian Dröge
93f09c8a4a Add support for Speex to FLV demuxer
... and arrays of values in caps while at the same time refactoring the
Value code a bit.
2017-01-13 19:04:51 +02:00
Sebastian Dröge
3b299f3fb6 Simplify caps a bit by using slices instead of IntoIterator
IntoIterator did not work as expected anyway and would require usage of
AsRef, which then breaks type inference for empty slices for example.
2017-01-09 20:55:10 +02:00
Sebastian Dröge
e9cf54d43b Add support for AAC and AVC/H264 in FLV 2017-01-06 00:46:59 +02:00
Sebastian Dröge
0fabdf3774 Add caps from string binding 2016-12-30 19:05:04 +02:00
Sebastian Dröge
80ba9a8b8f Use caps also for the demuxer sink/src pad templates instead of strings 2016-12-30 19:02:31 +02:00
Sebastian Dröge
e26cdc9187 Implement a minimal GstCaps binding and use it in the demuxer 2016-12-30 12:11:30 +01:00
Sebastian Dröge
137a14360f Add debug logging everywhere 2016-12-27 16:47:39 +01:00
Sebastian Dröge
c9aad84898 Only format strings, etc in debug log handler if the configured threshold is higher than the level 2016-12-26 10:53:36 +01:00
Sebastian Dröge
fa6712e5aa Fix some clippy warnings 2016-12-25 12:28:17 +01:00
Sebastian Dröge
bccf3805a1 Ignore stop failures
stop should only really fail if everything is broken, but we can always
recover somehow here.
2016-12-25 12:20:44 +01:00
Sebastian Dröge
8ee1f72184 Add support for logging via slog 2016-12-25 12:16:12 +01:00
Sebastian Dröge
89b0220e26 Build each component into its own GStreamer plugin 2016-12-23 19:04:32 +02:00