servo/media

Update to new gstreamer-rs

Closed this issue · 1 comments

jdm commented

Apparently we will want to update to the new byte-slice-cast as well.

Update to new gstreamer-rs #326

The biggest amount of changes required on your side here seem to be

  • Functions returning Result instead of Option now when it signals an error, which you usually passed to ok_or_else() before. Those should simply become map_err() or similar
  • Value::get() returning an Result<Option<T>, E> instead of Option<T>. You probably want to
    • Value::get_some() for non-nullable types (integers, etc), which will give you a Result<T, E>. The error would only happen if there's the wrong type inside the value, so probably just want to expect() this part.
    • Value::get() for everything else. The error will happen if it's of the wrong type, so you probably simply want to expect() on that part. For the Option you probably want to handle it in one way or another.
    • In case of Structure::get() potentially use get_optional(), which returns only an error if the field exists but is of the wrong type, but non-existence is always a None.

Apparently we will want to update to the new byte-slice-cast as well.

This will not require any source changes on your side.