gstreamer-rs/gstreamer/Cargo.toml
François Laignel c2cc048803 gst: implement IdStr bindings and compatibility versions
IdStr represents UTF-8 immutable strings which perform optimizations for short
strings (< 16 bytes). The C type `GstIdStr` was introduced in GStreamer 1.26 as
a replacement for GQuarks.

This commit adds Rust bindings for the C type `GstIdStr`. Since this type will
be used in API which previously relied on GQuarks, the commit also adds a
compatibility implementation which can be used with GStreamer versions prior to
1.26, which is the first version to implement and use `GstIdStr`.

The crate [KString] was used as the inner implementation for the compatibility
version as it performs similar optimizations as `GstIdStr` and uses the same
threshold to trigger heap allocation.

See also: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432

[KString]: https://crates.io/crates/kstring

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1531>
2024-11-13 15:33:59 +01:00

58 lines
1.8 KiB
TOML

[package]
name = "gstreamer"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
description = "Rust bindings for GStreamer"
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
documentation = "https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer/"
version.workspace = true
categories.workspace = true
repository.workspace = true
homepage.workspace = true
edition.workspace = true
rust-version.workspace = true
[dependencies]
cfg-if = "1.0"
libc = "0.2"
gstreamer-sys.workspace = true
glib.workspace = true
num-integer = { version = "0.1", default-features = false, features = [] }
num-rational = { version = "0.4", default-features = false, features = [] }
futures-core = "0.3"
futures-channel = "0.3"
futures-util = { version = "0.3", default-features = false }
kstring = "2.0"
log = { version = "0.4", optional = true }
muldiv = "1"
opt-ops = { package = "option-operations", version = "0.5" }
serde = { version = "1.0", optional = true, features = ["derive"] }
serde_bytes = { version = "0.11", optional = true }
paste = "1.0"
thiserror = "2"
smallvec = { version = "1.0", features = ["write"] }
itertools = "0.13"
pin-project-lite = "0.2"
[dev-dependencies]
ron = "0.8"
serde_json = "1.0"
futures-executor = "0.3.1"
gir-format-check = "0.1"
[features]
default = []
v1_16 = ["gstreamer-sys/v1_16"]
v1_18 = ["gstreamer-sys/v1_18", "v1_16"]
v1_20 = ["gstreamer-sys/v1_20", "v1_18"]
v1_22 = ["gstreamer-sys/v1_22", "v1_20"]
v1_24 = ["gstreamer-sys/v1_24", "v1_22"]
v1_26 = ["gstreamer-sys/v1_26", "v1_24"]
serde = ["num-rational/serde", "dep:serde", "serde_bytes"]
log = ["dep:log"]
[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]