gstreamer-play-0.23.5/.cargo_vcs_info.json0000644000000001540000000000100140570ustar { "git": { "sha1": "8eb8ab921bc627f854bac4e457521e7312403d0a" }, "path_in_vcs": "gstreamer-play" }gstreamer-play-0.23.5/CHANGELOG.md000064400000000000000000000000311046102023000144520ustar 00000000000000../gstreamer/CHANGELOG.mdgstreamer-play-0.23.5/COPYRIGHT000064400000000000000000000000141046102023000141350ustar 00000000000000../COPYRIGHTgstreamer-play-0.23.5/Cargo.lock0000644000000413600000000000100120360ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "atomic_refcell" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "cfg-expr" version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d4ba6e40bd1184518716a6e1a781bf9160e286d219ccdb8ab2612e74cfe4789" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "futures-channel" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", "futures-util", ] [[package]] name = "futures-macro" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "futures-task" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", "futures-task", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "gio-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "160eb5250a26998c3e1b54e6a3d4ea15c6c7762a6062a19a7b63eff6e2b33f9e" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", "windows-sys", ] [[package]] name = "gir-format-check" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a5da913a8586ce748f1164c890e1ebe75a7bbc472668f57b7f9fb893d7ac416" [[package]] name = "glib" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707b819af8059ee5395a2de9f2317d87a53dbad8846a2f089f0bb44703f37686" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-executor", "futures-task", "futures-util", "gio-sys", "glib-macros", "glib-sys", "gobject-sys", "libc", "memchr", "smallvec", ] [[package]] name = "glib-macros" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715601f8f02e71baef9c1f94a657a9a77c192aea6097cf9ae7e5e177cd8cde68" dependencies = [ "heck", "proc-macro-crate", "proc-macro2", "quote", "syn", ] [[package]] name = "glib-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8928869a44cfdd1fccb17d6746e4ff82c8f82e41ce705aa026a52ca8dc3aefb" dependencies = [ "libc", "system-deps", ] [[package]] name = "gobject-sys" version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c773a3cb38a419ad9c26c81d177d96b4b08980e8bdbbf32dace883e96e96e7e3" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "gstreamer" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "700cb1b2e86dda424f85eb728102a111602317e40b4dd71cf1c0dc04e0cc5d95" dependencies = [ "cfg-if", "futures-channel", "futures-core", "futures-util", "glib", "gstreamer-sys", "itertools", "libc", "muldiv", "num-integer", "num-rational", "once_cell", "option-operations", "paste", "pin-project-lite", "smallvec", "thiserror", ] [[package]] name = "gstreamer-base" version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad33dd444db0d215ac363164f900f800ffb93361ad8a60840e95e14b7de985e8" dependencies = [ "atomic_refcell", "cfg-if", "glib", "gstreamer", "gstreamer-base-sys", "libc", ] [[package]] name = "gstreamer-base-sys" version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "114b2a704f19a70f20c54b00e54f5d5376bbf78bd2791e6beb0776c997d8bf24" dependencies = [ "glib-sys", "gobject-sys", "gstreamer-sys", "libc", "system-deps", ] [[package]] name = "gstreamer-play" version = "0.23.5" dependencies = [ "gir-format-check", "glib", "gstreamer", "gstreamer-play-sys", "gstreamer-video", "libc", ] [[package]] name = "gstreamer-play-sys" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1f8ef790b8a697c759a9bbbaa7b0c061f529c4581e0cc72839ae753af533591" dependencies = [ "glib-sys", "gobject-sys", "gstreamer-sys", "gstreamer-video-sys", "libc", "system-deps", ] [[package]] name = "gstreamer-sys" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16cf1ae0a869aa7066ce3c685b76053b4b4f48f364a5b18c4b1f36ef57469719" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "gstreamer-video" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fa41e40319e923236e96f0b691711d1504746ab9c89607d77d22aa84777f33f" dependencies = [ "cfg-if", "futures-channel", "glib", "gstreamer", "gstreamer-base", "gstreamer-video-sys", "libc", "once_cell", "thiserror", ] [[package]] name = "gstreamer-video-sys" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31dc0f49c117f4867b0f98c712aa55ebf25580151d794be8f9179ec2d877fd14" dependencies = [ "glib-sys", "gobject-sys", "gstreamer-base-sys", "gstreamer-sys", "libc", "system-deps", ] [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indexmap" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "itertools" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "muldiv" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956787520e75e9bd233246045d19f42fb73242759cc57fba9611d940ae96d4b0" [[package]] name = "num-integer" version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ "num-traits", ] [[package]] name = "num-rational" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ "num-integer", "num-traits", ] [[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "option-operations" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c26d27bb1aeab65138e4bf7666045169d1717febcc9ff870166be8348b223d0" dependencies = [ "paste", ] [[package]] name = "paste" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "serde" version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_spanned" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "syn" version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "system-deps" version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" dependencies = [ "cfg-expr", "heck", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "thiserror" version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "toml" version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "unicode-ident" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "version-compare" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "windows-sys" version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] gstreamer-play-0.23.5/Cargo.toml0000644000000041150000000000100120560ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.71.1" name = "gstreamer-play" version = "0.23.5" authors = ["Sebastian Dröge "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Rust bindings for GStreamer Play library" homepage = "https://gstreamer.freedesktop.org" documentation = "https://gstreamer.freedesktop.org/documentation/rust/stable/latest/docs/gstreamer_play/" readme = "README.md" keywords = [ "gstreamer", "multimedia", "audio", "video", "gnome", ] categories = [ "api-bindings", "multimedia", ] license = "MIT OR Apache-2.0" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [lib] name = "gstreamer_play" path = "src/lib.rs" [[test]] name = "check_gir" path = "tests/check_gir.rs" [dependencies.glib] version = "0.20" [dependencies.gst] version = "0.23" features = ["v1_20"] package = "gstreamer" [dependencies.gst-video] version = "0.23" features = ["v1_20"] package = "gstreamer-video" [dependencies.gstreamer-play-sys] version = "0.23" [dependencies.libc] version = "0.2" [dev-dependencies.gir-format-check] version = "0.1" [features] v1_22 = [ "gst/v1_22", "gst-video/v1_22", "gstreamer-play-sys/v1_22", ] v1_24 = [ "gst/v1_24", "gst-video/v1_24", "gstreamer-play-sys/v1_24", "v1_22", ] v1_26 = [ "gst/v1_26", "gst-video/v1_26", "gstreamer-play-sys/v1_26", "v1_24", ] gstreamer-play-0.23.5/Cargo.toml.orig000064400000000000000000000022111046102023000155320ustar 00000000000000[package] name = "gstreamer-play" authors = ["Sebastian Dröge "] description = "Rust bindings for GStreamer Play library" license = "MIT OR Apache-2.0" readme = "README.md" documentation = "https://gstreamer.freedesktop.org/documentation/rust/stable/latest/docs/gstreamer_play/" keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"] version.workspace = true categories.workspace = true repository.workspace = true homepage.workspace = true edition.workspace = true rust-version.workspace = true [dependencies] libc = "0.2" gstreamer-play-sys.workspace = true glib.workspace = true gst = { workspace = true, features = ["v1_20"] } gst-video = { workspace = true, features = ["v1_20"] } [dev-dependencies] gir-format-check = "0.1" [features] v1_22 = ["gst/v1_22", "gst-video/v1_22", "gstreamer-play-sys/v1_22"] v1_24 = ["gst/v1_24", "gst-video/v1_24", "gstreamer-play-sys/v1_24", "v1_22"] v1_26 = ["gst/v1_26", "gst-video/v1_26", "gstreamer-play-sys/v1_26", "v1_24"] [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] gstreamer-play-0.23.5/Gir.toml000064400000000000000000000130061046102023000142650ustar 00000000000000[options] girs_directories = ["../gir-files", "../gst-gir-files"] library = "GstPlay" version = "1.0" min_cfg_version = "1.20" work_mode = "normal" concurrency = "send+sync" generate_safety_asserts = true single_version_file = true generate_display_trait = false trust_return_value_nullability = true external_libraries = [ "GLib", "GObject", "Gst", ] generate = [ "GstPlay.PlayColorBalanceType", "GstPlay.PlayError", "GstPlay.PlayMediaInfo", "GstPlay.PlaySnapshotFormat", "GstPlay.PlayState", "GstPlay.PlayStreamInfo", "GstPlay.PlayVideoRenderer", "GstPlay.PlayVisualization", ] manual = [ "GLib.Error", "GLib.MainContext", "GObject.Object", "Gst.Element", "Gst.Object", "GstVideo.VideoMultiviewFlags", "GstVideo.VideoMultiviewFramePacking", ] [[object]] name = "Gst.Bus" status = "manual" ref_mode = "ref" [[object]] name = "Gst.Caps" status = "manual" ref_mode = "ref" [[object]] name = "Gst.ClockTime" status = "manual" conversion_type = "Option" [[object]] name = "Gst.Message" status = "manual" ref_mode = "ref" [[object]] name = "Gst.Sample" status = "manual" ref_mode = "ref" [[object]] name = "Gst.Structure" status = "manual" ref_mode = "ref" [[object]] name = "Gst.TagList" status = "manual" ref_mode = "ref" [[object]] name = "GstPlay.Play" status = "generate" final_type = true [[object.function]] name = "visualizations_free" # correct mutability ignore = true [[object.function]] name = "set_config" # Custom type manual = true [[object.function]] name = "get_config" # Custom type manual = true [[object.function]] pattern = "config_.*" # Custom type ignore = true [[object.function]] name = "seek" [[object.function.parameter]] name = "position" mandatory = true [[object.function]] name = "set_audio_track" [object.function.return] bool_return_is_error = "Failed to set audio track" [[object.function]] name = "set_subtitle_track" [object.function.return] bool_return_is_error = "Failed to set subtitle track" [[object.function]] name = "set_video_track" [object.function.return] bool_return_is_error = "Failed to set video track" [[object.function]] name = "set_visualization" [object.function.return] bool_return_is_error = "Failed to set visualization" [[object.function]] name = "get_video_snapshot" # &StructureRef manual = true [[object.function]] name = "set_audio_track_id" [object.function.return] bool_return_is_error = "Failed to set audio track" [[object.function]] name = "set_video_track_id" [object.function.return] bool_return_is_error = "Failed to set video track" [[object.function]] name = "set_subtitle_track_id" [object.function.return] bool_return_is_error = "Failed to set subtitle track" [[object.function]] name = "set_track_ids" [object.function.return] bool_return_is_error = "Failed to set tracks" [[object]] name = "GstPlay.PlayAudioInfo" status = "generate" final_type = true [[object]] name = "GstPlay.PlayMessage" status = "generate" final_type = true visibility = "crate" [[object.function]] name = "parse_error_missing_plugin" manual = true [[object.function]] name = "parse_warning_missing_plugin" manual = true [[object.function]] name = "get_uri" manual = true [[object.function]] name = "get_stream_id" manual = true [[object]] name = "GstPlay.PlaySignalAdapter" status = "generate" final_type = true [[object.signal]] name = "buffering" concurrency = "send" [[object.signal]] name = "duration-changed" concurrency = "send" # Pass ClockTime instead of u64 manual = true [[object.signal]] name = "end-of-stream" concurrency = "send" [[object.signal]] name = "error" concurrency = "send" [[object.signal]] name = "media-info-updated" concurrency = "send" [[object.signal]] name = "mute-changed" concurrency = "send" [[object.signal]] name = "position-updated" concurrency = "send" # Pass ClockTime instead of u64 manual = true [[object.signal]] name = "seek-done" concurrency = "send" # Pass ClockTime instead of u64 manual = true [[object.signal]] name = "state-changed" concurrency = "send" [[object.signal]] name = "uri-loaded" concurrency = "send" [[object.signal]] name = "video-dimensions-changed" concurrency = "send" [[object.signal]] name = "volume-changed" concurrency = "send" [[object.signal]] name = "warning" concurrency = "send" [[object]] name = "GstPlay.PlaySubtitleInfo" status = "generate" final_type = true [[object]] name = "GstPlay.PlayVideoInfo" status = "generate" final_type = true [[object.function]] name = "get_framerate" # Fraction manual = true [[object.function]] name = "get_pixel_aspect_ratio" # Fraction manual = true [[object]] name = "GstPlay.PlayVideoOverlayVideoRenderer" status = "generate" final_type = true [[object.function]] name = "new" manual = true [[object.function]] name = "new_with_sink" # with_handle_and_sink() also calls this. rename = "with_sink" manual = true [[object.function]] name = "get_window_handle" manual = true [[object.function]] name = "set_window_handle" manual = true gstreamer-play-0.23.5/LICENSE-APACHE000064400000000000000000000000211046102023000145640ustar 00000000000000../LICENSE-APACHEgstreamer-play-0.23.5/LICENSE-MIT000064400000000000000000000000161046102023000143000ustar 00000000000000../LICENSE-MITgstreamer-play-0.23.5/README.md000064400000000000000000000176621046102023000141420ustar 00000000000000# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-play.svg)](https://crates.io/crates/gstreamer-play) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/main/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/main) [GStreamer](https://gstreamer.freedesktop.org/) (Play library) bindings for Rust. Documentation can be found [here](https://gstreamer.freedesktop.org/documentation/rust/stable/latest/docs/gstreamer_play/). These bindings are providing a safe API that can be used to interface with GStreamer, e.g. for writing GStreamer-based applications and GStreamer plugins. The bindings are mostly autogenerated with [gir](https://github.com/gtk-rs/gir/) based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/) API metadata provided by the GStreamer project. ## Table of Contents 1. [Installation](#installation) 1. [Linux/BSDs](#installation-linux) 1. [macOS](#installation-macos) 1. [Windows](#installation-windows) 1. [Getting Started](#getting-started) 1. [License](#license) 1. [Contribution](#contribution) ## Installation To build the GStreamer bindings or anything depending on them, you need to have at least GStreamer 1.14 and gst-plugins-base 1.14 installed. In addition, some of the examples/tutorials require various GStreamer plugins to be available, which can be found in gst-plugins-base, gst-plugins-good, gst-plugins-bad, gst-plugins-ugly and/or gst-libav. ### Linux/BSDs You need to install the above mentioned packages with your distributions package manager, or build them from source. On Debian/Ubuntu they can be installed with ```console $ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ gstreamer1.0-libav libgstrtspserver-1.0-dev libges-1.0-dev ``` The minimum required version of the above libraries is >= 1.14. If you build the gstreamer-play sub-crate, or any of the examples that depend on gstreamer-play, you must ensure that in addition to the above packages, `libgstreamer-plugins-bad1.0-dev` is installed. See the `Cargo.toml` files for the full details, ```console $ apt-get install libgstreamer-plugins-bad1.0-dev ``` Package names on other distributions should be similar. Please submit a pull request with instructions for yours. ### macOS You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/) provided by the GStreamer project. We recommend using the official GStreamer binaries over Homebrew, especially as GStreamer in Homebrew is [currently broken](https://github.com/orgs/Homebrew/discussions/3740#discussioncomment-3804964). #### GStreamer Binaries You need to download the *two* `.pkg` files from the GStreamer website and install them, e.g. `gstreamer-1.0-1.20.4-universal.pkg` and `gstreamer-1.0-devel-1.20.4-universal.pkg`. After installation, you also need to set the `PATH` environment variable as follows ```console $ export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}" ``` Also note that the `pkg-config` from GStreamer should be the first one in the `PATH` as other versions have all kinds of quirks that will cause problems. #### Homebrew Homebrew only installs various plugins if explicitly enabled, so some extra `--with-*` flags may be required. ```console $ brew install gstreamer gst-plugins-base gst-plugins-good \ gst-plugins-bad gst-plugins-ugly gst-libav gst-rtsp-server \ gst-editing-services --with-orc --with-libogg --with-opus \ --with-pango --with-theora --with-libvorbis --with-libvpx \ --enable-gtk3 ``` Make sure the version of these libraries is >= 1.14. ### Windows You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/) with `pacman` or by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by the GStreamer project. We recommend using the official GStreamer binaries over MSYS2. #### GStreamer Binaries You need to download the *two* `.msi` files for your platform from the GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.20.4.msi` and `gstreamer-1.0-devel-x86_64-1.20.4.msi`. Make sure to select the version that matches your Rust toolchain, i.e. MinGW or MSVC. After installation set the ``PATH` environment variable as follows: ```console # For a UNIX-style shell: $ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}" # For cmd.exe: $ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH% ``` Make sure to update the path to where you have actually installed GStreamer and for the corresponding toolchain. Also note that the `pkg-config.exe` from GStreamer should be the first one in the `PATH` as other versions have all kinds of quirks that will cause problems. #### MSYS2 / pacman ```console $ pacman -S glib2-devel pkg-config \ mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \ mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \ mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav \ mingw-w64-x86_64-gst-rtsp-server ``` Make sure the version of these libraries is >= 1.14. Note that the version of `pkg-config` included in `MSYS2` is [known to have problems](https://github.com/rust-lang/pkg-config-rs/issues/51#issuecomment-346300858) compiling GStreamer, so you may need to install another version. One option would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/). ## Getting Started The API reference can be found [here](https://gstreamer.freedesktop.org/documentation/rust/stable/latest/docs/gstreamer/), however it is only the Rust API reference and does not explain any of the concepts. For getting started with GStreamer development, the best would be to follow the [documentation](https://gstreamer.freedesktop.org/documentation/) on the GStreamer website, especially the [Application Development Manual](https://gstreamer.freedesktop.org/documentation/application-development/). While being C-centric, it explains all the fundamental concepts of GStreamer and the code examples should be relatively easily translatable to Rust. The API is basically the same, function/struct names are the same and everything is only more convenient (hopefully) and safer. In addition there are [tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the GStreamer website. Many of them were ported to Rust already and the code can be found in the [tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/main/tutorials) directory. Some further examples for various aspects of GStreamer and how to use it from Rust can be found in the [examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/main/examples) directory. Various GStreamer plugins written in Rust can be found in the [gst-plugins-rs](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs) repository. ## LICENSE gstreamer-rs and all crates contained in here are licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. GStreamer itself is licensed under the Lesser General Public License version 2.1 or (at your option) any later version: https://www.gnu.org/licenses/lgpl-2.1.html ## Contribution Any kinds of contributions are welcome as a pull request. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. gstreamer-play-0.23.5/src/auto/enums.rs000064400000000000000000000576171046102023000161230ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, PlayMediaInfo}; use glib::{prelude::*, translate::*, GStr}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPlayColorBalanceType")] pub enum PlayColorBalanceType { #[doc(alias = "GST_PLAY_COLOR_BALANCE_HUE")] Hue, #[doc(alias = "GST_PLAY_COLOR_BALANCE_BRIGHTNESS")] Brightness, #[doc(alias = "GST_PLAY_COLOR_BALANCE_SATURATION")] Saturation, #[doc(alias = "GST_PLAY_COLOR_BALANCE_CONTRAST")] Contrast, #[doc(hidden)] __Unknown(i32), } impl PlayColorBalanceType { pub fn name<'a>(self) -> &'a GStr { unsafe { GStr::from_ptr( ffi::gst_play_color_balance_type_get_name(self.into_glib()) .as_ref() .expect("gst_play_color_balance_type_get_name returned NULL"), ) } } } impl std::fmt::Display for PlayColorBalanceType { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.name()) } } #[doc(hidden)] impl IntoGlib for PlayColorBalanceType { type GlibType = ffi::GstPlayColorBalanceType; #[inline] fn into_glib(self) -> ffi::GstPlayColorBalanceType { match self { Self::Hue => ffi::GST_PLAY_COLOR_BALANCE_HUE, Self::Brightness => ffi::GST_PLAY_COLOR_BALANCE_BRIGHTNESS, Self::Saturation => ffi::GST_PLAY_COLOR_BALANCE_SATURATION, Self::Contrast => ffi::GST_PLAY_COLOR_BALANCE_CONTRAST, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PlayColorBalanceType { #[inline] unsafe fn from_glib(value: ffi::GstPlayColorBalanceType) -> Self { skip_assert_initialized!(); match value { ffi::GST_PLAY_COLOR_BALANCE_HUE => Self::Hue, ffi::GST_PLAY_COLOR_BALANCE_BRIGHTNESS => Self::Brightness, ffi::GST_PLAY_COLOR_BALANCE_SATURATION => Self::Saturation, ffi::GST_PLAY_COLOR_BALANCE_CONTRAST => Self::Contrast, value => Self::__Unknown(value), } } } impl StaticType for PlayColorBalanceType { #[inline] #[doc(alias = "gst_play_color_balance_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gst_play_color_balance_type_get_type()) } } } impl glib::HasParamSpec for PlayColorBalanceType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PlayColorBalanceType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PlayColorBalanceType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PlayColorBalanceType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PlayColorBalanceType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPlayError")] pub enum PlayError { #[doc(alias = "GST_PLAY_ERROR_FAILED")] Failed, #[doc(hidden)] __Unknown(i32), } impl PlayError { pub fn name<'a>(self) -> &'a GStr { unsafe { GStr::from_ptr( ffi::gst_play_error_get_name(self.into_glib()) .as_ref() .expect("gst_play_error_get_name returned NULL"), ) } } } impl std::fmt::Display for PlayError { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.name()) } } #[doc(hidden)] impl IntoGlib for PlayError { type GlibType = ffi::GstPlayError; #[inline] fn into_glib(self) -> ffi::GstPlayError { match self { Self::Failed => ffi::GST_PLAY_ERROR_FAILED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PlayError { #[inline] unsafe fn from_glib(value: ffi::GstPlayError) -> Self { skip_assert_initialized!(); match value { ffi::GST_PLAY_ERROR_FAILED => Self::Failed, value => Self::__Unknown(value), } } } impl glib::error::ErrorDomain for PlayError { #[inline] fn domain() -> glib::Quark { skip_assert_initialized!(); unsafe { from_glib(ffi::gst_play_error_quark()) } } #[inline] fn code(self) -> i32 { self.into_glib() } #[inline] #[allow(clippy::match_single_binding)] fn from(code: i32) -> Option { skip_assert_initialized!(); match unsafe { from_glib(code) } { Self::__Unknown(_) => Some(Self::Failed), value => Some(value), } } } impl StaticType for PlayError { #[inline] #[doc(alias = "gst_play_error_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gst_play_error_get_type()) } } } impl glib::HasParamSpec for PlayError { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PlayError { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PlayError { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PlayError { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PlayError) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPlayMessage")] pub(crate) enum PlayMessage { #[doc(alias = "GST_PLAY_MESSAGE_URI_LOADED")] UriLoaded, #[doc(alias = "GST_PLAY_MESSAGE_POSITION_UPDATED")] PositionUpdated, #[doc(alias = "GST_PLAY_MESSAGE_DURATION_CHANGED")] DurationChanged, #[doc(alias = "GST_PLAY_MESSAGE_STATE_CHANGED")] StateChanged, #[doc(alias = "GST_PLAY_MESSAGE_BUFFERING")] Buffering, #[doc(alias = "GST_PLAY_MESSAGE_END_OF_STREAM")] EndOfStream, #[doc(alias = "GST_PLAY_MESSAGE_ERROR")] Error, #[doc(alias = "GST_PLAY_MESSAGE_WARNING")] Warning, #[doc(alias = "GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED")] VideoDimensionsChanged, #[doc(alias = "GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED")] MediaInfoUpdated, #[doc(alias = "GST_PLAY_MESSAGE_VOLUME_CHANGED")] VolumeChanged, #[doc(alias = "GST_PLAY_MESSAGE_MUTE_CHANGED")] MuteChanged, #[doc(alias = "GST_PLAY_MESSAGE_SEEK_DONE")] SeekDone, #[doc(hidden)] __Unknown(i32), } impl PlayMessage { pub fn name<'a>(self) -> &'a GStr { unsafe { GStr::from_ptr( ffi::gst_play_message_get_name(self.into_glib()) .as_ref() .expect("gst_play_message_get_name returned NULL"), ) } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_message_parse_buffering")] pub fn parse_buffering(msg: &gst::Message) -> u32 { assert_initialized_main_thread!(); unsafe { let mut percent = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_buffering(msg.to_glib_none().0, percent.as_mut_ptr()); percent.assume_init() } } #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")] #[allow(deprecated)] #[doc(alias = "gst_play_message_parse_buffering_percent")] pub fn parse_buffering_percent(msg: &gst::Message) -> u32 { assert_initialized_main_thread!(); unsafe { let mut percent = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_buffering_percent( msg.to_glib_none().0, percent.as_mut_ptr(), ); percent.assume_init() } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_message_parse_duration_changed")] pub fn parse_duration_changed(msg: &gst::Message) -> Option { assert_initialized_main_thread!(); unsafe { let mut duration = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_duration_changed( msg.to_glib_none().0, duration.as_mut_ptr(), ); from_glib(duration.assume_init()) } } #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")] #[allow(deprecated)] #[doc(alias = "gst_play_message_parse_duration_updated")] pub fn parse_duration_updated(msg: &gst::Message) -> Option { assert_initialized_main_thread!(); unsafe { let mut duration = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_duration_updated( msg.to_glib_none().0, duration.as_mut_ptr(), ); from_glib(duration.assume_init()) } } #[doc(alias = "gst_play_message_parse_error")] pub fn parse_error(msg: &gst::Message) -> (glib::Error, Option) { assert_initialized_main_thread!(); unsafe { let mut error = std::ptr::null_mut(); let mut details = std::ptr::null_mut(); ffi::gst_play_message_parse_error(msg.to_glib_none().0, &mut error, &mut details); (from_glib_full(error), from_glib_full(details)) } } #[doc(alias = "gst_play_message_parse_media_info_updated")] pub fn parse_media_info_updated(msg: &gst::Message) -> PlayMediaInfo { assert_initialized_main_thread!(); unsafe { let mut info = std::ptr::null_mut(); ffi::gst_play_message_parse_media_info_updated(msg.to_glib_none().0, &mut info); from_glib_full(info) } } #[doc(alias = "gst_play_message_parse_muted_changed")] pub fn parse_muted_changed(msg: &gst::Message) -> bool { assert_initialized_main_thread!(); unsafe { let mut muted = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_muted_changed(msg.to_glib_none().0, muted.as_mut_ptr()); from_glib(muted.assume_init()) } } #[doc(alias = "gst_play_message_parse_position_updated")] pub fn parse_position_updated(msg: &gst::Message) -> Option { assert_initialized_main_thread!(); unsafe { let mut position = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_position_updated( msg.to_glib_none().0, position.as_mut_ptr(), ); from_glib(position.assume_init()) } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_message_parse_seek_done")] pub fn parse_seek_done(msg: &gst::Message) -> Option { assert_initialized_main_thread!(); unsafe { let mut position = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_seek_done(msg.to_glib_none().0, position.as_mut_ptr()); from_glib(position.assume_init()) } } #[doc(alias = "gst_play_message_parse_state_changed")] pub fn parse_state_changed(msg: &gst::Message) -> PlayState { assert_initialized_main_thread!(); unsafe { let mut state = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_state_changed(msg.to_glib_none().0, state.as_mut_ptr()); from_glib(state.assume_init()) } } #[doc(alias = "gst_play_message_parse_type")] pub fn parse_type(msg: &gst::Message) -> PlayMessage { assert_initialized_main_thread!(); unsafe { let mut type_ = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_type(msg.to_glib_none().0, type_.as_mut_ptr()); from_glib(type_.assume_init()) } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_message_parse_uri_loaded")] pub fn parse_uri_loaded(msg: &gst::Message) -> glib::GString { assert_initialized_main_thread!(); unsafe { let mut uri = std::ptr::null_mut(); ffi::gst_play_message_parse_uri_loaded(msg.to_glib_none().0, &mut uri); from_glib_full(uri) } } #[doc(alias = "gst_play_message_parse_video_dimensions_changed")] pub fn parse_video_dimensions_changed(msg: &gst::Message) -> (u32, u32) { assert_initialized_main_thread!(); unsafe { let mut width = std::mem::MaybeUninit::uninit(); let mut height = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_video_dimensions_changed( msg.to_glib_none().0, width.as_mut_ptr(), height.as_mut_ptr(), ); (width.assume_init(), height.assume_init()) } } #[doc(alias = "gst_play_message_parse_volume_changed")] pub fn parse_volume_changed(msg: &gst::Message) -> f64 { assert_initialized_main_thread!(); unsafe { let mut volume = std::mem::MaybeUninit::uninit(); ffi::gst_play_message_parse_volume_changed(msg.to_glib_none().0, volume.as_mut_ptr()); volume.assume_init() } } #[doc(alias = "gst_play_message_parse_warning")] pub fn parse_warning(msg: &gst::Message) -> (glib::Error, Option) { assert_initialized_main_thread!(); unsafe { let mut error = std::ptr::null_mut(); let mut details = std::ptr::null_mut(); ffi::gst_play_message_parse_warning(msg.to_glib_none().0, &mut error, &mut details); (from_glib_full(error), from_glib_full(details)) } } } impl std::fmt::Display for PlayMessage { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.name()) } } #[doc(hidden)] impl IntoGlib for PlayMessage { type GlibType = ffi::GstPlayMessage; fn into_glib(self) -> ffi::GstPlayMessage { match self { Self::UriLoaded => ffi::GST_PLAY_MESSAGE_URI_LOADED, Self::PositionUpdated => ffi::GST_PLAY_MESSAGE_POSITION_UPDATED, Self::DurationChanged => ffi::GST_PLAY_MESSAGE_DURATION_CHANGED, Self::StateChanged => ffi::GST_PLAY_MESSAGE_STATE_CHANGED, Self::Buffering => ffi::GST_PLAY_MESSAGE_BUFFERING, Self::EndOfStream => ffi::GST_PLAY_MESSAGE_END_OF_STREAM, Self::Error => ffi::GST_PLAY_MESSAGE_ERROR, Self::Warning => ffi::GST_PLAY_MESSAGE_WARNING, Self::VideoDimensionsChanged => ffi::GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED, Self::MediaInfoUpdated => ffi::GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED, Self::VolumeChanged => ffi::GST_PLAY_MESSAGE_VOLUME_CHANGED, Self::MuteChanged => ffi::GST_PLAY_MESSAGE_MUTE_CHANGED, Self::SeekDone => ffi::GST_PLAY_MESSAGE_SEEK_DONE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PlayMessage { unsafe fn from_glib(value: ffi::GstPlayMessage) -> Self { skip_assert_initialized!(); match value { ffi::GST_PLAY_MESSAGE_URI_LOADED => Self::UriLoaded, ffi::GST_PLAY_MESSAGE_POSITION_UPDATED => Self::PositionUpdated, ffi::GST_PLAY_MESSAGE_DURATION_CHANGED => Self::DurationChanged, ffi::GST_PLAY_MESSAGE_STATE_CHANGED => Self::StateChanged, ffi::GST_PLAY_MESSAGE_BUFFERING => Self::Buffering, ffi::GST_PLAY_MESSAGE_END_OF_STREAM => Self::EndOfStream, ffi::GST_PLAY_MESSAGE_ERROR => Self::Error, ffi::GST_PLAY_MESSAGE_WARNING => Self::Warning, ffi::GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED => Self::VideoDimensionsChanged, ffi::GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED => Self::MediaInfoUpdated, ffi::GST_PLAY_MESSAGE_VOLUME_CHANGED => Self::VolumeChanged, ffi::GST_PLAY_MESSAGE_MUTE_CHANGED => Self::MuteChanged, ffi::GST_PLAY_MESSAGE_SEEK_DONE => Self::SeekDone, value => Self::__Unknown(value), } } } impl StaticType for PlayMessage { #[inline] #[doc(alias = "gst_play_message_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gst_play_message_get_type()) } } } impl glib::HasParamSpec for PlayMessage { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PlayMessage { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PlayMessage { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PlayMessage { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PlayMessage) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPlaySnapshotFormat")] pub enum PlaySnapshotFormat { #[doc(alias = "GST_PLAY_THUMBNAIL_RAW_NATIVE")] RawNative, #[doc(alias = "GST_PLAY_THUMBNAIL_RAW_xRGB")] RawXrgb, #[doc(alias = "GST_PLAY_THUMBNAIL_RAW_BGRx")] RawBgrx, #[doc(alias = "GST_PLAY_THUMBNAIL_JPG")] Jpg, #[doc(alias = "GST_PLAY_THUMBNAIL_PNG")] Png, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PlaySnapshotFormat { type GlibType = ffi::GstPlaySnapshotFormat; #[inline] fn into_glib(self) -> ffi::GstPlaySnapshotFormat { match self { Self::RawNative => ffi::GST_PLAY_THUMBNAIL_RAW_NATIVE, Self::RawXrgb => ffi::GST_PLAY_THUMBNAIL_RAW_xRGB, Self::RawBgrx => ffi::GST_PLAY_THUMBNAIL_RAW_BGRx, Self::Jpg => ffi::GST_PLAY_THUMBNAIL_JPG, Self::Png => ffi::GST_PLAY_THUMBNAIL_PNG, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PlaySnapshotFormat { #[inline] unsafe fn from_glib(value: ffi::GstPlaySnapshotFormat) -> Self { skip_assert_initialized!(); match value { ffi::GST_PLAY_THUMBNAIL_RAW_NATIVE => Self::RawNative, ffi::GST_PLAY_THUMBNAIL_RAW_xRGB => Self::RawXrgb, ffi::GST_PLAY_THUMBNAIL_RAW_BGRx => Self::RawBgrx, ffi::GST_PLAY_THUMBNAIL_JPG => Self::Jpg, ffi::GST_PLAY_THUMBNAIL_PNG => Self::Png, value => Self::__Unknown(value), } } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPlayState")] pub enum PlayState { #[doc(alias = "GST_PLAY_STATE_STOPPED")] Stopped, #[doc(alias = "GST_PLAY_STATE_BUFFERING")] Buffering, #[doc(alias = "GST_PLAY_STATE_PAUSED")] Paused, #[doc(alias = "GST_PLAY_STATE_PLAYING")] Playing, #[doc(hidden)] __Unknown(i32), } impl PlayState { pub fn name<'a>(self) -> &'a GStr { unsafe { GStr::from_ptr( ffi::gst_play_state_get_name(self.into_glib()) .as_ref() .expect("gst_play_state_get_name returned NULL"), ) } } } impl std::fmt::Display for PlayState { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.name()) } } #[doc(hidden)] impl IntoGlib for PlayState { type GlibType = ffi::GstPlayState; #[inline] fn into_glib(self) -> ffi::GstPlayState { match self { Self::Stopped => ffi::GST_PLAY_STATE_STOPPED, Self::Buffering => ffi::GST_PLAY_STATE_BUFFERING, Self::Paused => ffi::GST_PLAY_STATE_PAUSED, Self::Playing => ffi::GST_PLAY_STATE_PLAYING, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PlayState { #[inline] unsafe fn from_glib(value: ffi::GstPlayState) -> Self { skip_assert_initialized!(); match value { ffi::GST_PLAY_STATE_STOPPED => Self::Stopped, ffi::GST_PLAY_STATE_BUFFERING => Self::Buffering, ffi::GST_PLAY_STATE_PAUSED => Self::Paused, ffi::GST_PLAY_STATE_PLAYING => Self::Playing, value => Self::__Unknown(value), } } } impl StaticType for PlayState { #[inline] #[doc(alias = "gst_play_state_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::gst_play_state_get_type()) } } } impl glib::HasParamSpec for PlayState { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PlayState { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PlayState { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PlayState { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PlayState) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } gstreamer-play-0.23.5/src/auto/mod.rs000064400000000000000000000024401046102023000155330ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT mod play; pub use self::play::Play; mod play_audio_info; pub use self::play_audio_info::PlayAudioInfo; mod play_media_info; pub use self::play_media_info::PlayMediaInfo; mod play_signal_adapter; pub use self::play_signal_adapter::PlaySignalAdapter; mod play_stream_info; pub use self::play_stream_info::PlayStreamInfo; mod play_subtitle_info; pub use self::play_subtitle_info::PlaySubtitleInfo; mod play_video_info; pub use self::play_video_info::PlayVideoInfo; mod play_video_overlay_video_renderer; pub use self::play_video_overlay_video_renderer::PlayVideoOverlayVideoRenderer; mod play_video_renderer; pub use self::play_video_renderer::PlayVideoRenderer; mod play_visualization; pub use self::play_visualization::PlayVisualization; mod enums; pub use self::enums::PlayColorBalanceType; pub use self::enums::PlayError; pub(crate) use self::enums::PlayMessage; pub use self::enums::PlaySnapshotFormat; pub use self::enums::PlayState; pub(crate) mod traits { pub use super::play_stream_info::PlayStreamInfoExt; pub use super::play_video_renderer::PlayVideoRendererExt; } gstreamer-play-0.23.5/src/auto/play.rs000064400000000000000000001003761046102023000157300ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #![allow(deprecated)] use crate::{ ffi, PlayAudioInfo, PlayColorBalanceType, PlayMediaInfo, PlaySubtitleInfo, PlayVideoInfo, PlayVideoRenderer, PlayVisualization, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "GstPlay")] pub struct Play(Object) @extends gst::Object; match fn { type_ => || ffi::gst_play_get_type(), } } impl Play { #[doc(alias = "gst_play_new")] pub fn new(video_renderer: Option>) -> Play { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gst_play_new( video_renderer.map(|p| p.upcast()).into_glib_ptr(), )) } } #[doc(alias = "gst_play_get_audio_video_offset")] #[doc(alias = "get_audio_video_offset")] #[doc(alias = "audio-video-offset")] pub fn audio_video_offset(&self) -> i64 { unsafe { ffi::gst_play_get_audio_video_offset(self.to_glib_none().0) } } #[doc(alias = "gst_play_get_color_balance")] #[doc(alias = "get_color_balance")] pub fn color_balance(&self, type_: PlayColorBalanceType) -> f64 { unsafe { ffi::gst_play_get_color_balance(self.to_glib_none().0, type_.into_glib()) } } #[doc(alias = "gst_play_get_current_audio_track")] #[doc(alias = "get_current_audio_track")] #[doc(alias = "current-audio-track")] pub fn current_audio_track(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_current_audio_track(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_current_subtitle_track")] #[doc(alias = "get_current_subtitle_track")] #[doc(alias = "current-subtitle-track")] pub fn current_subtitle_track(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_current_subtitle_track( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_get_current_video_track")] #[doc(alias = "get_current_video_track")] #[doc(alias = "current-video-track")] pub fn current_video_track(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_current_video_track(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_current_visualization")] #[doc(alias = "get_current_visualization")] pub fn current_visualization(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_current_visualization( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_get_duration")] #[doc(alias = "get_duration")] pub fn duration(&self) -> Option { unsafe { from_glib(ffi::gst_play_get_duration(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_media_info")] #[doc(alias = "get_media_info")] #[doc(alias = "media-info")] pub fn media_info(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_media_info(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_message_bus")] #[doc(alias = "get_message_bus")] pub fn message_bus(&self) -> gst::Bus { unsafe { from_glib_full(ffi::gst_play_get_message_bus(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_multiview_flags")] #[doc(alias = "get_multiview_flags")] pub fn multiview_flags(&self) -> gst_video::VideoMultiviewFlags { unsafe { from_glib(ffi::gst_play_get_multiview_flags(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_multiview_mode")] #[doc(alias = "get_multiview_mode")] pub fn multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking { unsafe { from_glib(ffi::gst_play_get_multiview_mode(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_mute")] #[doc(alias = "get_mute")] #[doc(alias = "mute")] pub fn is_muted(&self) -> bool { unsafe { from_glib(ffi::gst_play_get_mute(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_pipeline")] #[doc(alias = "get_pipeline")] pub fn pipeline(&self) -> gst::Element { unsafe { from_glib_full(ffi::gst_play_get_pipeline(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_position")] #[doc(alias = "get_position")] pub fn position(&self) -> Option { unsafe { from_glib(ffi::gst_play_get_position(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_rate")] #[doc(alias = "get_rate")] pub fn rate(&self) -> f64 { unsafe { ffi::gst_play_get_rate(self.to_glib_none().0) } } #[doc(alias = "gst_play_get_subtitle_uri")] #[doc(alias = "get_subtitle_uri")] pub fn subtitle_uri(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_subtitle_uri(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_subtitle_video_offset")] #[doc(alias = "get_subtitle_video_offset")] #[doc(alias = "subtitle-video-offset")] pub fn subtitle_video_offset(&self) -> i64 { unsafe { ffi::gst_play_get_subtitle_video_offset(self.to_glib_none().0) } } #[doc(alias = "gst_play_get_uri")] #[doc(alias = "get_uri")] pub fn uri(&self) -> Option { unsafe { from_glib_full(ffi::gst_play_get_uri(self.to_glib_none().0)) } } #[doc(alias = "gst_play_get_volume")] #[doc(alias = "get_volume")] pub fn volume(&self) -> f64 { unsafe { ffi::gst_play_get_volume(self.to_glib_none().0) } } #[doc(alias = "gst_play_has_color_balance")] pub fn has_color_balance(&self) -> bool { unsafe { from_glib(ffi::gst_play_has_color_balance(self.to_glib_none().0)) } } #[doc(alias = "gst_play_pause")] pub fn pause(&self) { unsafe { ffi::gst_play_pause(self.to_glib_none().0); } } #[doc(alias = "gst_play_play")] pub fn play(&self) { unsafe { ffi::gst_play_play(self.to_glib_none().0); } } #[doc(alias = "gst_play_seek")] pub fn seek(&self, position: gst::ClockTime) { unsafe { ffi::gst_play_seek(self.to_glib_none().0, position.into_glib()); } } #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")] #[allow(deprecated)] #[doc(alias = "gst_play_set_audio_track")] pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_audio_track(self.to_glib_none().0, stream_index), "Failed to set audio track" ) } } #[doc(alias = "gst_play_set_audio_track_enabled")] pub fn set_audio_track_enabled(&self, enabled: bool) { unsafe { ffi::gst_play_set_audio_track_enabled(self.to_glib_none().0, enabled.into_glib()); } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_set_audio_track_id")] pub fn set_audio_track_id( &self, stream_id: Option<&str>, ) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_audio_track_id(self.to_glib_none().0, stream_id.to_glib_none().0), "Failed to set audio track" ) } } #[doc(alias = "gst_play_set_audio_video_offset")] #[doc(alias = "audio-video-offset")] pub fn set_audio_video_offset(&self, offset: i64) { unsafe { ffi::gst_play_set_audio_video_offset(self.to_glib_none().0, offset); } } #[doc(alias = "gst_play_set_color_balance")] pub fn set_color_balance(&self, type_: PlayColorBalanceType, value: f64) { unsafe { ffi::gst_play_set_color_balance(self.to_glib_none().0, type_.into_glib(), value); } } #[doc(alias = "gst_play_set_multiview_flags")] pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) { unsafe { ffi::gst_play_set_multiview_flags(self.to_glib_none().0, flags.into_glib()); } } #[doc(alias = "gst_play_set_multiview_mode")] pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) { unsafe { ffi::gst_play_set_multiview_mode(self.to_glib_none().0, mode.into_glib()); } } #[doc(alias = "gst_play_set_mute")] #[doc(alias = "mute")] pub fn set_mute(&self, val: bool) { unsafe { ffi::gst_play_set_mute(self.to_glib_none().0, val.into_glib()); } } #[doc(alias = "gst_play_set_rate")] #[doc(alias = "rate")] pub fn set_rate(&self, rate: f64) { unsafe { ffi::gst_play_set_rate(self.to_glib_none().0, rate); } } #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")] #[allow(deprecated)] #[doc(alias = "gst_play_set_subtitle_track")] pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_subtitle_track(self.to_glib_none().0, stream_index), "Failed to set subtitle track" ) } } #[doc(alias = "gst_play_set_subtitle_track_enabled")] pub fn set_subtitle_track_enabled(&self, enabled: bool) { unsafe { ffi::gst_play_set_subtitle_track_enabled(self.to_glib_none().0, enabled.into_glib()); } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_set_subtitle_track_id")] pub fn set_subtitle_track_id( &self, stream_id: Option<&str>, ) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_subtitle_track_id( self.to_glib_none().0, stream_id.to_glib_none().0 ), "Failed to set subtitle track" ) } } #[doc(alias = "gst_play_set_subtitle_uri")] pub fn set_subtitle_uri(&self, uri: Option<&str>) { unsafe { ffi::gst_play_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0); } } #[doc(alias = "gst_play_set_subtitle_video_offset")] #[doc(alias = "subtitle-video-offset")] pub fn set_subtitle_video_offset(&self, offset: i64) { unsafe { ffi::gst_play_set_subtitle_video_offset(self.to_glib_none().0, offset); } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_set_track_ids")] pub fn set_track_ids( &self, audio_stream_id: Option<&str>, video_stream_id: Option<&str>, subtitle_stream_id: Option<&str>, ) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_track_ids( self.to_glib_none().0, audio_stream_id.to_glib_none().0, video_stream_id.to_glib_none().0, subtitle_stream_id.to_glib_none().0 ), "Failed to set tracks" ) } } #[doc(alias = "gst_play_set_uri")] #[doc(alias = "uri")] pub fn set_uri(&self, uri: Option<&str>) { unsafe { ffi::gst_play_set_uri(self.to_glib_none().0, uri.to_glib_none().0); } } #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")] #[allow(deprecated)] #[doc(alias = "gst_play_set_video_track")] pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_video_track(self.to_glib_none().0, stream_index), "Failed to set video track" ) } } #[doc(alias = "gst_play_set_video_track_enabled")] pub fn set_video_track_enabled(&self, enabled: bool) { unsafe { ffi::gst_play_set_video_track_enabled(self.to_glib_none().0, enabled.into_glib()); } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_set_video_track_id")] pub fn set_video_track_id( &self, stream_id: Option<&str>, ) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_video_track_id(self.to_glib_none().0, stream_id.to_glib_none().0), "Failed to set video track" ) } } #[doc(alias = "gst_play_set_visualization")] pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_visualization(self.to_glib_none().0, name.to_glib_none().0), "Failed to set visualization" ) } } #[doc(alias = "gst_play_set_visualization_enabled")] pub fn set_visualization_enabled(&self, enabled: bool) { unsafe { ffi::gst_play_set_visualization_enabled(self.to_glib_none().0, enabled.into_glib()); } } #[doc(alias = "gst_play_set_volume")] #[doc(alias = "volume")] pub fn set_volume(&self, val: f64) { unsafe { ffi::gst_play_set_volume(self.to_glib_none().0, val); } } #[doc(alias = "gst_play_stop")] pub fn stop(&self) { unsafe { ffi::gst_play_stop(self.to_glib_none().0); } } pub fn suburi(&self) -> Option { ObjectExt::property(self, "suburi") } pub fn set_suburi(&self, suburi: Option<&str>) { ObjectExt::set_property(self, "suburi", suburi) } #[doc(alias = "video-multiview-flags")] pub fn video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags { ObjectExt::property(self, "video-multiview-flags") } #[doc(alias = "video-multiview-flags")] pub fn set_video_multiview_flags(&self, video_multiview_flags: gst_video::VideoMultiviewFlags) { ObjectExt::set_property(self, "video-multiview-flags", video_multiview_flags) } #[doc(alias = "video-multiview-mode")] pub fn video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking { ObjectExt::property(self, "video-multiview-mode") } #[doc(alias = "video-multiview-mode")] pub fn set_video_multiview_mode( &self, video_multiview_mode: gst_video::VideoMultiviewFramePacking, ) { ObjectExt::set_property(self, "video-multiview-mode", video_multiview_mode) } #[doc(alias = "video-renderer")] pub fn video_renderer(&self) -> Option { ObjectExt::property(self, "video-renderer") } #[doc(alias = "video-renderer")] pub fn set_video_renderer>(&self, video_renderer: Option<&P>) { ObjectExt::set_property(self, "video-renderer", video_renderer) } #[doc(alias = "gst_play_get_audio_streams")] #[doc(alias = "get_audio_streams")] pub fn audio_streams(info: &PlayMediaInfo) -> Vec { skip_assert_initialized!(); unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_audio_streams( info.to_glib_none().0, )) } } #[doc(alias = "gst_play_get_subtitle_streams")] #[doc(alias = "get_subtitle_streams")] pub fn subtitle_streams(info: &PlayMediaInfo) -> Vec { skip_assert_initialized!(); unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_subtitle_streams( info.to_glib_none().0, )) } } #[doc(alias = "gst_play_get_video_streams")] #[doc(alias = "get_video_streams")] pub fn video_streams(info: &PlayMediaInfo) -> Vec { skip_assert_initialized!(); unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_video_streams( info.to_glib_none().0, )) } } #[doc(alias = "gst_play_is_play_message")] pub fn is_play_message(msg: &gst::Message) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gst_play_is_play_message(msg.to_glib_none().0)) } } #[doc(alias = "gst_play_visualizations_get")] pub fn visualizations_get() -> Vec { assert_initialized_main_thread!(); unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_play_visualizations_get()) } } #[doc(alias = "audio-video-offset")] pub fn connect_audio_video_offset_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_audio_video_offset_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::audio-video-offset\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_audio_video_offset_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "current-audio-track")] pub fn connect_current_audio_track_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_current_audio_track_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::current-audio-track\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_current_audio_track_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "current-subtitle-track")] pub fn connect_current_subtitle_track_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_current_subtitle_track_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::current-subtitle-track\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_current_subtitle_track_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "current-video-track")] pub fn connect_current_video_track_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_current_video_track_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::current-video-track\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_current_video_track_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "duration")] pub fn connect_duration_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "media-info")] pub fn connect_media_info_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_media_info_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::media-info\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_media_info_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "mute")] pub fn connect_mute_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_mute_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_mute_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "pipeline")] pub fn connect_pipeline_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_pipeline_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::pipeline\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_pipeline_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "position")] pub fn connect_position_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_position_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::position\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_position_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "rate")] pub fn connect_rate_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_rate_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::rate\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_rate_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtitle-video-offset")] pub fn connect_subtitle_video_offset_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_subtitle_video_offset_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::subtitle-video-offset\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_subtitle_video_offset_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "suburi")] pub fn connect_suburi_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_suburi_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::suburi\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_suburi_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "uri")] pub fn connect_uri_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_uri_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::uri\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_uri_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "video-multiview-flags")] pub fn connect_video_multiview_flags_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_video_multiview_flags_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::video-multiview-flags\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_video_multiview_flags_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "video-multiview-mode")] pub fn connect_video_multiview_mode_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_video_multiview_mode_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::video-multiview-mode\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_video_multiview_mode_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "video-renderer")] pub fn connect_video_renderer_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_video_renderer_trampoline< F: Fn(&Play) + Send + Sync + 'static, >( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::video-renderer\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_video_renderer_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "volume")] pub fn connect_volume_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_volume_trampoline( this: *mut ffi::GstPlay, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_volume_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } unsafe impl Send for Play {} unsafe impl Sync for Play {} gstreamer-play-0.23.5/src/auto/play_audio_info.rs000064400000000000000000000033241046102023000201170ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, PlayStreamInfo}; use glib::translate::*; glib::wrapper! { #[doc(alias = "GstPlayAudioInfo")] pub struct PlayAudioInfo(Object) @extends PlayStreamInfo; match fn { type_ => || ffi::gst_play_audio_info_get_type(), } } impl PlayAudioInfo { #[doc(alias = "gst_play_audio_info_get_bitrate")] #[doc(alias = "get_bitrate")] pub fn bitrate(&self) -> i32 { unsafe { ffi::gst_play_audio_info_get_bitrate(self.to_glib_none().0) } } #[doc(alias = "gst_play_audio_info_get_channels")] #[doc(alias = "get_channels")] pub fn channels(&self) -> i32 { unsafe { ffi::gst_play_audio_info_get_channels(self.to_glib_none().0) } } #[doc(alias = "gst_play_audio_info_get_language")] #[doc(alias = "get_language")] pub fn language(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_audio_info_get_language(self.to_glib_none().0)) } } #[doc(alias = "gst_play_audio_info_get_max_bitrate")] #[doc(alias = "get_max_bitrate")] pub fn max_bitrate(&self) -> i32 { unsafe { ffi::gst_play_audio_info_get_max_bitrate(self.to_glib_none().0) } } #[doc(alias = "gst_play_audio_info_get_sample_rate")] #[doc(alias = "get_sample_rate")] pub fn sample_rate(&self) -> i32 { unsafe { ffi::gst_play_audio_info_get_sample_rate(self.to_glib_none().0) } } } unsafe impl Send for PlayAudioInfo {} unsafe impl Sync for PlayAudioInfo {} gstreamer-play-0.23.5/src/auto/play_media_info.rs000064400000000000000000000116441046102023000201010ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, PlayAudioInfo, PlayStreamInfo, PlaySubtitleInfo, PlayVideoInfo}; use glib::translate::*; glib::wrapper! { #[doc(alias = "GstPlayMediaInfo")] pub struct PlayMediaInfo(Object); match fn { type_ => || ffi::gst_play_media_info_get_type(), } } impl PlayMediaInfo { #[doc(alias = "gst_play_media_info_get_audio_streams")] #[doc(alias = "get_audio_streams")] pub fn audio_streams(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_audio_streams( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_media_info_get_container_format")] #[doc(alias = "get_container_format")] pub fn container_format(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_media_info_get_container_format( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_media_info_get_duration")] #[doc(alias = "get_duration")] pub fn duration(&self) -> Option { unsafe { from_glib(ffi::gst_play_media_info_get_duration(self.to_glib_none().0)) } } #[doc(alias = "gst_play_media_info_get_image_sample")] #[doc(alias = "get_image_sample")] pub fn image_sample(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_media_info_get_image_sample( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_media_info_get_number_of_audio_streams")] #[doc(alias = "get_number_of_audio_streams")] pub fn number_of_audio_streams(&self) -> u32 { unsafe { ffi::gst_play_media_info_get_number_of_audio_streams(self.to_glib_none().0) } } #[doc(alias = "gst_play_media_info_get_number_of_streams")] #[doc(alias = "get_number_of_streams")] pub fn number_of_streams(&self) -> u32 { unsafe { ffi::gst_play_media_info_get_number_of_streams(self.to_glib_none().0) } } #[doc(alias = "gst_play_media_info_get_number_of_subtitle_streams")] #[doc(alias = "get_number_of_subtitle_streams")] pub fn number_of_subtitle_streams(&self) -> u32 { unsafe { ffi::gst_play_media_info_get_number_of_subtitle_streams(self.to_glib_none().0) } } #[doc(alias = "gst_play_media_info_get_number_of_video_streams")] #[doc(alias = "get_number_of_video_streams")] pub fn number_of_video_streams(&self) -> u32 { unsafe { ffi::gst_play_media_info_get_number_of_video_streams(self.to_glib_none().0) } } #[doc(alias = "gst_play_media_info_get_stream_list")] #[doc(alias = "get_stream_list")] pub fn stream_list(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_stream_list( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_media_info_get_subtitle_streams")] #[doc(alias = "get_subtitle_streams")] pub fn subtitle_streams(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_subtitle_streams( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_media_info_get_tags")] #[doc(alias = "get_tags")] pub fn tags(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_media_info_get_tags(self.to_glib_none().0)) } } #[doc(alias = "gst_play_media_info_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_media_info_get_title(self.to_glib_none().0)) } } #[doc(alias = "gst_play_media_info_get_uri")] #[doc(alias = "get_uri")] pub fn uri(&self) -> glib::GString { unsafe { from_glib_none(ffi::gst_play_media_info_get_uri(self.to_glib_none().0)) } } #[doc(alias = "gst_play_media_info_get_video_streams")] #[doc(alias = "get_video_streams")] pub fn video_streams(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_video_streams( self.to_glib_none().0, )) } } #[doc(alias = "gst_play_media_info_is_live")] pub fn is_live(&self) -> bool { unsafe { from_glib(ffi::gst_play_media_info_is_live(self.to_glib_none().0)) } } #[doc(alias = "gst_play_media_info_is_seekable")] pub fn is_seekable(&self) -> bool { unsafe { from_glib(ffi::gst_play_media_info_is_seekable(self.to_glib_none().0)) } } } unsafe impl Send for PlayMediaInfo {} unsafe impl Sync for PlayMediaInfo {} gstreamer-play-0.23.5/src/auto/play_signal_adapter.rs000064400000000000000000000313231046102023000207600ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, Play, PlayMediaInfo, PlayState}; use glib::{ object::ObjectType as _, prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "GstPlaySignalAdapter")] pub struct PlaySignalAdapter(Object); match fn { type_ => || ffi::gst_play_signal_adapter_get_type(), } } impl PlaySignalAdapter { #[doc(alias = "gst_play_signal_adapter_new")] pub fn new(play: &Play) -> PlaySignalAdapter { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_play_signal_adapter_new(play.to_glib_none().0)) } } #[doc(alias = "gst_play_signal_adapter_new_sync_emit")] pub fn new_sync_emit(play: &Play) -> PlaySignalAdapter { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_play_signal_adapter_new_sync_emit( play.to_glib_none().0, )) } } #[doc(alias = "gst_play_signal_adapter_new_with_main_context")] #[doc(alias = "new_with_main_context")] pub fn with_main_context(play: &Play, context: &glib::MainContext) -> PlaySignalAdapter { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_play_signal_adapter_new_with_main_context( play.to_glib_none().0, context.to_glib_none().0, )) } } #[doc(alias = "gst_play_signal_adapter_get_play")] #[doc(alias = "get_play")] pub fn play(&self) -> Play { unsafe { from_glib_none(ffi::gst_play_signal_adapter_get_play(self.to_glib_none().0)) } } #[doc(alias = "buffering")] pub fn connect_buffering(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn buffering_trampoline< F: Fn(&PlaySignalAdapter, i32) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: std::ffi::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), object) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"buffering\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( buffering_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "end-of-stream")] pub fn connect_end_of_stream(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn end_of_stream_trampoline< F: Fn(&PlaySignalAdapter) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"end-of-stream\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( end_of_stream_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "error")] pub fn connect_error) + Send + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn error_trampoline< F: Fn(&PlaySignalAdapter, &glib::Error, Option<&gst::Structure>) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, error: *mut glib::ffi::GError, details: *mut gst::ffi::GstStructure, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( &from_glib_borrow(this), &from_glib_borrow(error), Option::::from_glib_borrow(details) .as_ref() .as_ref(), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"error\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( error_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "media-info-updated")] pub fn connect_media_info_updated( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn media_info_updated_trampoline< F: Fn(&PlaySignalAdapter, &PlayMediaInfo) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: *mut ffi::GstPlayMediaInfo, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(object)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"media-info-updated\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( media_info_updated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "mute-changed")] pub fn connect_mute_changed( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn mute_changed_trampoline< F: Fn(&PlaySignalAdapter, bool) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: glib::ffi::gboolean, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), from_glib(object)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"mute-changed\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( mute_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "state-changed")] pub fn connect_state_changed( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn state_changed_trampoline< F: Fn(&PlaySignalAdapter, PlayState) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: ffi::GstPlayState, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), from_glib(object)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"state-changed\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( state_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "uri-loaded")] pub fn connect_uri_loaded(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn uri_loaded_trampoline< F: Fn(&PlaySignalAdapter, &str) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: *mut std::ffi::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( &from_glib_borrow(this), &glib::GString::from_glib_borrow(object), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"uri-loaded\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( uri_loaded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "video-dimensions-changed")] pub fn connect_video_dimensions_changed( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn video_dimensions_changed_trampoline< F: Fn(&PlaySignalAdapter, u32, u32) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: std::ffi::c_uint, p0: std::ffi::c_uint, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), object, p0) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"video-dimensions-changed\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( video_dimensions_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "volume-changed")] pub fn connect_volume_changed( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn volume_changed_trampoline< F: Fn(&PlaySignalAdapter, f64) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: std::ffi::c_double, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), object) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"volume-changed\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( volume_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "warning")] pub fn connect_warning) + Send + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn warning_trampoline< F: Fn(&PlaySignalAdapter, &glib::Error, Option<&gst::Structure>) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, error: *mut glib::ffi::GError, details: *mut gst::ffi::GstStructure, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( &from_glib_borrow(this), &from_glib_borrow(error), Option::::from_glib_borrow(details) .as_ref() .as_ref(), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"warning\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( warning_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "play")] pub fn connect_play_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_play_trampoline< F: Fn(&PlaySignalAdapter) + Send + Sync + 'static, >( this: *mut ffi::GstPlaySignalAdapter, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::play\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_play_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } unsafe impl Send for PlaySignalAdapter {} unsafe impl Sync for PlaySignalAdapter {} gstreamer-play-0.23.5/src/auto/play_stream_info.rs000064400000000000000000000055261046102023000203170ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT #![allow(deprecated)] use crate::ffi; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "GstPlayStreamInfo")] pub struct PlayStreamInfo(Object); match fn { type_ => || ffi::gst_play_stream_info_get_type(), } } impl PlayStreamInfo { pub const NONE: Option<&'static PlayStreamInfo> = None; } unsafe impl Send for PlayStreamInfo {} unsafe impl Sync for PlayStreamInfo {} mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait PlayStreamInfoExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gst_play_stream_info_get_caps")] #[doc(alias = "get_caps")] fn caps(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_stream_info_get_caps(const_override( self.as_ref().to_glib_none().0, ))) } } #[doc(alias = "gst_play_stream_info_get_codec")] #[doc(alias = "get_codec")] fn codec(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_stream_info_get_codec(const_override( self.as_ref().to_glib_none().0, ))) } } #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")] #[allow(deprecated)] #[doc(alias = "gst_play_stream_info_get_index")] #[doc(alias = "get_index")] fn index(&self) -> i32 { unsafe { ffi::gst_play_stream_info_get_index(const_override(self.as_ref().to_glib_none().0)) } } #[cfg(feature = "v1_26")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))] #[doc(alias = "gst_play_stream_info_get_stream_id")] #[doc(alias = "get_stream_id")] fn stream_id(&self) -> glib::GString { unsafe { from_glib_none(ffi::gst_play_stream_info_get_stream_id(const_override( self.as_ref().to_glib_none().0, ))) } } #[doc(alias = "gst_play_stream_info_get_stream_type")] #[doc(alias = "get_stream_type")] fn stream_type(&self) -> glib::GString { unsafe { from_glib_none(ffi::gst_play_stream_info_get_stream_type(const_override( self.as_ref().to_glib_none().0, ))) } } #[doc(alias = "gst_play_stream_info_get_tags")] #[doc(alias = "get_tags")] fn tags(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_stream_info_get_tags(const_override( self.as_ref().to_glib_none().0, ))) } } } impl> PlayStreamInfoExt for O {} gstreamer-play-0.23.5/src/auto/play_subtitle_info.rs000064400000000000000000000016751046102023000206600ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, PlayStreamInfo}; use glib::translate::*; glib::wrapper! { #[doc(alias = "GstPlaySubtitleInfo")] pub struct PlaySubtitleInfo(Object) @extends PlayStreamInfo; match fn { type_ => || ffi::gst_play_subtitle_info_get_type(), } } impl PlaySubtitleInfo { #[doc(alias = "gst_play_subtitle_info_get_language")] #[doc(alias = "get_language")] pub fn language(&self) -> Option { unsafe { from_glib_none(ffi::gst_play_subtitle_info_get_language( self.to_glib_none().0, )) } } } unsafe impl Send for PlaySubtitleInfo {} unsafe impl Sync for PlaySubtitleInfo {} gstreamer-play-0.23.5/src/auto/play_video_info.rs000064400000000000000000000026751046102023000201340ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, PlayStreamInfo}; use glib::translate::*; glib::wrapper! { #[doc(alias = "GstPlayVideoInfo")] pub struct PlayVideoInfo(Object) @extends PlayStreamInfo; match fn { type_ => || ffi::gst_play_video_info_get_type(), } } impl PlayVideoInfo { #[doc(alias = "gst_play_video_info_get_bitrate")] #[doc(alias = "get_bitrate")] pub fn bitrate(&self) -> i32 { unsafe { ffi::gst_play_video_info_get_bitrate(self.to_glib_none().0) } } #[doc(alias = "gst_play_video_info_get_height")] #[doc(alias = "get_height")] pub fn height(&self) -> i32 { unsafe { ffi::gst_play_video_info_get_height(self.to_glib_none().0) } } #[doc(alias = "gst_play_video_info_get_max_bitrate")] #[doc(alias = "get_max_bitrate")] pub fn max_bitrate(&self) -> i32 { unsafe { ffi::gst_play_video_info_get_max_bitrate(self.to_glib_none().0) } } #[doc(alias = "gst_play_video_info_get_width")] #[doc(alias = "get_width")] pub fn width(&self) -> i32 { unsafe { ffi::gst_play_video_info_get_width(self.to_glib_none().0) } } } unsafe impl Send for PlayVideoInfo {} unsafe impl Sync for PlayVideoInfo {} gstreamer-play-0.23.5/src/auto/play_video_overlay_video_renderer.rs000064400000000000000000000111171046102023000237250ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::{ffi, PlayVideoRenderer}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "GstPlayVideoOverlayVideoRenderer")] pub struct PlayVideoOverlayVideoRenderer(Object) @implements PlayVideoRenderer; match fn { type_ => || ffi::gst_play_video_overlay_video_renderer_get_type(), } } impl PlayVideoOverlayVideoRenderer { #[doc(alias = "gst_play_video_overlay_video_renderer_expose")] pub fn expose(&self) { unsafe { ffi::gst_play_video_overlay_video_renderer_expose(self.to_glib_none().0); } } #[doc(alias = "gst_play_video_overlay_video_renderer_get_render_rectangle")] #[doc(alias = "get_render_rectangle")] pub fn render_rectangle(&self) -> (i32, i32, i32, i32) { unsafe { let mut x = std::mem::MaybeUninit::uninit(); let mut y = std::mem::MaybeUninit::uninit(); let mut width = std::mem::MaybeUninit::uninit(); let mut height = std::mem::MaybeUninit::uninit(); ffi::gst_play_video_overlay_video_renderer_get_render_rectangle( self.to_glib_none().0, x.as_mut_ptr(), y.as_mut_ptr(), width.as_mut_ptr(), height.as_mut_ptr(), ); ( x.assume_init(), y.assume_init(), width.assume_init(), height.assume_init(), ) } } #[doc(alias = "gst_play_video_overlay_video_renderer_set_render_rectangle")] pub fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) { unsafe { ffi::gst_play_video_overlay_video_renderer_set_render_rectangle( self.to_glib_none().0, x, y, width, height, ); } } #[doc(alias = "video-sink")] pub fn video_sink(&self) -> Option { ObjectExt::property(self, "video-sink") } #[doc(alias = "video-sink")] pub fn set_video_sink>(&self, video_sink: Option<&P>) { ObjectExt::set_property(self, "video-sink", video_sink) } #[doc(alias = "video-sink")] pub fn connect_video_sink_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_video_sink_trampoline< F: Fn(&PlayVideoOverlayVideoRenderer) + Send + Sync + 'static, >( this: *mut ffi::GstPlayVideoOverlayVideoRenderer, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_video_sink_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "window-handle")] pub fn connect_window_handle_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_window_handle_trampoline< F: Fn(&PlayVideoOverlayVideoRenderer) + Send + Sync + 'static, >( this: *mut ffi::GstPlayVideoOverlayVideoRenderer, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::window-handle\0".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_window_handle_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } unsafe impl Send for PlayVideoOverlayVideoRenderer {} unsafe impl Sync for PlayVideoOverlayVideoRenderer {} gstreamer-play-0.23.5/src/auto/play_video_renderer.rs000064400000000000000000000016571046102023000210060ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::ffi; use glib::prelude::*; glib::wrapper! { #[doc(alias = "GstPlayVideoRenderer")] pub struct PlayVideoRenderer(Interface); match fn { type_ => || ffi::gst_play_video_renderer_get_type(), } } impl PlayVideoRenderer { pub const NONE: Option<&'static PlayVideoRenderer> = None; } unsafe impl Send for PlayVideoRenderer {} unsafe impl Sync for PlayVideoRenderer {} mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait PlayVideoRendererExt: IsA + sealed::Sealed + 'static {} impl> PlayVideoRendererExt for O {} gstreamer-play-0.23.5/src/auto/play_visualization.rs000064400000000000000000000012401046102023000206770ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT use crate::ffi; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct PlayVisualization(Boxed); match fn { copy => |ptr| ffi::gst_play_visualization_copy(ptr), free => |ptr| ffi::gst_play_visualization_free(ptr), type_ => || ffi::gst_play_visualization_get_type(), } } unsafe impl Send for PlayVisualization {} unsafe impl Sync for PlayVisualization {} gstreamer-play-0.23.5/src/auto/versions.txt000064400000000000000000000003421046102023000170160ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 2b05eaddce95) from gir-files (https://github.com/gtk-rs/gir-files @ 5089b7ff80cd) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 26898eacb093) gstreamer-play-0.23.5/src/config.rs000064400000000000000000000077031046102023000152600ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::{mem, ops}; use crate::ffi; use glib::translate::*; #[derive(Debug, Clone, PartialEq, Eq)] pub struct PlayConfig(gst::Structure); impl ops::Deref for PlayConfig { type Target = gst::StructureRef; #[inline] fn deref(&self) -> &gst::StructureRef { self.0.deref() } } impl ops::DerefMut for PlayConfig { #[inline] fn deref_mut(&mut self) -> &mut gst::StructureRef { self.0.deref_mut() } } impl AsRef for PlayConfig { #[inline] fn as_ref(&self) -> &gst::StructureRef { self.0.as_ref() } } impl AsMut for PlayConfig { #[inline] fn as_mut(&mut self) -> &mut gst::StructureRef { self.0.as_mut() } } impl PlayConfig { #[doc(alias = "get_position_update_interval")] #[doc(alias = "gst_play_config_get_position_update_interval")] pub fn position_update_interval(&self) -> u32 { skip_assert_initialized!(); unsafe { ffi::gst_play_config_get_position_update_interval(self.0.to_glib_none().0) } } #[doc(alias = "gst_play_config_set_position_update_interval")] pub fn set_position_update_interval(&mut self, interval: u32) { skip_assert_initialized!(); unsafe { ffi::gst_play_config_set_position_update_interval( self.0.to_glib_none_mut().0, interval, ); } } #[doc(alias = "get_seek_accurate")] pub fn is_seek_accurate(&self) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gst_play_config_get_seek_accurate( self.0.to_glib_none().0, )) } } pub fn set_seek_accurate(&mut self, accurate: bool) { skip_assert_initialized!(); // FIXME: Work-around for // http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=cc58bd6ae071dec4ea7b4be626034accd0372755 self.set("accurate-seek", accurate); } #[doc(alias = "get_user_agent")] #[doc(alias = "gst_play_config_get_user_agent")] pub fn user_agent(&self) -> Option { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_play_config_get_user_agent(self.0.to_glib_none().0)) } } #[doc(alias = "gst_play_config_set_user_agent")] pub fn set_user_agent(&mut self, agent: &str) { skip_assert_initialized!(); unsafe { ffi::gst_play_config_set_user_agent( self.0.to_glib_none_mut().0, agent.to_glib_none().0, ); } } #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_play_config_get_pipeline_dump_in_error_details")] pub fn pipeline_dump_in_error_details(&self) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gst_play_config_get_pipeline_dump_in_error_details( self.0.to_glib_none().0, )) } } #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_play_config_set_pipeline_dump_in_error_details")] pub fn set_pipeline_dump_in_error_details(&mut self, pipeline_dump_in_error_details: bool) { skip_assert_initialized!(); unsafe { ffi::gst_play_config_set_pipeline_dump_in_error_details( self.0.to_glib_none_mut().0, pipeline_dump_in_error_details.into_glib(), ); } } } impl IntoGlibPtr<*mut gst::ffi::GstStructure> for PlayConfig { #[inline] unsafe fn into_glib_ptr(self) -> *mut gst::ffi::GstStructure { let mut s = mem::ManuallyDrop::new(self); s.0.to_glib_none_mut().0 } } impl FromGlibPtrFull<*mut gst::ffi::GstStructure> for PlayConfig { #[inline] unsafe fn from_glib_full(ptr: *mut gst::ffi::GstStructure) -> Self { PlayConfig(from_glib_full(ptr)) } } gstreamer-play-0.23.5/src/lib.rs000064400000000000000000000022761046102023000145610ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] #![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use gst; pub use gst_video; pub use gstreamer_play_sys as ffi; macro_rules! skip_assert_initialized { () => {}; } macro_rules! assert_initialized_main_thread { () => { if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) { gst::assert_initialized(); } }; } #[allow(clippy::needless_borrow)] #[allow(unused)] #[allow(unused_imports)] mod auto; pub(crate) use crate::auto::PlayMessage as PlayMessageType; pub use crate::auto::*; pub mod subclass; mod config; mod play; pub use crate::config::*; mod play_video_info; mod play_signal_adapter; mod play_video_overlay_video_renderer; mod play_visualization; mod play_message; pub use crate::play_message::PlayMessage; // Re-export all the traits in a prelude module, so that applications // can always "use gst_player::prelude::*" without getting conflicts pub mod prelude { #[doc(hidden)] pub use gst_video::prelude::*; pub use crate::auto::traits::*; } gstreamer-play-0.23.5/src/play.rs000064400000000000000000000025031046102023000147510ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::translate::*; use crate::{ffi, Play}; impl Play { #[doc(alias = "get_config")] #[doc(alias = "gst_play_get_config")] pub fn config(&self) -> crate::PlayConfig { unsafe { from_glib_full(ffi::gst_play_get_config(self.to_glib_none().0)) } } #[doc(alias = "gst_play_set_config")] pub fn set_config(&self, config: crate::PlayConfig) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::gst_play_set_config(self.to_glib_none().0, config.into_glib_ptr()), "Failed to set config", ) } } #[doc(alias = "gst_play_get_video_snapshot")] #[doc(alias = "get_video_snapshot")] pub fn video_snapshot( &self, format: crate::PlaySnapshotFormat, config: Option<&gst::StructureRef>, ) -> Option { unsafe { from_glib_full(ffi::gst_play_get_video_snapshot( self.to_glib_none().0, format.into_glib(), mut_override(config.map(|c| c.as_ptr()).unwrap_or(std::ptr::null())), )) } } } impl Default for Play { fn default() -> Self { Self::new(None::) } } gstreamer-play-0.23.5/src/play_message.rs000064400000000000000000000107741046102023000164660ustar 00000000000000use crate::{PlayMediaInfo, PlayMessageType, PlayState}; #[derive(Clone, PartialEq, Debug)] #[non_exhaustive] #[doc(alias = "GstPlayMessage")] pub enum PlayMessage { #[doc(alias = "GST_PLAY_MESSAGE_URI_LOADED")] UriLoaded, #[doc(alias = "GST_PLAY_MESSAGE_POSITION_UPDATED")] PositionUpdated { position: Option }, #[doc(alias = "GST_PLAY_MESSAGE_DURATION_CHANGED")] DurationChanged { duration: Option }, #[doc(alias = "GST_PLAY_MESSAGE_STATE_CHANGED")] StateChanged { state: PlayState }, #[doc(alias = "GST_PLAY_MESSAGE_BUFFERING")] Buffering { percent: u32 }, #[doc(alias = "GST_PLAY_MESSAGE_END_OF_STREAM")] EndOfStream, #[doc(alias = "GST_PLAY_MESSAGE_ERROR")] Error { error: glib::Error, details: Option, }, #[doc(alias = "GST_PLAY_MESSAGE_WARNING")] Warning { error: glib::Error, details: Option, }, #[doc(alias = "GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED")] VideoDimensionsChanged { width: u32, height: u32 }, #[doc(alias = "GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED")] MediaInfoUpdated { info: PlayMediaInfo }, #[doc(alias = "GST_PLAY_MESSAGE_VOLUME_CHANGED")] VolumeChanged { volume: f64 }, #[doc(alias = "GST_PLAY_MESSAGE_MUTE_CHANGED")] MuteChanged { muted: bool }, #[doc(alias = "GST_PLAY_MESSAGE_SEEK_DONE")] SeekDone, } impl PlayMessage { #[doc(alias = "gst_play_message_parse_position_updated")] #[doc(alias = "gst_play_message_parse_duration_updated")] #[doc(alias = "gst_play_message_parse_state_changed")] #[doc(alias = "gst_play_message_parse_buffering_percent")] #[doc(alias = "gst_play_message_parse_error")] #[doc(alias = "gst_play_message_parse_warning")] #[doc(alias = "gst_play_message_parse_video_dimensions_changed")] #[doc(alias = "gst_play_message_parse_media_info_updated")] #[doc(alias = "gst_play_message_parse_muted_changed")] #[doc(alias = "gst_play_message_parse_volume_changed")] pub fn parse(msg: &gst::Message) -> Result { skip_assert_initialized!(); if msg.type_() != gst::MessageType::Application { return Err(glib::bool_error!("Invalid play message")); } match PlayMessageType::parse_type(msg) { PlayMessageType::UriLoaded => Ok(Self::UriLoaded), PlayMessageType::PositionUpdated => { let position = PlayMessageType::parse_position_updated(msg); Ok(Self::PositionUpdated { position }) } #[allow(deprecated)] PlayMessageType::DurationChanged => { let duration = PlayMessageType::parse_duration_updated(msg); Ok(Self::DurationChanged { duration }) } PlayMessageType::StateChanged => { let state = PlayMessageType::parse_state_changed(msg); Ok(Self::StateChanged { state }) } #[allow(deprecated)] PlayMessageType::Buffering => { let percent = PlayMessageType::parse_buffering_percent(msg); Ok(Self::Buffering { percent }) } PlayMessageType::EndOfStream => Ok(Self::EndOfStream), PlayMessageType::Error => { let (error, details) = PlayMessageType::parse_error(msg); Ok(Self::Error { error, details }) } PlayMessageType::Warning => { let (error, details) = PlayMessageType::parse_warning(msg); Ok(Self::Warning { error, details }) } PlayMessageType::VideoDimensionsChanged => { let (width, height) = PlayMessageType::parse_video_dimensions_changed(msg); Ok(Self::VideoDimensionsChanged { width, height }) } PlayMessageType::MediaInfoUpdated => { let info = PlayMessageType::parse_media_info_updated(msg); Ok(Self::MediaInfoUpdated { info }) } PlayMessageType::VolumeChanged => { let volume = PlayMessageType::parse_volume_changed(msg); Ok(Self::VolumeChanged { volume }) } PlayMessageType::MuteChanged => { let muted = PlayMessageType::parse_muted_changed(msg); Ok(Self::MuteChanged { muted }) } PlayMessageType::SeekDone => Ok(Self::SeekDone), _ => Err(glib::bool_error!("Invalid play message")), } } } gstreamer-play-0.23.5/src/play_signal_adapter.rs000064400000000000000000000066271046102023000200210ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::{boxed::Box as Box_, mem::transmute}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use crate::{ffi, PlaySignalAdapter}; impl PlaySignalAdapter { #[doc(alias = "duration-changed")] pub fn connect_duration_changed< F: Fn(&PlaySignalAdapter, Option) + Send + 'static, >( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn duration_changed_trampoline< F: Fn(&PlaySignalAdapter, Option) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: u64, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), FromGlib::from_glib(object)) } #[allow(clippy::cast_ptr_alignment)] unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"duration-changed\0".as_ptr() as *const _, Some(transmute::<*const (), unsafe extern "C" fn()>( duration_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "position-updated")] pub fn connect_position_updated< F: Fn(&PlaySignalAdapter, Option) + Send + 'static, >( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn position_updated_trampoline< F: Fn(&PlaySignalAdapter, Option) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: u64, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), FromGlib::from_glib(object)) } #[allow(clippy::cast_ptr_alignment)] unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"position-updated\0".as_ptr() as *const _, Some(transmute::<*const (), unsafe extern "C" fn()>( position_updated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "seek-done")] pub fn connect_seek_done( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn seek_done_trampoline< F: Fn(&PlaySignalAdapter, gst::ClockTime) + Send + 'static, >( this: *mut ffi::GstPlaySignalAdapter, object: u64, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( &from_glib_borrow(this), try_from_glib(object).expect("undefined seek position"), ) } #[allow(clippy::cast_ptr_alignment)] unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"seek-done\0".as_ptr() as *const _, Some(transmute::<*const (), unsafe extern "C" fn()>( seek_done_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } gstreamer-play-0.23.5/src/play_video_info.rs000064400000000000000000000023751046102023000171610ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::mem; use glib::translate::*; use crate::{ffi, PlayVideoInfo}; impl PlayVideoInfo { #[doc(alias = "get_framerate")] #[doc(alias = "gst_play_video_info_get_framerate")] pub fn framerate(&self) -> gst::Fraction { unsafe { let mut fps_n = mem::MaybeUninit::uninit(); let mut fps_d = mem::MaybeUninit::uninit(); ffi::gst_play_video_info_get_framerate( self.to_glib_none().0, fps_n.as_mut_ptr(), fps_d.as_mut_ptr(), ); (fps_n.assume_init(), fps_d.assume_init()).into() } } #[doc(alias = "get_pixel_aspect_ratio")] #[doc(alias = "gst_play_video_info_get_pixel_aspect_ratio")] pub fn pixel_aspect_ratio(&self) -> gst::Fraction { unsafe { let mut par_n = mem::MaybeUninit::uninit(); let mut par_d = mem::MaybeUninit::uninit(); ffi::gst_play_video_info_get_pixel_aspect_ratio( self.to_glib_none().0, par_n.as_mut_ptr(), par_d.as_mut_ptr(), ); (par_n.assume_init() as i32, par_d.assume_init() as i32).into() } } } gstreamer-play-0.23.5/src/play_video_overlay_video_renderer.rs000064400000000000000000000033711046102023000227600ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::ptr; use glib::{prelude::*, translate::*}; use libc::uintptr_t; use crate::{ffi, PlayVideoOverlayVideoRenderer}; impl PlayVideoOverlayVideoRenderer { pub unsafe fn new(window_handle: uintptr_t) -> PlayVideoOverlayVideoRenderer { assert_initialized_main_thread!(); from_glib_full( ffi::gst_play_video_overlay_video_renderer_new(window_handle as *mut _) as *mut _, ) } pub unsafe fn with_handle_and_sink>( window_handle: uintptr_t, video_sink: &P, ) -> PlayVideoOverlayVideoRenderer { skip_assert_initialized!(); from_glib_full(ffi::gst_play_video_overlay_video_renderer_new_with_sink( window_handle as *mut _, video_sink.as_ref().to_glib_none().0, ) as *mut _) } #[doc(alias = "gst_play_video_overlay_video_renderer_new_with_sink")] pub fn with_sink>(video_sink: &P) -> PlayVideoOverlayVideoRenderer { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_play_video_overlay_video_renderer_new_with_sink( ptr::null_mut(), video_sink.as_ref().to_glib_none().0, ) as *mut _) } } #[doc(alias = "get_window_handle")] pub unsafe fn window_handle(&self) -> uintptr_t { ffi::gst_play_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0) as uintptr_t } pub unsafe fn set_window_handle(&self, window_handle: uintptr_t) { ffi::gst_play_video_overlay_video_renderer_set_window_handle( self.to_glib_none().0, window_handle as *mut _, ) } } gstreamer-play-0.23.5/src/play_visualization.rs000064400000000000000000000007111046102023000177310ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use std::ffi::CStr; use crate::PlayVisualization; impl PlayVisualization { pub fn name(&self) -> &str { unsafe { CStr::from_ptr((*self.as_ptr()).name).to_str().unwrap() } } pub fn description(&self) -> &str { unsafe { CStr::from_ptr((*self.as_ptr()).description) .to_str() .unwrap() } } } gstreamer-play-0.23.5/src/subclass/mod.rs000064400000000000000000000004251046102023000164030ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. mod play_video_renderer; pub mod prelude { #[doc(hidden)] pub use gst::subclass::prelude::*; pub use super::play_video_renderer::{PlayVideoRendererImpl, PlayVideoRendererImplExt}; } gstreamer-play-0.23.5/src/subclass/play_video_renderer.rs000064400000000000000000000053601046102023000216500ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use glib::{prelude::*, subclass::prelude::*, translate::*}; use crate::{ffi, Play, PlayVideoRenderer}; pub trait PlayVideoRendererImpl: ObjectImpl { fn create_video_sink(&self, play: &Play) -> gst::Element; } unsafe impl IsImplementable for PlayVideoRenderer { fn interface_init(iface: &mut glib::Interface) { let iface = iface.as_mut(); iface.create_video_sink = Some(video_renderer_create_video_sink::); } } mod sealed { pub trait Sealed {} impl Sealed for T {} } pub trait PlayVideoRendererImplExt: sealed::Sealed + ObjectSubclass { fn parent_create_video_sink(&self, play: &Play) -> gst::Element { unsafe { let type_data = Self::type_data(); let parent_iface = type_data.as_ref().parent_interface::() as *const ffi::GstPlayVideoRendererInterface; let func = (*parent_iface) .create_video_sink .expect("no parent \"create_video_sink\" implementation"); let ret = func( self.obj() .unsafe_cast_ref::() .to_glib_none() .0, play.to_glib_none().0, ); from_glib_none(ret) } } } impl PlayVideoRendererImplExt for T {} unsafe extern "C" fn video_renderer_create_video_sink( video_renderer: *mut ffi::GstPlayVideoRenderer, play: *mut ffi::GstPlay, ) -> *mut gst::ffi::GstElement { static VIDEO_SINK_QUARK: std::sync::OnceLock = std::sync::OnceLock::new(); let video_sink_quark = VIDEO_SINK_QUARK.get_or_init(|| glib::Quark::from_str("gstreamer-rs-play-video-sink")); let instance = &*(video_renderer as *mut T::Instance); let imp = instance.imp(); let sink = imp.create_video_sink(&Play::from_glib_borrow(play)); let sink_ptr: *mut gst::ffi::GstElement = sink.to_glib_none().0; let old_sink_ptr = glib::gobject_ffi::g_object_get_qdata( video_renderer as *mut _, video_sink_quark.into_glib(), ) as *mut gst::ffi::GstElement; if !old_sink_ptr.is_null() && old_sink_ptr != sink_ptr { panic!("Video sink must not change"); } unsafe extern "C" fn unref(ptr: glib::ffi::gpointer) { glib::gobject_ffi::g_object_unref(ptr as *mut _); } glib::gobject_ffi::g_object_set_qdata_full( video_renderer as *mut _, video_sink_quark.into_glib(), glib::gobject_ffi::g_object_ref(sink_ptr as *mut _) as *mut _, Some(unref), ); sink_ptr } gstreamer-play-0.23.5/tests/check_gir.rs000064400000000000000000000003461046102023000163000ustar 00000000000000// Take a look at the license at the top of the repository in the LICENSE file. #[test] fn check_gir_file() { let res = gir_format_check::check_gir_file("Gir.toml"); println!("{res}"); assert_eq!(res.nb_errors, 0); } gstreamer-play-0.23.5/tests/manual.h000064400000000000000000000001651046102023000154410ustar 00000000000000// Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include