Commit graph

27 commits

Author SHA1 Message Date
Marijn Suijten
f4ad451956 sdp: Use .ok() instead of manual match on Ok and Err
Using `.ok()` is more concise when loosing error context in favour of a
simple `None` value.

Automatic replacement SSR pattern in rust-analyzer:

    {let $a = $b;match $c {Ok($d) => Some($e), Err(_) => None }} ==>> {$b.ok()}

Note that rust-analyzer does not support:
- duplicate labels (ie. $c should be equal to $a, and $e equal to $d);
- statement lists yet, hence both sides are wrapped in braces.

But it performs the desired operation well enough here.
2021-03-15 21:07:17 +01:00
Marijn Suijten
14f7707b51 sdp/sdp_media: Add missing failure check for gst_sdp_media_copy 2021-01-08 10:41:06 +01:00
Sebastian Dröge
59397c84be sdp: Use an actual error type instead of ()
Fixes a new clippy warning.
2020-12-29 16:55:45 +02:00
Sebastian Dröge
ce1148b474 Update everything for glib macro renamings 2020-12-18 00:56:47 +02:00
Guillaume Gomez
ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
Sebastian Dröge
e18cc55049 gstreamer-sdp: Update manual code to 2018 edition 2020-11-22 19:15:21 +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
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
62c0f5ef42 Use mem::ManuallyDrop instead of mem::forget() everywhere
It makes the intentions clearer and potentially results in simpler
assembly, at least in debug builds.
2020-04-09 16:57:06 +03:00
Tony Jinwoo Ahn
c3b7f0f353 gstreamer-gl, gstreamer-pbutils, gstreamer-sdp: Change functions from returning Option to Result
Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
2019-12-17 08:20:47 +00:00
Sebastian Dröge
2c4c2c4784 sdp: Guard against NULL strings/arrays in the SDP data structures
While all these are invalid for a proper SDP, they appear as NULL when
creating a new, empty SDP.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/221
2019-11-21 09:39:02 +00: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
8cd9b6c9fc sdp: Add Default impl for Media 2019-04-15 19:19:19 +03:00
Sebastian Dröge
e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge
23a776ea63 sdp: Remove return value from various media setter/adder functions
They can't possibly fail.
2019-02-28 20:35:45 +02:00
Sebastian Dröge
83a4529927 sdp: Fix SDPMedia constructor, it can't possibly fail 2019-02-28 20:35:45 +02:00
Sebastian Dröge
7673be5baa sdp: Remove MIKEY API for now
It was completely broken and has to be done differently. Once someone
actually needs it this can be re-added properly.
2019-02-28 20:35:45 +02:00
Sebastian Dröge
7b66325f22 sdp: Implement Borrow/BorrowMut/ToOwned for SDPMedia 2019-02-28 20:35:45 +02:00
Sebastian Dröge
b6f569d049 sdp: Implement a proper Debug impl on SDPMedia 2019-02-28 20:35:45 +02:00
Sebastian Dröge
30950917a0 sdp: Fix up SDPMedia API that accesses indexed fields
It's forbidden to provide an index higher than the number of elements in
the array, and will cause crashes or other undesired outcomes.

Also the insert() API should take an Option<u32> instead of an i32 that
might also be -1 for appending. It's awful API otherwise.
2019-02-28 20:35:45 +02:00
Sebastian Dröge
37fd226836 sdp: Add media iterators for bandwidths, formats, connections and attributes 2019-02-28 20:35:45 +02:00
Sebastian Dröge
ab2dbe0234 sdp: Fix SDPMedia::attributes_to_caps() signature to actually work
It has to take a mutable caps reference or otherwise will simply fail.
2019-02-28 20:35:45 +02:00
Sebastian Dröge
20e10698ac sdp: Add a SDPMediaRef that allows borrowing of a media
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/189
2019-02-28 20:35:45 +02:00
Sebastian Dröge
bd0cbe99b3 Add more Debug impls to everything possible 2019-01-22 17:46:08 +02:00
Sebastian Dröge
5c93e134a7 Regenerate everything with new version of gir 2018-12-08 14:58:14 +02: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
2d260b4f0c Rename manual files with too many underscores 2018-04-23 20:45:15 +03:00
Renamed from gstreamer-sdp/src/s_d_p_media.rs (Browse further)