forked from mirrors/gstreamer-rs
Compare commits
76 commits
Author | SHA1 | Date | |
---|---|---|---|
|
44ce6b8a66 | ||
|
3aac87c07f | ||
|
ff2fb01184 | ||
|
ecb45814c2 | ||
|
b20981abc1 | ||
|
6f6452a0c7 | ||
|
7ccfc2a07e | ||
|
c4bda55f3c | ||
|
3779eba607 | ||
|
d2181def6a | ||
|
b3057d1185 | ||
|
6cb567e855 | ||
|
8fd859a45f | ||
|
5d40a3ba2d | ||
|
65b77971ef | ||
|
5b98f9def0 | ||
|
00a5fecdbb | ||
|
1cecb1c8ab | ||
|
1b7c8868a9 | ||
|
2df623c09a | ||
|
682ca91070 | ||
|
e09f23e689 | ||
|
6cb7f602d1 | ||
|
15da7bca0e | ||
|
69ae94eb37 | ||
|
2a1d5e65bb | ||
|
72a30a869a | ||
|
307637c7bd | ||
|
f9c95b62a4 | ||
|
4ec7288f56 | ||
|
0d5ea8e452 | ||
|
a17449e2be | ||
|
9dd6053dbd | ||
|
5aa3b3908e | ||
|
2a222987d1 | ||
|
5ae517d093 | ||
|
fcb3ee9045 | ||
|
ea12ab3cf0 | ||
|
8c37ad1372 | ||
|
0799647874 | ||
|
2a2ffa45c9 | ||
|
be8f29c9f7 | ||
|
499a99070e | ||
|
7e57b36f00 | ||
|
135afc7e9c | ||
|
855f721230 | ||
|
13a1d5d7d0 | ||
|
574ad233b4 | ||
|
9a059583c9 | ||
|
d7d965c437 | ||
|
85e1e196c4 | ||
|
3c5b4ade92 | ||
|
f5c7ae06de | ||
|
859ea53117 | ||
|
f53f5f92a4 | ||
|
d0c124db15 | ||
|
b1c538dee2 | ||
|
16574e87d6 | ||
|
c3e7ab2f61 | ||
|
947ddc809d | ||
|
4c9cf04f8a | ||
|
ef9591807f | ||
|
23900d6099 | ||
|
513914c735 | ||
|
e37be09eeb | ||
|
d317e15c2e | ||
|
c21f98d2c3 | ||
|
c1d56ce94e | ||
|
93eb0b715c | ||
|
be35bf465f | ||
|
edfb3050c4 | ||
|
c41a8edae7 | ||
|
20906d41e2 | ||
|
82f51cfe43 | ||
|
d2b520ec31 | ||
|
108f08dea4 |
157 changed files with 30837 additions and 1272 deletions
76
.gitlab-ci.yml
Normal file
76
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,76 @@
|
|||
stages:
|
||||
- "lint"
|
||||
- "test"
|
||||
|
||||
.cargo_cache: &cache
|
||||
cache:
|
||||
key: "gst"
|
||||
paths:
|
||||
- ".cargo_cache/"
|
||||
|
||||
.cargo_test_template: &cargo_test
|
||||
stage: "test"
|
||||
variables:
|
||||
DEPENDENCIES: |
|
||||
curl
|
||||
liborc-dev
|
||||
libglib2.0-dev
|
||||
libxml2-dev
|
||||
libgtk-3-dev
|
||||
libegl1-mesa
|
||||
libgles2-mesa
|
||||
libgl1-mesa-dri
|
||||
libgl1-mesa-glx
|
||||
libwayland-egl1-mesa
|
||||
|
||||
<<: *cache
|
||||
before_script:
|
||||
- apt-get update -yqq
|
||||
- apt-get install -yqq --no-install-recommends $DEPENDENCIES
|
||||
|
||||
# Only stuff inside the repo directory can be cached
|
||||
# Override the CARGO_HOME variable to force its location
|
||||
- export CARGO_HOME="${PWD}/.cargo_cache"
|
||||
|
||||
- mkdir -p precompiled-gst && cd precompiled-gst
|
||||
|
||||
- curl -L https://people.freedesktop.org/~slomo/gstreamer-1.14.3.tar.gz | tar xz
|
||||
- sed -i "s;prefix=/root/gstreamer;prefix=$PWD/gstreamer;g" $PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig/*.pc
|
||||
- export PKG_CONFIG_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig
|
||||
- export GST_PLUGIN_SYSTEM_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/gstreamer-1.0
|
||||
- export GST_PLUGIN_SCANNER=$PWD/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
|
||||
- export PATH=$PATH:$PWD/gstreamer/bin
|
||||
- export LD_LIBRARY_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
|
||||
script:
|
||||
- rustc --version
|
||||
- cargo build --color=always --all
|
||||
- G_DEBUG=fatal_warnings cargo test --color=always --all
|
||||
- cargo build --color=always --all --all-features
|
||||
- G_DEBUG=fatal_warnings cargo test --color=always --all --all-features
|
||||
|
||||
test 1.28:
|
||||
# 1.28 img
|
||||
# https://hub.docker.com/_/rust/
|
||||
image: "rust:1.28-slim"
|
||||
<<: *cargo_test
|
||||
|
||||
test stable:
|
||||
# Stable img
|
||||
# https://hub.docker.com/_/rust/
|
||||
image: "rust:slim"
|
||||
<<: *cargo_test
|
||||
|
||||
test nightly:
|
||||
# Nightly
|
||||
# https://hub.docker.com/r/rustlang/rust/
|
||||
image: "rustlang/rust:nightly-slim"
|
||||
allow_failure: true
|
||||
<<: *cargo_test
|
||||
|
||||
rustfmt:
|
||||
image: "rustlang/rust:nightly-slim"
|
||||
stage: "lint"
|
||||
script:
|
||||
- rustup component add rustfmt-preview
|
||||
- cargo fmt --version
|
||||
- cargo fmt -- --color=always --check
|
15
.rustfmt.toml
Normal file
15
.rustfmt.toml
Normal file
|
@ -0,0 +1,15 @@
|
|||
ignore = [
|
||||
"gstreamer/src/auto/",
|
||||
"gstreamer-app/src/auto",
|
||||
"gstreamer-audio/src/auto",
|
||||
"gstreamer-base/src/auto",
|
||||
"gstreamer-net/src/auto",
|
||||
"gstreamer-pbutils/src/auto",
|
||||
"gstreamer-player/src/auto",
|
||||
"gstreamer-rtsp/src/auto",
|
||||
"gstreamer-rtsp-server/src/auto",
|
||||
"gstreamer-sdp/src/auto",
|
||||
"gstreamer-video/src/auto",
|
||||
"gstreamer-webrtc/src/auto",
|
||||
"gstreamer-editing-services/src/auto",
|
||||
]
|
13
.travis.yml
13
.travis.yml
|
@ -1,8 +1,6 @@
|
|||
dist: trusty
|
||||
sudo: required
|
||||
language: rust
|
||||
cache:
|
||||
cargo: true
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
|
@ -14,6 +12,11 @@ addons:
|
|||
- libglib2.0-dev
|
||||
- libxml2-dev
|
||||
- libgtk-3-dev
|
||||
- libegl1-mesa
|
||||
- libgles2-mesa
|
||||
- libgl1-mesa-dri
|
||||
- libgl1-mesa-glx
|
||||
- libwayland-egl1-mesa
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
|
@ -22,12 +25,12 @@ matrix:
|
|||
script:
|
||||
- rustc --version
|
||||
- cargo build --all
|
||||
- cargo test --all
|
||||
- G_DEBUG=fatal_warnings cargo test --all
|
||||
- cargo build --all --all-features
|
||||
- cargo test --all --all-features
|
||||
- G_DEBUG=fatal_warnings cargo test --all --all-features
|
||||
|
||||
before_install:
|
||||
- curl -L https://people.freedesktop.org/~slomo/gstreamer.tar.gz | tar xz
|
||||
- curl -L https://people.freedesktop.org/~slomo/gstreamer-1.14.3.tar.gz | tar xz
|
||||
- sed -i "s;prefix=/root/gstreamer;prefix=$PWD/gstreamer;g" $PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig/*.pc
|
||||
- export PKG_CONFIG_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig
|
||||
- export GST_PLUGIN_SYSTEM_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/gstreamer-1.0
|
||||
|
|
|
@ -13,6 +13,8 @@ members = [
|
|||
"gstreamer-video",
|
||||
"gstreamer-pbutils",
|
||||
"gstreamer-webrtc",
|
||||
"gstreamer-check",
|
||||
"gstreamer-editing-services",
|
||||
"examples",
|
||||
"tutorials",
|
||||
]
|
||||
|
|
|
@ -39,7 +39,7 @@ manual = [
|
|||
name = "GstBase.Adapter"
|
||||
status = "generate"
|
||||
trait = false
|
||||
concurrency = "none"
|
||||
concurrency = "send-unique"
|
||||
|
||||
[[object.function]]
|
||||
name = "map"
|
||||
|
|
37
Gir_GstCheck.toml
Normal file
37
Gir_GstCheck.toml
Normal file
|
@ -0,0 +1,37 @@
|
|||
[options]
|
||||
girs_dir = "gir-files"
|
||||
library = "GstCheck"
|
||||
version = "1.0"
|
||||
min_cfg_version = "1.8"
|
||||
target_path = "gstreamer-check"
|
||||
work_mode = "normal"
|
||||
concurrency = "send+sync"
|
||||
generate_safety_asserts = true
|
||||
single_version_file = true
|
||||
|
||||
external_libraries = [
|
||||
"GLib",
|
||||
"GObject",
|
||||
"Gst",
|
||||
]
|
||||
|
||||
generate = [
|
||||
]
|
||||
|
||||
manual = [
|
||||
"GObject.Object",
|
||||
"Gst.Object",
|
||||
"Gst.Clock",
|
||||
"Gst.ClockTimeDiff",
|
||||
"Gst.ClockType",
|
||||
]
|
||||
|
||||
[[object]]
|
||||
name = "Gst.ClockTime"
|
||||
status = "manual"
|
||||
conversion_type = "scalar"
|
||||
|
||||
[[object]]
|
||||
name = "GstCheck.TestClock"
|
||||
status = "generate"
|
||||
trait = false
|
172
Gir_GstEditingServices.toml
Normal file
172
Gir_GstEditingServices.toml
Normal file
|
@ -0,0 +1,172 @@
|
|||
[options]
|
||||
girs_dir = "gir-files"
|
||||
library = "GES"
|
||||
version = "1.0"
|
||||
min_cfg_version = "1.8"
|
||||
target_path = "gstreamer-editing-services"
|
||||
work_mode = "normal"
|
||||
generate_safety_asserts = true
|
||||
single_version_file = true
|
||||
|
||||
external_libraries = [
|
||||
"GLib",
|
||||
"GObject",
|
||||
"Gio",
|
||||
"Gst",
|
||||
"GstPbutils",
|
||||
]
|
||||
|
||||
manual = [
|
||||
"GLib.Error",
|
||||
"GLib.Source",
|
||||
"GLib.DateTime",
|
||||
"Gio.Cancellable",
|
||||
"Gio.AsyncReadyCallback",
|
||||
"GObject.Object",
|
||||
"Gst.Segment",
|
||||
"Gst.StaticCaps",
|
||||
"Gst.StaticPadTemplate",
|
||||
"GstPbutils.EncodingProfile",
|
||||
"GstPbutils.DiscovererInfo",
|
||||
"GstPbutils.DiscovererStreamInfo",
|
||||
"Gst.Object",
|
||||
"Gst.Element",
|
||||
"Gst.Pad",
|
||||
"Gst.Pipeline",
|
||||
]
|
||||
|
||||
generate = [
|
||||
"GES.EditMode",
|
||||
"GES.PipelineFlags",
|
||||
"GES.Edge",
|
||||
"GES.Effect",
|
||||
"GES.TrackType",
|
||||
"GES.BaseEffect",
|
||||
"GES.TimelineElement",
|
||||
"GES.Group",
|
||||
"GES.TrackElement",
|
||||
"GES.Layer",
|
||||
"GES.Clip",
|
||||
"GES.UriClip",
|
||||
"GES.Asset",
|
||||
"GES.UriClipAsset",
|
||||
"GES.UriSourceAsset",
|
||||
"GES.Extractable",
|
||||
"GES.Project",
|
||||
]
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Structure"
|
||||
status = "manual"
|
||||
ref_mode = "ref-mut"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Caps"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Buffer"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.BufferList"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Sample"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.ClockTime"
|
||||
status = "manual"
|
||||
conversion_type = "scalar"
|
||||
|
||||
[[object]]
|
||||
name = "GES.Timeline"
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
name = "append_layer"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
||||
[[object.function]]
|
||||
name = "load_from_uri"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to load from uri"
|
||||
|
||||
[[object.function]]
|
||||
name = "add_layer"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to add layer"
|
||||
|
||||
[[object.function]]
|
||||
name = "remove_layer"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to remove layer"
|
||||
|
||||
[[object.function]]
|
||||
name = "add_track"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to add track"
|
||||
|
||||
[[object.function]]
|
||||
name = "move_layer"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to move layer"
|
||||
|
||||
|
||||
[[object]]
|
||||
name = "GES.Container"
|
||||
status = "generate"
|
||||
trait_name = "GESContainerExt"
|
||||
[[object.function]]
|
||||
name = "add"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to add element"
|
||||
|
||||
[[object.function]]
|
||||
name = "remove"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to remove element"
|
||||
|
||||
[[object.function]]
|
||||
name = "edit"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to edit container"
|
||||
|
||||
[[object]]
|
||||
name = "GES.Pipeline"
|
||||
status = "generate"
|
||||
trait_name = "GESPipelineExt"
|
||||
[[object.function]]
|
||||
name = "set_render_settings"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to set render settings"
|
||||
|
||||
[[object.function]]
|
||||
name = "set_mode"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to set mode"
|
||||
|
||||
[[object.function]]
|
||||
name = "save_thumbnail"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to save thumbnail"
|
||||
|
||||
[[object]]
|
||||
name = "GES.Track"
|
||||
status = "generate"
|
||||
trait_name = "GESTrackExt"
|
||||
[[object.function]]
|
||||
name = "add_element"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to add element"
|
||||
|
||||
[[object.function]]
|
||||
name = "remove_element"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to remove element"
|
|
@ -141,3 +141,96 @@ trait = false
|
|||
name = "GstPbutils.DiscovererContainerInfo"
|
||||
status = "generate"
|
||||
trait = false
|
||||
|
||||
[[object]]
|
||||
name = "GstPbutils.EncodingProfile"
|
||||
status = "generate"
|
||||
|
||||
# Ignore all setters, making it immutable. A builder will be provided.
|
||||
[[object.function]]
|
||||
name = "new"
|
||||
ignore = true
|
||||
[[object.function]]
|
||||
pattern = "set_.*"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "copy"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
||||
[[object.function]]
|
||||
name = "get_input_caps"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
||||
[[object.function]]
|
||||
name = "get_format"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
||||
[[object.property]]
|
||||
name = "restriction-caps"
|
||||
# encodingprofile is immutable after constructed
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstPbutils.EncodingContainerProfile"
|
||||
status = "generate"
|
||||
|
||||
# Make it immutable, only able to be constructed for a builder
|
||||
[[object.function]]
|
||||
name = "new"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "add_profile"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstPbutils.EncodingTarget"
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
name = "add_profile"
|
||||
# can be provided on constructor and we better
|
||||
# consider this immutable
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "get_category"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
[[object.function]]
|
||||
name = "get_description"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
[[object.function]]
|
||||
name = "get_name"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
||||
[[object]]
|
||||
name = "GstPbutils.EncodingAudioProfile"
|
||||
status = "generate"
|
||||
trait = false
|
||||
# Ignore all setters, making it immutable. A builder will be provided.
|
||||
[[object.function]]
|
||||
name = "new"
|
||||
ignore = true
|
||||
[[object.function]]
|
||||
pattern = "set_.*"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstPbutils.EncodingVideoProfile"
|
||||
status = "generate"
|
||||
trait = false
|
||||
# Ignore all setters, making it immutable. A builder will be provided.
|
||||
[[object.function]]
|
||||
name = "new"
|
||||
ignore = true
|
||||
[[object.function]]
|
||||
pattern = "set_.*"
|
||||
ignore = true
|
||||
|
||||
|
|
|
@ -59,8 +59,3 @@ status = "generate"
|
|||
name = "set_render_rectangle"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to set render rectangle"
|
||||
|
||||
[[object.function]]
|
||||
name = "prepare_window_handle"
|
||||
# to be called by subclasses
|
||||
ignore = true
|
||||
|
|
14
README.md
14
README.md
|
@ -1,7 +1,9 @@
|
|||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer.svg)](https://crates.io/crates/gstreamer) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
|
||||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer.svg)](https://crates.io/crates/gstreamer) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) bindings for Rust.
|
||||
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
@ -14,7 +16,7 @@ API metadata provided by the GStreamer project. Older versions before 0.8.0 were
|
|||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
|
@ -145,7 +147,7 @@ $ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG
|
|||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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
|
||||
|
@ -161,12 +163,12 @@ 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://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
|
||||
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
|
|
@ -546,6 +546,187 @@ a `glib::List` of
|
|||
bytes are not available
|
||||
<!-- impl Adapter::fn unmap -->
|
||||
Releases the memory obtained with the last `Adapter::map`.
|
||||
<!-- struct Aggregator -->
|
||||
Manages a set of pads with the purpose of aggregating their buffers.
|
||||
Control is given to the subclass when all pads have data.
|
||||
|
||||
* Base class for mixers and muxers. Subclasses should at least implement
|
||||
the `AggregatorClass.aggregate`() virtual method.
|
||||
|
||||
* Installs a `GstPadChainFunction`, a `GstPadEventFullFunction` and a
|
||||
`GstPadQueryFunction` to queue all serialized data packets per sink pad.
|
||||
Subclasses should not overwrite those, but instead implement
|
||||
`AggregatorClass.sink_event`() and `AggregatorClass.sink_query`() as
|
||||
needed.
|
||||
|
||||
* When data is queued on all pads, the aggregate vmethod is called.
|
||||
|
||||
* One can peek at the data on any given GstAggregatorPad with the
|
||||
gst_aggregator_pad_peek_buffer () method, and remove it from the pad
|
||||
with the gst_aggregator_pad_pop_buffer () method. When a buffer
|
||||
has been taken with pop_buffer (), a new buffer can be queued
|
||||
on that pad.
|
||||
|
||||
* If the subclass wishes to push a buffer downstream in its aggregate
|
||||
implementation, it should do so through the
|
||||
gst_aggregator_finish_buffer () method. This method will take care
|
||||
of sending and ordering mandatory events such as stream start, caps
|
||||
and segment.
|
||||
|
||||
* Same goes for EOS events, which should not be pushed directly by the
|
||||
subclass, it should instead return GST_FLOW_EOS in its aggregate
|
||||
implementation.
|
||||
|
||||
* Note that the aggregator logic regarding gap event handling is to turn
|
||||
these into gap buffers with matching PTS and duration. It will also
|
||||
flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE
|
||||
to ease their identification and subsequent processing.
|
||||
|
||||
* Subclasses must use (a subclass of) `AggregatorPad` for both their
|
||||
sink and source pads.
|
||||
See `gst::ElementClass::add_static_pad_template_with_gtype`.
|
||||
|
||||
This class used to live in gst-plugins-bad and was moved to core.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
# Implements
|
||||
|
||||
[`AggregatorExt`](trait.AggregatorExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait AggregatorExt -->
|
||||
Trait containing all `Aggregator` methods.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
# Implementors
|
||||
|
||||
[`Aggregator`](struct.Aggregator.html)
|
||||
<!-- trait AggregatorExt::fn finish_buffer -->
|
||||
This method will push the provided output buffer downstream. If needed,
|
||||
mandatory events such as stream-start, caps, and segment events will be
|
||||
sent before pushing the buffer.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `buffer`
|
||||
the `gst::Buffer` to push.
|
||||
<!-- trait AggregatorExt::fn get_allocator -->
|
||||
Lets `Aggregator` sub-classes get the memory `allocator`
|
||||
acquired by the base class and its `params`.
|
||||
|
||||
Unref the `allocator` after use it.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `allocator`
|
||||
the `gst::Allocator`
|
||||
used
|
||||
## `params`
|
||||
the
|
||||
`gst::AllocationParams` of `allocator`
|
||||
<!-- trait AggregatorExt::fn get_buffer_pool -->
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the instance of the `gst::BufferPool` used
|
||||
by `trans`; free it after use it
|
||||
<!-- trait AggregatorExt::fn get_latency -->
|
||||
Retrieves the latency values reported by `self` in response to the latency
|
||||
query, or `GST_CLOCK_TIME_NONE` if there is not live source connected and the element
|
||||
will not wait for the clock.
|
||||
|
||||
Typically only called by subclasses.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The latency or `GST_CLOCK_TIME_NONE` if the element does not sync
|
||||
<!-- trait AggregatorExt::fn set_latency -->
|
||||
Lets `Aggregator` sub-classes tell the baseclass what their internal
|
||||
latency is. Will also post a LATENCY message on the bus so the pipeline
|
||||
can reconfigure its global latency.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `min_latency`
|
||||
minimum latency
|
||||
## `max_latency`
|
||||
maximum latency
|
||||
<!-- trait AggregatorExt::fn set_src_caps -->
|
||||
Sets the caps to be used on the src pad.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `caps`
|
||||
The `gst::Caps` to set on the src pad.
|
||||
<!-- struct AggregatorPad -->
|
||||
Pads managed by a `GstAggregor` subclass.
|
||||
|
||||
This class used to live in gst-plugins-bad and was moved to core.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
# Implements
|
||||
|
||||
[`AggregatorPadExt`](trait.AggregatorPadExt.html), [`gst::PadExt`](../gst/trait.PadExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait AggregatorPadExt -->
|
||||
Trait containing all `AggregatorPad` methods.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
# Implementors
|
||||
|
||||
[`AggregatorPad`](struct.AggregatorPad.html)
|
||||
<!-- trait AggregatorPadExt::fn drop_buffer -->
|
||||
Drop the buffer currently queued in `self`.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
TRUE if there was a buffer queued in `self`, or FALSE if not.
|
||||
<!-- trait AggregatorPadExt::fn has_buffer -->
|
||||
|
||||
Feature: `v1_14_1`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the pad has a buffer available as the next thing.
|
||||
<!-- trait AggregatorPadExt::fn is_eos -->
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the pad is EOS, otherwise `false`.
|
||||
<!-- trait AggregatorPadExt::fn peek_buffer -->
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
A reference to the buffer in `self` or
|
||||
NULL if no buffer was queued. You should unref the buffer after
|
||||
usage.
|
||||
<!-- trait AggregatorPadExt::fn pop_buffer -->
|
||||
Steal the ref to the buffer currently queued in `self`.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The buffer in `self` or NULL if no buffer was
|
||||
queued. You should unref the buffer after usage.
|
||||
<!-- struct BaseSink -->
|
||||
`BaseSink` is the base class for sink elements in GStreamer, such as
|
||||
xvimagesink or filesink. It is a layer on top of `gst::Element` that provides a
|
||||
|
|
308
docs/gstreamer-check/docs.md
Normal file
308
docs/gstreamer-check/docs.md
Normal file
|
@ -0,0 +1,308 @@
|
|||
<!-- file * -->
|
||||
<!-- struct TestClock -->
|
||||
GstTestClock is an implementation of `gst::Clock` which has different
|
||||
behaviour compared to `gst::SystemClock`. Time for `gst::SystemClock` advances
|
||||
according to the system time, while time for `TestClock` changes only
|
||||
when `TestClock::set_time` or `TestClock::advance_time` are
|
||||
called. `TestClock` provides unit tests with the possibility to
|
||||
precisely advance the time in a deterministic manner, independent of the
|
||||
system time or any other external factors.
|
||||
|
||||
## Advancing the time of a `TestClock`
|
||||
|
||||
|
||||
```C
|
||||
#include <gst/gst.h>
|
||||
#include <gst/check/gsttestclock.h>
|
||||
|
||||
GstClock *clock;
|
||||
GstTestClock *test_clock;
|
||||
|
||||
clock = gst_test_clock_new ();
|
||||
test_clock = GST_TEST_CLOCK (clock);
|
||||
GST_INFO ("Time: %" GST_TIME_FORMAT, GST_TIME_ARGS (gst_clock_get_time (clock)));
|
||||
gst_test_clock_advance_time ( test_clock, 1 * GST_SECOND);
|
||||
GST_INFO ("Time: %" GST_TIME_FORMAT, GST_TIME_ARGS (gst_clock_get_time (clock)));
|
||||
g_usleep (10 * G_USEC_PER_SEC);
|
||||
GST_INFO ("Time: %" GST_TIME_FORMAT, GST_TIME_ARGS (gst_clock_get_time (clock)));
|
||||
gst_test_clock_set_time (test_clock, 42 * GST_SECOND);
|
||||
GST_INFO ("Time: %" GST_TIME_FORMAT, GST_TIME_ARGS (gst_clock_get_time (clock)));
|
||||
...
|
||||
```
|
||||
|
||||
`gst::Clock` allows for setting up single shot or periodic clock notifications
|
||||
as well as waiting for these notifications synchronously (using
|
||||
`gst::Clock::id_wait`) or asynchronously (using `gst::Clock::id_wait_async` or
|
||||
`gst::Clock::id_wait_async`). This is used by many GStreamer elements,
|
||||
among them `GstBaseSrc` and `GstBaseSink`.
|
||||
|
||||
`TestClock` keeps track of these clock notifications. By calling
|
||||
`TestClock::wait_for_next_pending_id` or
|
||||
`TestClock::wait_for_multiple_pending_ids` a unit tests may wait for the
|
||||
next one or several clock notifications to be requested. Additionally unit
|
||||
tests may release blocked waits in a controlled fashion by calling
|
||||
`TestClock::process_next_clock_id`. This way a unit test can control the
|
||||
inaccuracy (jitter) of clock notifications, since the test can decide to
|
||||
release blocked waits when the clock time has advanced exactly to, or past,
|
||||
the requested clock notification time.
|
||||
|
||||
There are also interfaces for determining if a notification belongs to a
|
||||
`TestClock` or not, as well as getting the number of requested clock
|
||||
notifications so far.
|
||||
|
||||
N.B.: When a unit test waits for a certain amount of clock notifications to
|
||||
be requested in `TestClock::wait_for_next_pending_id` or
|
||||
`TestClock::wait_for_multiple_pending_ids` then these functions may block
|
||||
for a long time. If they block forever then the expected clock notifications
|
||||
were never requested from `TestClock`, and so the assumptions in the code
|
||||
of the unit test are wrong. The unit test case runner in gstcheck is
|
||||
expected to catch these cases either by the default test case timeout or the
|
||||
one set for the unit test by calling tcase_set_timeout\(\).
|
||||
|
||||
The sample code below assumes that the element under test will delay a
|
||||
buffer pushed on the source pad by some latency until it arrives on the sink
|
||||
pad. Moreover it is assumed that the element will at some point call
|
||||
`gst::Clock::id_wait` to synchronously wait for a specific time. The first
|
||||
buffer sent will arrive exactly on time only delayed by the latency. The
|
||||
second buffer will arrive a little late (7ms) due to simulated jitter in the
|
||||
clock notification.
|
||||
|
||||
## Demonstration of how to work with clock notifications and `TestClock`
|
||||
|
||||
|
||||
```C
|
||||
#include <gst/gst.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
#include <gst/check/gsttestclock.h>
|
||||
|
||||
GstClockTime latency;
|
||||
GstElement *element;
|
||||
GstPad *srcpad;
|
||||
GstClock *clock;
|
||||
GstTestClock *test_clock;
|
||||
GstBuffer buf;
|
||||
GstClockID pending_id;
|
||||
GstClockID processed_id;
|
||||
|
||||
latency = 42 * GST_MSECOND;
|
||||
element = create_element (latency, ...);
|
||||
srcpad = get_source_pad (element);
|
||||
|
||||
clock = gst_test_clock_new ();
|
||||
test_clock = GST_TEST_CLOCK (clock);
|
||||
gst_element_set_clock (element, clock);
|
||||
|
||||
GST_INFO ("Set time, create and push the first buffer\n");
|
||||
gst_test_clock_set_time (test_clock, 0);
|
||||
buf = create_test_buffer (gst_clock_get_time (clock), ...);
|
||||
gst_assert_cmpint (gst_pad_push (srcpad, buf), ==, GST_FLOW_OK);
|
||||
|
||||
GST_INFO ("Block until element is waiting for a clock notification\n");
|
||||
gst_test_clock_wait_for_next_pending_id (test_clock, &pending_id);
|
||||
GST_INFO ("Advance to the requested time of the clock notification\n");
|
||||
gst_test_clock_advance_time (test_clock, latency);
|
||||
GST_INFO ("Release the next blocking wait and make sure it is the one from element\n");
|
||||
processed_id = gst_test_clock_process_next_clock_id (test_clock);
|
||||
g_assert (processed_id == pending_id);
|
||||
g_assert_cmpint (GST_CLOCK_ENTRY_STATUS (processed_id), ==, GST_CLOCK_OK);
|
||||
gst_clock_id_unref (pending_id);
|
||||
gst_clock_id_unref (processed_id);
|
||||
|
||||
GST_INFO ("Validate that element produced an output buffer and check its timestamp\n");
|
||||
g_assert_cmpint (get_number_of_output_buffer (...), ==, 1);
|
||||
buf = get_buffer_pushed_by_element (element, ...);
|
||||
g_assert_cmpint (GST_BUFFER_TIMESTAMP (buf), ==, latency);
|
||||
gst_buffer_unref (buf);
|
||||
GST_INFO ("Check that element does not wait for any clock notification\n");
|
||||
g_assert (!gst_test_clock_peek_next_pending_id (test_clock, NULL));
|
||||
|
||||
GST_INFO ("Set time, create and push the second buffer\n");
|
||||
gst_test_clock_advance_time (test_clock, 10 * GST_SECOND);
|
||||
buf = create_test_buffer (gst_clock_get_time (clock), ...);
|
||||
gst_assert_cmpint (gst_pad_push (srcpad, buf), ==, GST_FLOW_OK);
|
||||
|
||||
GST_INFO ("Block until element is waiting for a new clock notification\n");
|
||||
(gst_test_clock_wait_for_next_pending_id (test_clock, &pending_id);
|
||||
GST_INFO ("Advance past 7ms beyond the requested time of the clock notification\n");
|
||||
gst_test_clock_advance_time (test_clock, latency + 7 * GST_MSECOND);
|
||||
GST_INFO ("Release the next blocking wait and make sure it is the one from element\n");
|
||||
processed_id = gst_test_clock_process_next_clock_id (test_clock);
|
||||
g_assert (processed_id == pending_id);
|
||||
g_assert_cmpint (GST_CLOCK_ENTRY_STATUS (processed_id), ==, GST_CLOCK_OK);
|
||||
gst_clock_id_unref (pending_id);
|
||||
gst_clock_id_unref (processed_id);
|
||||
|
||||
GST_INFO ("Validate that element produced an output buffer and check its timestamp\n");
|
||||
g_assert_cmpint (get_number_of_output_buffer (...), ==, 1);
|
||||
buf = get_buffer_pushed_by_element (element, ...);
|
||||
g_assert_cmpint (GST_BUFFER_TIMESTAMP (buf), ==,
|
||||
10 * GST_SECOND + latency + 7 * GST_MSECOND);
|
||||
gst_buffer_unref (buf);
|
||||
GST_INFO ("Check that element does not wait for any clock notification\n");
|
||||
g_assert (!gst_test_clock_peek_next_pending_id (test_clock, NULL));
|
||||
...
|
||||
```
|
||||
|
||||
Since `TestClock` is only supposed to be used in unit tests it calls
|
||||
`g_assert`, `g_assert_cmpint` or `g_assert_cmpuint` to validate all function
|
||||
arguments. This will highlight any issues with the unit test code itself.
|
||||
|
||||
# Implements
|
||||
|
||||
[`gst::ClockExt`](../gst/trait.ClockExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- impl TestClock::fn new -->
|
||||
Creates a new test clock with its time set to zero.
|
||||
|
||||
MT safe.
|
||||
|
||||
# Returns
|
||||
|
||||
a `TestClock` cast to `gst::Clock`.
|
||||
<!-- impl TestClock::fn new_with_start_time -->
|
||||
Creates a new test clock with its time set to the specified time.
|
||||
|
||||
MT safe.
|
||||
## `start_time`
|
||||
a `gst::ClockTime` set to the desired start time of the clock.
|
||||
|
||||
# Returns
|
||||
|
||||
a `TestClock` cast to `gst::Clock`.
|
||||
<!-- impl TestClock::fn id_list_get_latest_time -->
|
||||
Finds the latest time inside the list.
|
||||
|
||||
MT safe.
|
||||
## `pending_list`
|
||||
List
|
||||
of of pending `GstClockIDs`
|
||||
<!-- impl TestClock::fn advance_time -->
|
||||
Advances the time of the `self` by the amount given by `delta`. The
|
||||
time of `self` is monotonically increasing, therefore providing a
|
||||
`delta` which is negative or zero is a programming error.
|
||||
|
||||
MT safe.
|
||||
## `delta`
|
||||
a positive `gst::ClockTimeDiff` to be added to the time of the clock
|
||||
<!-- impl TestClock::fn crank -->
|
||||
A "crank" consists of three steps:
|
||||
1: Wait for a `gst::ClockID` to be registered with the `TestClock`.
|
||||
2: Advance the `TestClock` to the time the `gst::ClockID` is waiting for.
|
||||
3: Release the `gst::ClockID` wait.
|
||||
A "crank" can be though of as the notion of
|
||||
manually driving the clock forward to its next logical step.
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the crank was successful, `false` otherwise.
|
||||
|
||||
MT safe.
|
||||
<!-- impl TestClock::fn get_next_entry_time -->
|
||||
Retrieve the requested time for the next pending clock notification.
|
||||
|
||||
MT safe.
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::ClockTime` set to the time of the next pending clock
|
||||
notification. If no clock notifications have been requested
|
||||
`GST_CLOCK_TIME_NONE` will be returned.
|
||||
<!-- impl TestClock::fn has_id -->
|
||||
Checks whether `self` was requested to provide the clock notification
|
||||
given by `id`.
|
||||
|
||||
MT safe.
|
||||
## `id`
|
||||
a `gst::ClockID` clock notification
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the clock has been asked to provide the given clock
|
||||
notification, `false` otherwise.
|
||||
<!-- impl TestClock::fn peek_id_count -->
|
||||
Determine the number of pending clock notifications that have been
|
||||
requested from the `self`.
|
||||
|
||||
MT safe.
|
||||
|
||||
# Returns
|
||||
|
||||
the number of pending clock notifications.
|
||||
<!-- impl TestClock::fn peek_next_pending_id -->
|
||||
Determines if the `pending_id` is the next clock notification scheduled to
|
||||
be triggered given the current time of the `self`.
|
||||
|
||||
MT safe.
|
||||
## `pending_id`
|
||||
a `gst::ClockID` clock
|
||||
notification to look for
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `pending_id` is the next clock notification to be
|
||||
triggered, `false` otherwise.
|
||||
<!-- impl TestClock::fn process_id_list -->
|
||||
Processes and releases the pending IDs in the list.
|
||||
|
||||
MT safe.
|
||||
## `pending_list`
|
||||
List
|
||||
of pending `GstClockIDs`
|
||||
<!-- impl TestClock::fn process_next_clock_id -->
|
||||
MT safe.
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::ClockID` containing the next pending clock
|
||||
notification.
|
||||
<!-- impl TestClock::fn set_time -->
|
||||
Sets the time of `self` to the time given by `new_time`. The time of
|
||||
`self` is monotonically increasing, therefore providing a `new_time`
|
||||
which is earlier or equal to the time of the clock as given by
|
||||
`gst::ClockExt::get_time` is a programming error.
|
||||
|
||||
MT safe.
|
||||
## `new_time`
|
||||
a `gst::ClockTime` later than that returned by `gst::ClockExt::get_time`
|
||||
<!-- impl TestClock::fn wait_for_multiple_pending_ids -->
|
||||
Blocks until at least `count` clock notifications have been requested from
|
||||
`self`. There is no timeout for this wait, see the main description of
|
||||
`TestClock`.
|
||||
|
||||
MT safe.
|
||||
## `count`
|
||||
the number of pending clock notifications to wait for
|
||||
## `pending_list`
|
||||
Address
|
||||
of a `glib::List` pointer variable to store the list of pending `GstClockIDs`
|
||||
that expired, or `None`
|
||||
<!-- impl TestClock::fn wait_for_next_pending_id -->
|
||||
Waits until a clock notification is requested from `self`. There is no
|
||||
timeout for this wait, see the main description of `TestClock`. A reference
|
||||
to the pending clock notification is stored in `pending_id`.
|
||||
|
||||
MT safe.
|
||||
## `pending_id`
|
||||
`gst::ClockID`
|
||||
with information about the pending clock notification
|
||||
<!-- impl TestClock::fn wait_for_pending_id_count -->
|
||||
Blocks until at least `count` clock notifications have been requested from
|
||||
`self`. There is no timeout for this wait, see the main description of
|
||||
`TestClock`.
|
||||
|
||||
# Deprecated
|
||||
|
||||
use `TestClock::wait_for_multiple_pending_ids` instead.
|
||||
## `count`
|
||||
the number of pending clock notifications to wait for
|
||||
<!-- trait TestClockExt::fn get_property_start-time -->
|
||||
When a `TestClock` is constructed it will have a certain start time set.
|
||||
If the clock was created using `TestClock::new_with_start_time` then
|
||||
this property contains the value of the `start_time` argument. If
|
||||
`TestClock::new` was called the clock started at time zero, and thus
|
||||
this property contains the value 0.
|
||||
<!-- trait TestClockExt::fn set_property_start-time -->
|
||||
When a `TestClock` is constructed it will have a certain start time set.
|
||||
If the clock was created using `TestClock::new_with_start_time` then
|
||||
this property contains the value of the `start_time` argument. If
|
||||
`TestClock::new` was called the clock started at time zero, and thus
|
||||
this property contains the value 0.
|
2562
docs/gstreamer-editing-services/docs.md
Normal file
2562
docs/gstreamer-editing-services/docs.md
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,9 @@
|
|||
<!-- file * -->
|
||||
<!-- enum WebRTCDTLSSetup -->
|
||||
GST_WEBRTC_DTLS_SETUP_NONE: none
|
||||
GST_WEBRTC_DTLS_SETUP_ACTPASS: actpass
|
||||
GST_WEBRTC_DTLS_SETUP_ACTIVE: sendonly
|
||||
GST_WEBRTC_DTLS_SETUP_PASSIVE: recvonly
|
||||
<!-- struct WebRTCDTLSTransport -->
|
||||
|
||||
|
||||
|
@ -37,6 +42,14 @@ GST_WEBRTC_ICE_ROLE_CONTROLLING: controlling
|
|||
# Implements
|
||||
|
||||
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- enum WebRTCPeerConnectionState -->
|
||||
GST_WEBRTC_PEER_CONNECTION_STATE_NEW: new
|
||||
GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING: connecting
|
||||
GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED: connected
|
||||
GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED: disconnected
|
||||
GST_WEBRTC_PEER_CONNECTION_STATE_FAILED: failed
|
||||
GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED: closed
|
||||
See <ulink url="http://w3c.github.io/webrtc-pc/`dom`-rtcpeerconnectionstate">http://w3c.github.io/webrtc-pc/`dom`-rtcpeerconnectionstate`</ulink>`
|
||||
<!-- struct WebRTCRTPReceiver -->
|
||||
|
||||
|
||||
|
@ -55,6 +68,7 @@ GST_WEBRTC_ICE_ROLE_CONTROLLING: controlling
|
|||
# Implements
|
||||
|
||||
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- enum WebRTCRTPTransceiverDirection -->
|
||||
<!-- enum WebRTCSDPType -->
|
||||
GST_WEBRTC_SDP_TYPE_OFFER: offer
|
||||
GST_WEBRTC_SDP_TYPE_PRANSWER: pranswer
|
||||
|
@ -62,7 +76,6 @@ GST_WEBRTC_SDP_TYPE_ANSWER: answer
|
|||
GST_WEBRTC_SDP_TYPE_ROLLBACK: rollback
|
||||
See <ulink url="http://w3c.github.io/webrtc-pc/`rtcsdptype`">http://w3c.github.io/webrtc-pc/`rtcsdptype``</ulink>`
|
||||
<!-- struct WebRTCSessionDescription -->
|
||||
sdp: the `gst_sdp::SDPMessage` of the description
|
||||
See <ulink url="https://www.w3.org/TR/webrtc/`rtcsessiondescription`-class">https://www.w3.org/TR/webrtc/`rtcsessiondescription`-class`</ulink>`
|
||||
<!-- impl WebRTCSessionDescription::fn new -->
|
||||
## `type_`
|
||||
|
@ -81,3 +94,26 @@ a new `WebRTCSessionDescription` from `type_`
|
|||
a new copy of `self`
|
||||
<!-- impl WebRTCSessionDescription::fn free -->
|
||||
Free `self` and all associated resources
|
||||
<!-- enum WebRTCSignalingState -->
|
||||
GST_WEBRTC_SIGNALING_STATE_STABLE: stable
|
||||
GST_WEBRTC_SIGNALING_STATE_CLOSED: closed
|
||||
GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER: have-local-offer
|
||||
GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER: have-remote-offer
|
||||
GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER: have-local-pranswer
|
||||
GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER: have-remote-pranswer
|
||||
See <ulink url="http://w3c.github.io/webrtc-pc/`dom`-rtcsignalingstate">http://w3c.github.io/webrtc-pc/`dom`-rtcsignalingstate`</ulink>`
|
||||
<!-- enum WebRTCStatsType -->
|
||||
GST_WEBRTC_STATS_CODEC: codec
|
||||
GST_WEBRTC_STATS_INBOUND_RTP: inbound-rtp
|
||||
GST_WEBRTC_STATS_OUTBOUND_RTP: outbound-rtp
|
||||
GST_WEBRTC_STATS_REMOTE_INBOUND_RTP: remote-inbound-rtp
|
||||
GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP: remote-outbound-rtp
|
||||
GST_WEBRTC_STATS_CSRC: csrc
|
||||
GST_WEBRTC_STATS_PEER_CONNECTION: peer-connectiion
|
||||
GST_WEBRTC_STATS_DATA_CHANNEL: data-channel
|
||||
GST_WEBRTC_STATS_STREAM: stream
|
||||
GST_WEBRTC_STATS_TRANSPORT: transport
|
||||
GST_WEBRTC_STATS_CANDIDATE_PAIR: candidate-pair
|
||||
GST_WEBRTC_STATS_LOCAL_CANDIDATE: local-candidate
|
||||
GST_WEBRTC_STATS_REMOTE_CANDIDATE: remote-candidate
|
||||
GST_WEBRTC_STATS_CERTIFICATE: certificate
|
||||
|
|
|
@ -693,7 +693,8 @@ Copy `size` bytes starting from `offset` in `self` to `dest`.
|
|||
## `offset`
|
||||
the offset to extract
|
||||
## `dest`
|
||||
the destination address
|
||||
|
||||
the destination address
|
||||
## `size`
|
||||
the size to extract
|
||||
|
||||
|
@ -12157,8 +12158,9 @@ outside of the segment is extrapolated.
|
|||
When 1 is returned, `running_time` resulted in a positive position returned
|
||||
in `position`.
|
||||
|
||||
When this function returns -1, the returned `position` should be negated
|
||||
to get the real negative segment position.
|
||||
When this function returns -1, the returned `position` was < 0, and the value
|
||||
in the position variable should be negated to get the real negative segment
|
||||
position.
|
||||
## `format`
|
||||
the format of the segment.
|
||||
## `running_time`
|
||||
|
|
|
@ -4,29 +4,31 @@ version = "0.12.0"
|
|||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
|
||||
[dependencies]
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-app = { path = "../gstreamer-app" }
|
||||
gstreamer-audio = { path = "../gstreamer-audio" }
|
||||
gstreamer-video = { path = "../gstreamer-video" }
|
||||
gstreamer-pbutils = { path = "../gstreamer-pbutils" }
|
||||
gstreamer-player = { path = "../gstreamer-player", optional = true }
|
||||
gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true }
|
||||
gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true }
|
||||
gstreamer-rtsp-server-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gtk = { git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true }
|
||||
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true }
|
||||
gio = { git = "https://github.com/gtk-rs/gio", optional = true }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
gstreamer-app = { version = "0.12", path = "../gstreamer-app" }
|
||||
gstreamer-audio = { version = "0.12", path = "../gstreamer-audio" }
|
||||
gstreamer-video = { version = "0.12", path = "../gstreamer-video" }
|
||||
gstreamer-pbutils = { version = "0.12", path = "../gstreamer-pbutils" }
|
||||
gstreamer-player = { version = "0.12", path = "../gstreamer-player", optional = true }
|
||||
gstreamer-rtsp = { version = "0.12", path = "../gstreamer-rtsp", optional = true }
|
||||
gstreamer-rtsp-server = { version = "0.12", path = "../gstreamer-rtsp-server", optional = true }
|
||||
gstreamer-rtsp-server-sys = { version = "0.6", features = ["v1_8"], optional = true }
|
||||
gstreamer-editing-services = { version = "0.12", path = "../gstreamer-editing-services", optional = true }
|
||||
gtk = { version = "0.5", features = ["v3_6"], optional = true }
|
||||
gdk = { version = "0.9", optional = true }
|
||||
gio = { version = "0.5", optional = true }
|
||||
futures-preview = { version = "0.2", optional = true }
|
||||
byte-slice-cast = "0.2"
|
||||
failure = "0.1"
|
||||
failure_derive = "0.1"
|
||||
cairo-rs = { git = "https://github.com/gtk-rs/cairo", features=["use_glib"], optional = true }
|
||||
pango = { git = "https://github.com/gtk-rs/pango", optional = true }
|
||||
pangocairo = { git = "https://github.com/gtk-rs/pangocairo", optional = true }
|
||||
cairo-rs = { version = "0.5", features=["use_glib"], optional = true }
|
||||
pango = { version = "0.5", optional = true }
|
||||
pangocairo = { version = "0.6", optional = true }
|
||||
|
||||
[features]
|
||||
gst-player = ["gstreamer-player"]
|
||||
ges = ["gstreamer-editing-services"]
|
||||
gtksink = ["gtk", "gio"]
|
||||
gtkvideooverlay = ["gtk", "gdk", "gio"]
|
||||
gtkvideooverlay-x11 = ["gtkvideooverlay"]
|
||||
|
@ -34,14 +36,11 @@ gtkvideooverlay-quartz = ["gtkvideooverlay"]
|
|||
generic-futures = ["gstreamer/futures", "futures-preview"]
|
||||
glib-futures = ["generic-futures", "glib/futures"]
|
||||
gst-rtsp-server = ["gstreamer-rtsp-server"]
|
||||
gst-rtsp-server-record = ["gstreamer-rtsp-server", "gstreamer-rtsp", "gio"]
|
||||
gst-rtsp-server-record = ["gstreamer-rtsp-server-sys", "gstreamer-rtsp-server", "gstreamer-rtsp", "gio"]
|
||||
default-features = []
|
||||
v1_10 = ["gstreamer/v1_10"]
|
||||
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" }
|
||||
|
||||
[[bin]]
|
||||
name = "appsink"
|
||||
|
||||
|
@ -51,6 +50,9 @@ name = "appsrc"
|
|||
[[bin]]
|
||||
name = "decodebin"
|
||||
|
||||
[[bin]]
|
||||
name = "encodebin"
|
||||
|
||||
[[bin]]
|
||||
name = "events"
|
||||
|
||||
|
@ -118,3 +120,7 @@ name = "discoverer"
|
|||
[[bin]]
|
||||
name = "pango-cairo"
|
||||
required-features = ["pango-cairo"]
|
||||
|
||||
[[bin]]
|
||||
name = "ges"
|
||||
required-features = ["ges"]
|
||||
|
|
|
@ -29,9 +29,7 @@ struct MissingElement(&'static str);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
|
|
@ -23,9 +23,7 @@ struct MissingElement(&'static str);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
|
|
@ -25,9 +25,7 @@ struct MissingElement(&'static str);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
@ -189,7 +187,8 @@ fn example_main() -> Result<(), Error> {
|
|||
error: err.get_error().description().into(),
|
||||
debug: err.get_debug(),
|
||||
cause: err.get_error(),
|
||||
}.into()),
|
||||
}
|
||||
.into()),
|
||||
}?;
|
||||
}
|
||||
#[cfg(not(feature = "v1_10"))]
|
||||
|
|
291
examples/src/bin/encodebin.rs
Normal file
291
examples/src/bin/encodebin.rs
Normal file
|
@ -0,0 +1,291 @@
|
|||
#[macro_use]
|
||||
extern crate gstreamer as gst;
|
||||
use gst::prelude::*;
|
||||
|
||||
extern crate gstreamer_pbutils as gst_pbutils;
|
||||
use gst_pbutils::prelude::*;
|
||||
|
||||
extern crate glib;
|
||||
|
||||
use std::env;
|
||||
use std::error::Error as StdError;
|
||||
#[cfg(feature = "v1_10")]
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
extern crate failure;
|
||||
use failure::Error;
|
||||
|
||||
#[macro_use]
|
||||
extern crate failure_derive;
|
||||
|
||||
#[path = "../examples-common.rs"]
|
||||
mod examples_common;
|
||||
|
||||
#[derive(Debug, Fail)]
|
||||
#[fail(display = "Missing element {}", _0)]
|
||||
struct MissingElement(&'static str);
|
||||
|
||||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
error: String,
|
||||
debug: Option<String>,
|
||||
#[cause]
|
||||
cause: glib::Error,
|
||||
}
|
||||
|
||||
fn configure_encodebin(encodebin: &gst::Element) -> Result<(), Error> {
|
||||
let audio_profile = gst_pbutils::EncodingAudioProfileBuilder::new()
|
||||
.format(&gst::Caps::new_simple("audio/x-vorbis", &[]))
|
||||
.presence(0)
|
||||
.build()?;
|
||||
|
||||
let video_profile = gst_pbutils::EncodingVideoProfileBuilder::new()
|
||||
.format(&gst::Caps::new_simple("video/x-theora", &[]))
|
||||
.presence(0)
|
||||
.build()?;
|
||||
|
||||
let container_profile = gst_pbutils::EncodingContainerProfileBuilder::new()
|
||||
.name("container")
|
||||
.format(&gst::Caps::new_simple("video/x-matroska", &[]))
|
||||
.add_profile(&(video_profile))
|
||||
.add_profile(&(audio_profile))
|
||||
.build()?;
|
||||
|
||||
encodebin
|
||||
.set_property("profile", &container_profile)
|
||||
.expect("set profile property failed");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn example_main() -> Result<(), Error> {
|
||||
gst::init()?;
|
||||
|
||||
let args: Vec<_> = env::args().collect();
|
||||
let uri: &str;
|
||||
let output_file: &str;
|
||||
|
||||
if args.len() == 3 {
|
||||
uri = args[1].as_ref();
|
||||
output_file = args[2].as_ref();
|
||||
} else {
|
||||
println!("Usage: encodebin URI output_file");
|
||||
std::process::exit(-1)
|
||||
};
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let src =
|
||||
gst::ElementFactory::make("uridecodebin", None).ok_or(MissingElement("uridecodebin"))?;
|
||||
let encodebin =
|
||||
gst::ElementFactory::make("encodebin", None).ok_or(MissingElement("encodebin"))?;
|
||||
let sink = gst::ElementFactory::make("filesink", None).ok_or(MissingElement("filesink"))?;
|
||||
|
||||
src.set_property("uri", &uri)
|
||||
.expect("setting URI Property failed");
|
||||
sink.set_property("location", &output_file)
|
||||
.expect("setting location property failed");
|
||||
|
||||
configure_encodebin(&encodebin)?;
|
||||
|
||||
pipeline
|
||||
.add_many(&[&src, &encodebin, &sink])
|
||||
.expect("failed to add elements to pipeline");
|
||||
gst::Element::link_many(&[&encodebin, &sink])?;
|
||||
|
||||
// Need to move a new reference into the closure
|
||||
let pipeline_clone = pipeline.clone();
|
||||
src.connect_pad_added(move |dbin, dbin_src_pad| {
|
||||
let pipeline = &pipeline_clone;
|
||||
|
||||
let (is_audio, is_video) = {
|
||||
let media_type = dbin_src_pad.get_current_caps().and_then(|caps| {
|
||||
caps.get_structure(0).map(|s| {
|
||||
let name = s.get_name();
|
||||
(name.starts_with("audio/"), name.starts_with("video/"))
|
||||
})
|
||||
});
|
||||
|
||||
match media_type {
|
||||
None => {
|
||||
gst_element_warning!(
|
||||
dbin,
|
||||
gst::CoreError::Negotiation,
|
||||
(
|
||||
"Failed to get media type from pad {}",
|
||||
dbin_src_pad.get_name()
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
Some(media_type) => media_type,
|
||||
}
|
||||
};
|
||||
|
||||
let link_to_encodebin = |is_audio, is_video| -> Result<(), Error> {
|
||||
if is_audio {
|
||||
let queue =
|
||||
gst::ElementFactory::make("queue", None).ok_or(MissingElement("queue"))?;
|
||||
let convert = gst::ElementFactory::make("audioconvert", None)
|
||||
.ok_or(MissingElement("audioconvert"))?;
|
||||
let resample = gst::ElementFactory::make("audioresample", None)
|
||||
.ok_or(MissingElement("audioresample"))?;
|
||||
|
||||
let elements = &[&queue, &convert, &resample];
|
||||
pipeline
|
||||
.add_many(elements)
|
||||
.expect("failed to add audio elements to pipeline");
|
||||
gst::Element::link_many(elements)?;
|
||||
|
||||
let enc_sink_pad = encodebin
|
||||
.get_request_pad("audio_%u")
|
||||
.expect("Could not get audio pad from encodebin");
|
||||
let src_pad = resample
|
||||
.get_static_pad("src")
|
||||
.expect("resample has no srcpad");
|
||||
src_pad.link(&enc_sink_pad).into_result()?;
|
||||
|
||||
for e in elements {
|
||||
e.sync_state_with_parent()?;
|
||||
}
|
||||
|
||||
let sink_pad = queue.get_static_pad("sink").expect("queue has no sinkpad");
|
||||
dbin_src_pad.link(&sink_pad).into_result()?;
|
||||
} else if is_video {
|
||||
let queue =
|
||||
gst::ElementFactory::make("queue", None).ok_or(MissingElement("queue"))?;
|
||||
let convert = gst::ElementFactory::make("videoconvert", None)
|
||||
.ok_or(MissingElement("videoconvert"))?;
|
||||
let scale = gst::ElementFactory::make("videoscale", None)
|
||||
.ok_or(MissingElement("videoscale"))?;
|
||||
|
||||
let elements = &[&queue, &convert, &scale];
|
||||
pipeline
|
||||
.add_many(elements)
|
||||
.expect("failed to add video elements to pipeline");
|
||||
gst::Element::link_many(elements)?;
|
||||
|
||||
let enc_sink_pad = encodebin
|
||||
.get_request_pad("video_%u")
|
||||
.expect("Could not get video pad from encodebin");
|
||||
let src_pad = scale
|
||||
.get_static_pad("src")
|
||||
.expect("videoscale has no srcpad");
|
||||
src_pad.link(&enc_sink_pad).into_result()?;
|
||||
|
||||
for e in elements {
|
||||
e.sync_state_with_parent()?
|
||||
}
|
||||
|
||||
let sink_pad = queue.get_static_pad("sink").expect("queue has no sinkpad");
|
||||
dbin_src_pad.link(&sink_pad).into_result()?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
};
|
||||
|
||||
if let Err(err) = link_to_encodebin(is_audio, is_video) {
|
||||
#[cfg(feature = "v1_10")]
|
||||
gst_element_error!(
|
||||
dbin,
|
||||
gst::LibraryError::Failed,
|
||||
("Failed to insert sink"),
|
||||
details: gst::Structure::builder("error-details")
|
||||
.field("error",
|
||||
&glib::AnySendValue::new(Arc::new(Mutex::new(Some(err)))))
|
||||
.build()
|
||||
);
|
||||
|
||||
#[cfg(not(feature = "v1_10"))]
|
||||
gst_element_error!(
|
||||
dbin,
|
||||
gst::LibraryError::Failed,
|
||||
("Failed to insert sink"),
|
||||
["{}", err]
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
pipeline.set_state(gst::State::Playing).into_result()?;
|
||||
|
||||
let bus = pipeline
|
||||
.get_bus()
|
||||
.expect("Pipeline without bus. Shouldn't happen!");
|
||||
|
||||
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
|
||||
use gst::MessageView;
|
||||
|
||||
match msg.view() {
|
||||
MessageView::Eos(..) => break,
|
||||
MessageView::Error(err) => {
|
||||
pipeline.set_state(gst::State::Null).into_result()?;
|
||||
|
||||
#[cfg(feature = "v1_10")]
|
||||
{
|
||||
match err.get_details() {
|
||||
Some(details) if details.get_name() == "error-details" => details
|
||||
.get::<&glib::AnySendValue>("error")
|
||||
.cloned()
|
||||
.and_then(|v| {
|
||||
v.downcast_ref::<Arc<Mutex<Option<Error>>>>()
|
||||
.and_then(|v| v.lock().unwrap().take())
|
||||
})
|
||||
.map(Result::Err)
|
||||
.expect("error-details message without actual error"),
|
||||
_ => Err(ErrorMessage {
|
||||
src: err
|
||||
.get_src()
|
||||
.map(|s| s.get_path_string())
|
||||
.unwrap_or_else(|| String::from("None")),
|
||||
error: err.get_error().description().into(),
|
||||
debug: err.get_debug(),
|
||||
cause: err.get_error(),
|
||||
}
|
||||
.into()),
|
||||
}?;
|
||||
}
|
||||
#[cfg(not(feature = "v1_10"))]
|
||||
{
|
||||
Err(ErrorMessage {
|
||||
src: err
|
||||
.get_src()
|
||||
.map(|s| s.get_path_string())
|
||||
.unwrap_or_else(|| String::from("None")),
|
||||
error: err.get_error().description().into(),
|
||||
debug: err.get_debug(),
|
||||
cause: err.get_error(),
|
||||
})?;
|
||||
}
|
||||
break;
|
||||
}
|
||||
MessageView::StateChanged(s) => {
|
||||
println!(
|
||||
"State changed from {:?}: {:?} -> {:?} ({:?})",
|
||||
s.get_src().map(|s| s.get_path_string()),
|
||||
s.get_old(),
|
||||
s.get_current(),
|
||||
s.get_pending()
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
pipeline.set_state(gst::State::Null).into_result()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// tutorials_common::run is only required to set up the application environent on macOS
|
||||
// (but not necessary in normal Cocoa applications where this is set up autmatically)
|
||||
match examples_common::run(example_main) {
|
||||
Ok(r) => r,
|
||||
Err(e) => eprintln!("Error! {}", e),
|
||||
}
|
||||
}
|
104
examples/src/bin/ges.rs
Normal file
104
examples/src/bin/ges.rs
Normal file
|
@ -0,0 +1,104 @@
|
|||
extern crate gstreamer as gst;
|
||||
use gst::prelude::*;
|
||||
|
||||
extern crate gstreamer_editing_services as ges;
|
||||
use ges::prelude::*;
|
||||
|
||||
use std::env;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
#[path = "../examples-common.rs"]
|
||||
mod examples_common;
|
||||
|
||||
extern crate failure;
|
||||
#[allow(unused_imports)]
|
||||
use failure::Error;
|
||||
|
||||
extern crate glib;
|
||||
|
||||
fn main_loop(uri: &str) -> Result<(), glib::BoolError> {
|
||||
ges::init()?;
|
||||
|
||||
let timeline = ges::Timeline::new_audio_video();
|
||||
let layer = timeline.append_layer();
|
||||
let pipeline = ges::Pipeline::new();
|
||||
pipeline.set_timeline(&timeline);
|
||||
|
||||
let clip = ges::UriClip::new(uri);
|
||||
layer.add_clip(&clip);
|
||||
|
||||
let effect = ges::Effect::new("agingtv");
|
||||
clip.add(&effect).unwrap();
|
||||
|
||||
println!(
|
||||
"Agingtv scratch-lines: {}",
|
||||
clip.get_child_property("scratch-lines")
|
||||
.unwrap()
|
||||
.serialize()
|
||||
.unwrap()
|
||||
);
|
||||
|
||||
let asset = clip.get_asset().unwrap();
|
||||
let duration = asset
|
||||
.downcast::<ges::UriClipAsset>()
|
||||
.unwrap()
|
||||
.get_duration();
|
||||
println!(
|
||||
"Clip duration: {} - playing file from {} for {}",
|
||||
duration,
|
||||
duration / 2,
|
||||
duration / 4
|
||||
);
|
||||
|
||||
clip.set_inpoint(duration / 2);
|
||||
clip.set_duration(duration / 4);
|
||||
|
||||
let ret = pipeline.set_state(gst::State::Playing);
|
||||
assert_ne!(ret, gst::StateChangeReturn::Failure);
|
||||
|
||||
let bus = pipeline.get_bus().unwrap();
|
||||
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
|
||||
use gst::MessageView;
|
||||
|
||||
match msg.view() {
|
||||
MessageView::Eos(..) => break,
|
||||
MessageView::Error(err) => {
|
||||
println!(
|
||||
"Error from {:?}: {} ({:?})",
|
||||
err.get_src().map(|s| s.get_path_string()),
|
||||
err.get_error(),
|
||||
err.get_debug()
|
||||
);
|
||||
break;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
let ret = pipeline.set_state(gst::State::Null);
|
||||
assert_ne!(ret, gst::StateChangeReturn::Failure);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn example_main() {
|
||||
let args: Vec<_> = env::args().collect();
|
||||
let uri: &str = if args.len() == 2 {
|
||||
args[1].as_ref()
|
||||
} else {
|
||||
println!("Usage: ges launch");
|
||||
std::process::exit(-1)
|
||||
};
|
||||
|
||||
match main_loop(uri) {
|
||||
Ok(r) => r,
|
||||
Err(e) => eprintln!("Error! {}", e),
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// tutorials_common::run is only required to set up the application environent on macOS
|
||||
// (but not necessary in normal Cocoa applications where this is set up autmatically)
|
||||
examples_common::run(example_main);
|
||||
}
|
|
@ -16,7 +16,8 @@ fn example_main() {
|
|||
let pipeline = gst::parse_launch(&format!(
|
||||
"audiotestsrc name=src ! audio/x-raw,format={},channels=1 ! fakesink",
|
||||
gst_audio::AUDIO_FORMAT_S16.to_string()
|
||||
)).unwrap();
|
||||
))
|
||||
.unwrap();
|
||||
let pipeline = pipeline.dynamic_cast::<gst::Pipeline>().unwrap();
|
||||
|
||||
let src = pipeline.get_by_name("src").unwrap();
|
||||
|
|
|
@ -29,9 +29,7 @@ struct MissingElement(&'static str);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
@ -146,7 +144,8 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
|||
}
|
||||
|
||||
None
|
||||
}).unwrap();
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
let drawer_clone = drawer.clone();
|
||||
overlay
|
||||
|
@ -159,7 +158,8 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
|||
drawer.info = Some(gst_video::VideoInfo::from_caps(&caps).unwrap());
|
||||
|
||||
None
|
||||
}).unwrap();
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
Ok(pipeline)
|
||||
}
|
||||
|
|
|
@ -39,8 +39,9 @@ fn example_main() {
|
|||
} else {
|
||||
None
|
||||
}
|
||||
}.and_then(|pos| pos.try_into_time().ok())
|
||||
.unwrap();
|
||||
}
|
||||
.and_then(|pos| pos.try_into_time().ok())
|
||||
.unwrap();
|
||||
|
||||
let dur = {
|
||||
let mut q = gst::Query::new_duration(gst::Format::Time);
|
||||
|
@ -49,8 +50,9 @@ fn example_main() {
|
|||
} else {
|
||||
None
|
||||
}
|
||||
}.and_then(|dur| dur.try_into_time().ok())
|
||||
.unwrap();
|
||||
}
|
||||
.and_then(|dur| dur.try_into_time().ok())
|
||||
.unwrap();
|
||||
|
||||
println!("{} / {}", pos, dur);
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@ struct UsageError(String);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
@ -172,7 +170,8 @@ fn example_main() -> Result<(), Error> {
|
|||
("clock-rate", &90000i32),
|
||||
("is-fec", &true),
|
||||
],
|
||||
).to_value(),
|
||||
)
|
||||
.to_value(),
|
||||
),
|
||||
96 => Some(
|
||||
gst::Caps::new_simple(
|
||||
|
@ -182,7 +181,8 @@ fn example_main() -> Result<(), Error> {
|
|||
("clock-rate", &90000i32),
|
||||
("encoding-name", &"VP8"),
|
||||
],
|
||||
).to_value(),
|
||||
)
|
||||
.to_value(),
|
||||
),
|
||||
_ => None,
|
||||
}
|
||||
|
@ -266,17 +266,20 @@ fn example_main() -> Result<(), Error> {
|
|||
error: err.get_error().description().into(),
|
||||
debug: err.get_debug(),
|
||||
cause: err.get_error(),
|
||||
}.into());
|
||||
}
|
||||
.into());
|
||||
}
|
||||
MessageView::StateChanged(s) => match msg.get_src() {
|
||||
Some(element) => if element == pipeline && s.get_current() == gst::State::Playing {
|
||||
eprintln!("PLAYING");
|
||||
gst::debug_bin_to_dot_file(
|
||||
&pipeline,
|
||||
gst::DebugGraphDetails::all(),
|
||||
"client-playing",
|
||||
);
|
||||
},
|
||||
Some(element) => {
|
||||
if element == pipeline && s.get_current() == gst::State::Playing {
|
||||
eprintln!("PLAYING");
|
||||
gst::debug_bin_to_dot_file(
|
||||
&pipeline,
|
||||
gst::DebugGraphDetails::all(),
|
||||
"client-playing",
|
||||
);
|
||||
}
|
||||
}
|
||||
None => (),
|
||||
},
|
||||
_ => (),
|
||||
|
|
|
@ -32,9 +32,7 @@ struct UsageError(String);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
@ -199,17 +197,20 @@ fn example_main() -> Result<(), Error> {
|
|||
error: err.get_error().description().into(),
|
||||
debug: err.get_debug(),
|
||||
cause: err.get_error(),
|
||||
}.into());
|
||||
}
|
||||
.into());
|
||||
}
|
||||
MessageView::StateChanged(s) => match msg.get_src() {
|
||||
Some(element) => if element == pipeline && s.get_current() == gst::State::Playing {
|
||||
eprintln!("PLAYING");
|
||||
gst::debug_bin_to_dot_file(
|
||||
&pipeline,
|
||||
gst::DebugGraphDetails::all(),
|
||||
"server-playing",
|
||||
);
|
||||
},
|
||||
Some(element) => {
|
||||
if element == pipeline && s.get_current() == gst::State::Playing {
|
||||
eprintln!("PLAYING");
|
||||
gst::debug_bin_to_dot_file(
|
||||
&pipeline,
|
||||
gst::DebugGraphDetails::all(),
|
||||
"server-playing",
|
||||
);
|
||||
}
|
||||
}
|
||||
None => (),
|
||||
},
|
||||
_ => (),
|
||||
|
|
|
@ -21,9 +21,7 @@ struct MissingElement(String);
|
|||
#[derive(Debug, Fail)]
|
||||
#[fail(
|
||||
display = "Received error from {}: {} (debug: {:?})",
|
||||
src,
|
||||
error,
|
||||
debug
|
||||
src, error, debug
|
||||
)]
|
||||
struct ErrorMessage {
|
||||
src: String,
|
||||
|
|
13157
gir-files/GES-1.0.gir
Normal file
13157
gir-files/GES-1.0.gir
Normal file
File diff suppressed because it is too large
Load diff
|
@ -3875,7 +3875,7 @@ gst_buffer_pool_config_add_option().</doc>
|
|||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">a %NULL terminated array
|
||||
of strings.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -4028,7 +4028,7 @@ gst_buffer_pool_config_add_option().</doc>
|
|||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">a %NULL terminated array
|
||||
of strings.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -4265,7 +4265,7 @@ return.</doc>
|
|||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">a %NULL terminated array
|
||||
of strings.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -15848,7 +15848,7 @@ make a copy of the protocol string array if you need to.</doc>
|
|||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">the supported protocols
|
||||
or %NULL</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar* const*">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -23214,7 +23214,7 @@ buffers.</doc>
|
|||
version="1.2">
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">an array of tags as strings.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar* const*">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -23258,7 +23258,7 @@ buffers.</doc>
|
|||
</parameter>
|
||||
<parameter name="tags" transfer-ownership="none">
|
||||
<doc xml:space="preserve">tags for @api</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -29704,7 +29704,7 @@ codec libraries are currently installed.</doc>
|
|||
or %NULL. Environment variable names may be followed by a path component
|
||||
which will be added to the content of the environment variable, e.g.
|
||||
"HOME/.mystuff/plugins".</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -29714,7 +29714,7 @@ codec libraries are currently installed.</doc>
|
|||
allow-none="1">
|
||||
<doc xml:space="preserve">%NULL-terminated array of directories/paths where dependent files
|
||||
may be, or %NULL.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -29726,7 +29726,7 @@ codec libraries are currently installed.</doc>
|
|||
depending on @flags) to be used in combination with the paths from
|
||||
@paths and/or the paths extracted from the environment variables in
|
||||
@env_vars, or %NULL.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -33717,7 +33717,7 @@ in the @formats array must be equal to @n_formats.</doc>
|
|||
<parameter name="formats" transfer-ownership="none">
|
||||
<doc xml:space="preserve">an array containing @n_formats
|
||||
@GstFormat values.</doc>
|
||||
<array length="0" zero-terminated="0" c:type="GstFormat*">
|
||||
<array length="0" zero-terminated="0" c:type="const GstFormat*">
|
||||
<type name="Format" c:type="GstFormat"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -35679,8 +35679,9 @@ outside of the segment is extrapolated.
|
|||
When 1 is returned, @running_time resulted in a positive position returned
|
||||
in @position.
|
||||
|
||||
When this function returns -1, the returned @position should be negated
|
||||
to get the real negative segment position.</doc>
|
||||
When this function returns -1, the returned @position was < 0, and the value
|
||||
in the position variable should be negated to get the real negative segment
|
||||
position.</doc>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">a 1 or -1 on success, 0 on failure.</doc>
|
||||
<type name="gint" c:type="gint"/>
|
||||
|
@ -43006,7 +43007,7 @@ returns and must not be freed.</doc>
|
|||
<return-value transfer-ownership="none" nullable="1">
|
||||
<doc xml:space="preserve">the
|
||||
requested data, or %NULL if that data is not available.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -43273,7 +43274,7 @@ a 0-length list.</doc>
|
|||
<return-value transfer-ownership="none" nullable="1">
|
||||
<doc xml:space="preserve">
|
||||
a %NULL-terminated array of extensions associated with this factory</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar* const*">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -44725,7 +44726,7 @@ determine a order for the two provided values.</doc>
|
|||
<doc xml:space="preserve">The major version of GStreamer at compile time:</doc>
|
||||
<type name="gint" c:type="gint"/>
|
||||
</constant>
|
||||
<constant name="VERSION_MICRO" value="1" c:type="GST_VERSION_MICRO">
|
||||
<constant name="VERSION_MICRO" value="4" c:type="GST_VERSION_MICRO">
|
||||
<doc xml:space="preserve">The micro version of GStreamer at compile time:</doc>
|
||||
<type name="gint" c:type="gint"/>
|
||||
</constant>
|
||||
|
@ -45998,7 +45999,7 @@ is unknown.</doc>
|
|||
<parameters>
|
||||
<parameter name="formats" transfer-ownership="none">
|
||||
<doc xml:space="preserve">The format array to search</doc>
|
||||
<array c:type="GstFormat*">
|
||||
<array c:type="const GstFormat*">
|
||||
<type name="Format" c:type="GstFormat"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -46148,8 +46149,8 @@ abort program execution.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">pointer to application's argv</doc>
|
||||
<array length="0" zero-terminated="0" c:type="char**">
|
||||
<type name="utf8" c:type="char*"/>
|
||||
<array length="0" zero-terminated="0" c:type="char***">
|
||||
<type name="utf8" c:type="char**"/>
|
||||
</array>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
@ -46182,8 +46183,8 @@ use gst_init() instead.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">pointer to application's argv</doc>
|
||||
<array length="0" zero-terminated="0" c:type="char**">
|
||||
<type name="utf8" c:type="char*"/>
|
||||
<array length="0" zero-terminated="0" c:type="char***">
|
||||
<type name="utf8" c:type="char**"/>
|
||||
</array>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
@ -46286,7 +46287,7 @@ or gst_init_check().</doc>
|
|||
version="1.2">
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">an array of tags as strings.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar* const*">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -46332,7 +46333,7 @@ or gst_init_check().</doc>
|
|||
</parameter>
|
||||
<parameter name="tags" transfer-ownership="none">
|
||||
<doc xml:space="preserve">tags for @api</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -46742,7 +46743,7 @@ on failure.</doc>
|
|||
<parameters>
|
||||
<parameter name="argv" transfer-ownership="none">
|
||||
<doc xml:space="preserve">null-terminated array of arguments</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -46765,7 +46766,7 @@ An error does not mean that the pipeline could not be constructed.</doc>
|
|||
<parameters>
|
||||
<parameter name="argv" transfer-ownership="none">
|
||||
<doc xml:space="preserve">null-terminated array of arguments</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -47001,7 +47002,7 @@ the @system_identifiers supported by the set of available decryptors, or
|
|||
<doc xml:space="preserve">
|
||||
A null terminated array of strings that contains the UUID values of each
|
||||
protection system that is to be checked.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -47038,7 +47039,7 @@ element has been found.</doc>
|
|||
<doc xml:space="preserve">A null terminated array of strings
|
||||
that contains the UUID values of each protection system that is to be
|
||||
checked.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -47870,7 +47871,7 @@ the result.</doc>
|
|||
<parameters>
|
||||
<parameter name="mem" transfer-ownership="none">
|
||||
<doc xml:space="preserve">a pointer to the memory to dump</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guchar*">
|
||||
<array length="1" zero-terminated="0" c:type="const guchar*">
|
||||
<type name="guint8" c:type="guchar"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
|
|
@ -1641,14 +1641,14 @@ Perform channel mixing on @in_data and write the result to @out_data.
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">input samples</doc>
|
||||
<type name="gpointer" c:type="const gpointer"/>
|
||||
<type name="gpointer" c:type="const gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="out"
|
||||
transfer-ownership="none"
|
||||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">output samples</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="samples" transfer-ownership="none">
|
||||
<doc xml:space="preserve">number of samples</doc>
|
||||
|
@ -2431,7 +2431,7 @@ are matching and @in and @out point to enough memory.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">input frames</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="in_frames" transfer-ownership="none">
|
||||
<doc xml:space="preserve">number of input frames</doc>
|
||||
|
@ -2442,7 +2442,7 @@ are matching and @in and @out point to enough memory.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">output frames</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="out_frames" transfer-ownership="none">
|
||||
<doc xml:space="preserve">number of output frames</doc>
|
||||
|
@ -5714,7 +5714,7 @@ and will be packed into @data.</doc>
|
|||
</parameter>
|
||||
<parameter name="src" transfer-ownership="none">
|
||||
<doc xml:space="preserve">a source array</doc>
|
||||
<array zero-terminated="0" c:type="gpointer">
|
||||
<array zero-terminated="0" c:type="gconstpointer">
|
||||
<type name="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -5755,7 +5755,7 @@ channels * size(unpack_format) bytes.</doc>
|
|||
</parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">pointer to the audio data</doc>
|
||||
<array zero-terminated="0" c:type="gpointer">
|
||||
<array zero-terminated="0" c:type="gconstpointer">
|
||||
<type name="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -5959,7 +5959,7 @@ Note: This initializes @info first, no values are preserved.</doc>
|
|||
allow-none="1">
|
||||
<doc xml:space="preserve">the channel positions</doc>
|
||||
<array zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*"
|
||||
c:type="const GstAudioChannelPosition*"
|
||||
fixed-size="64">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
|
@ -6108,14 +6108,14 @@ modified in-place.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">input samples</doc>
|
||||
<type name="gpointer" c:type="const gpointer"/>
|
||||
<type name="gpointer" c:type="const gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="out"
|
||||
transfer-ownership="none"
|
||||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">output samples</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="samples" transfer-ownership="none">
|
||||
<doc xml:space="preserve">number of samples</doc>
|
||||
|
@ -6286,7 +6286,7 @@ are matching and @in and @out point to enough memory.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">input samples</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="in_frames" transfer-ownership="none">
|
||||
<doc xml:space="preserve">number of input frames</doc>
|
||||
|
@ -6297,7 +6297,7 @@ are matching and @in and @out point to enough memory.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">output samples</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="out_frames" transfer-ownership="none">
|
||||
<doc xml:space="preserve">number of output frames</doc>
|
||||
|
@ -7392,7 +7392,7 @@ be called in when the ringbuffer is acquired.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="position" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the device channel positions</doc>
|
||||
<array zero-terminated="0" c:type="GstAudioChannelPosition*">
|
||||
<array zero-terminated="0" c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -8955,7 +8955,7 @@ positions and the same positions, only in a different order.
|
|||
<doc xml:space="preserve">The channel positions in the buffer.</doc>
|
||||
<array length="2"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -8964,7 +8964,7 @@ positions and the same positions, only in a different order.
|
|||
<doc xml:space="preserve">The channel positions to convert to.</doc>
|
||||
<array length="2"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9115,7 +9115,7 @@ in the order required by GStreamer.</doc>
|
|||
<doc xml:space="preserve">The %GstAudioChannelPositions</doc>
|
||||
<array length="1"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9154,7 +9154,7 @@ Since 1.10</doc>
|
|||
to convert.</doc>
|
||||
<array length="1"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9206,7 +9206,7 @@ checks if the channels are in the order required by GStreamer.</doc>
|
|||
to check.</doc>
|
||||
<array length="1"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9373,7 +9373,7 @@ is possible.</doc>
|
|||
<doc xml:space="preserve">The channel positions to reorder from.</doc>
|
||||
<array length="0"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9382,7 +9382,7 @@ is possible.</doc>
|
|||
<doc xml:space="preserve">The channel positions to reorder to.</doc>
|
||||
<array length="0"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9425,7 +9425,7 @@ otherwise.</doc>
|
|||
<parameters>
|
||||
<parameter name="src" transfer-ownership="none">
|
||||
<doc xml:space="preserve">a buffer containing the data to payload</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -9531,7 +9531,7 @@ positions and the same positions, only in a different order.</doc>
|
|||
<doc xml:space="preserve">The channel positions in the buffer.</doc>
|
||||
<array length="3"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9540,7 +9540,7 @@ positions and the same positions, only in a different order.</doc>
|
|||
<doc xml:space="preserve">The channel positions to convert to.</doc>
|
||||
<array length="3"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9664,7 +9664,7 @@ of the results.</doc>
|
|||
of the source</doc>
|
||||
<array length="2"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9678,7 +9678,7 @@ of the results.</doc>
|
|||
the destination</doc>
|
||||
<array length="4"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
@ -9711,7 +9711,7 @@ channel positions.</doc>
|
|||
the destination</doc>
|
||||
<array length="2"
|
||||
zero-terminated="0"
|
||||
c:type="GstAudioChannelPosition*">
|
||||
c:type="const GstAudioChannelPosition*">
|
||||
<type name="AudioChannelPosition"
|
||||
c:type="GstAudioChannelPosition"/>
|
||||
</array>
|
||||
|
|
|
@ -1225,7 +1225,12 @@ sent before pushing the buffer.</doc>
|
|||
<parameter name="caps" transfer-ownership="none">
|
||||
<type name="Gst.Caps" c:type="GstCaps*"/>
|
||||
</parameter>
|
||||
<parameter name="ret" transfer-ownership="none">
|
||||
<parameter name="ret"
|
||||
direction="out"
|
||||
caller-allocates="0"
|
||||
transfer-ownership="full"
|
||||
optional="1"
|
||||
allow-none="1">
|
||||
<type name="Gst.Caps" c:type="GstCaps**"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
@ -1610,7 +1615,12 @@ _finish_buffer from inside that function.</doc>
|
|||
<parameter name="caps" transfer-ownership="none">
|
||||
<type name="Gst.Caps" c:type="GstCaps*"/>
|
||||
</parameter>
|
||||
<parameter name="ret" transfer-ownership="none">
|
||||
<parameter name="ret"
|
||||
direction="out"
|
||||
caller-allocates="0"
|
||||
transfer-ownership="full"
|
||||
optional="1"
|
||||
allow-none="1">
|
||||
<type name="Gst.Caps" c:type="GstCaps**"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
@ -6816,7 +6826,7 @@ into 8, 16, 32 and 64 bit variables.</doc>
|
|||
<field name="data" writable="1">
|
||||
<doc xml:space="preserve">Data from which the bit reader will
|
||||
read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</field>
|
||||
|
@ -7002,7 +7012,7 @@ can be called on already initialized instances.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">data from which the bit reader should read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -7174,7 +7184,7 @@ Free-function: gst_bit_reader_free</doc>
|
|||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Data from which the #GstBitReader
|
||||
should read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -7195,7 +7205,7 @@ in various character encodings.</doc>
|
|||
<field name="data" writable="1">
|
||||
<doc xml:space="preserve">Data from which the bit reader will
|
||||
read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</field>
|
||||
|
@ -7393,7 +7403,7 @@ updates the current position.</doc>
|
|||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">address of a
|
||||
#guint8 pointer variable in which to store the result</doc>
|
||||
<array length="0" zero-terminated="0" c:type="guint8**">
|
||||
<array length="0" zero-terminated="0" c:type="const guint8**">
|
||||
<type name="guint8" c:type="guint8*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -7741,7 +7751,7 @@ This function will fail if no NUL-terminator was found in in the data.</doc>
|
|||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">address of a
|
||||
#gchar pointer variable in which to store the result</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -7987,7 +7997,7 @@ can be called on already initialized instances.</doc>
|
|||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">data from which
|
||||
the #GstByteReader should read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -8131,7 +8141,7 @@ keeps the current position.</doc>
|
|||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">address of a
|
||||
#guint8 pointer variable in which to store the result</doc>
|
||||
<array length="0" zero-terminated="0" c:type="guint8**">
|
||||
<array length="0" zero-terminated="0" c:type="const guint8**">
|
||||
<type name="guint8" c:type="guint8*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -8447,7 +8457,7 @@ This function will fail if no NUL-terminator was found in in the data.</doc>
|
|||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">address of a
|
||||
#gchar pointer variable in which to store the result</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -8785,7 +8795,7 @@ Free-function: gst_byte_reader_free</doc>
|
|||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">data from which the
|
||||
#GstByteReader should read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -9026,7 +9036,7 @@ read @size bytes from the #GstByteWriter from the beginning.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Data to write</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -9275,7 +9285,7 @@ read @size bytes from the #GstByteWriter from the beginning.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">UTF16 string to write</doc>
|
||||
<array c:type="guint16*">
|
||||
<array c:type="const guint16*">
|
||||
<type name="guint16" c:type="guint16"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -9295,7 +9305,7 @@ read @size bytes from the #GstByteWriter from the beginning.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">UTF32 string to write</doc>
|
||||
<array c:type="guint32*">
|
||||
<array c:type="const guint32*">
|
||||
<type name="guint32" c:type="guint32"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -11903,7 +11913,7 @@ Free-function: gst_bit_reader_free</doc>
|
|||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Data from which the #GstBitReader
|
||||
should read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -11928,7 +11938,7 @@ Free-function: gst_byte_reader_free</doc>
|
|||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">data from which the
|
||||
#GstByteReader should read</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -12136,7 +12146,7 @@ Free-function: gst_caps_unref</doc>
|
|||
</parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">* a pointer with data to typefind</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -12246,5 +12256,74 @@ Free-function: gst_caps_unref</doc>
|
|||
</parameter>
|
||||
</parameters>
|
||||
</function>
|
||||
<function name="type_find_helper_get_range_full"
|
||||
c:identifier="gst_type_find_helper_get_range_full"
|
||||
version="1.14.3">
|
||||
<doc xml:space="preserve">Utility function to do pull-based typefinding. Unlike gst_type_find_helper()
|
||||
however, this function will use the specified function @func to obtain the
|
||||
data needed by the typefind functions, rather than operating on a given
|
||||
source pad. This is useful mostly for elements like tag demuxers which
|
||||
strip off data at the beginning and/or end of a file and want to typefind
|
||||
the stripped data stream before adding their own source pad (the specified
|
||||
callback can then call the upstream peer pad with offsets adjusted for the
|
||||
tag size, for example).
|
||||
|
||||
When @extension is not %NULL, this function will first try the typefind
|
||||
functions for the given extension, which might speed up the typefinding
|
||||
in many cases.</doc>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve">the last %GstFlowReturn from pulling a buffer or %GST_FLOW_OK if
|
||||
typefinding was successful.</doc>
|
||||
<type name="Gst.FlowReturn" c:type="GstFlowReturn"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<parameter name="obj" transfer-ownership="none">
|
||||
<doc xml:space="preserve">A #GstObject that will be passed as first argument to @func</doc>
|
||||
<type name="Gst.Object" c:type="GstObject*"/>
|
||||
</parameter>
|
||||
<parameter name="parent"
|
||||
transfer-ownership="none"
|
||||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">the parent of @obj or %NULL</doc>
|
||||
<type name="Gst.Object" c:type="GstObject*"/>
|
||||
</parameter>
|
||||
<parameter name="func" transfer-ownership="none" scope="call">
|
||||
<doc xml:space="preserve">A generic #GstTypeFindHelperGetRangeFunction that will
|
||||
be used to access data at random offsets when doing the typefinding</doc>
|
||||
<type name="TypeFindHelperGetRangeFunction"
|
||||
c:type="GstTypeFindHelperGetRangeFunction"/>
|
||||
</parameter>
|
||||
<parameter name="size" transfer-ownership="none">
|
||||
<doc xml:space="preserve">The length in bytes</doc>
|
||||
<type name="guint64" c:type="guint64"/>
|
||||
</parameter>
|
||||
<parameter name="extension"
|
||||
transfer-ownership="none"
|
||||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">extension of the media, or %NULL</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</parameter>
|
||||
<parameter name="caps"
|
||||
direction="out"
|
||||
caller-allocates="0"
|
||||
transfer-ownership="full">
|
||||
<doc xml:space="preserve">returned caps</doc>
|
||||
<type name="Gst.Caps" c:type="GstCaps**"/>
|
||||
</parameter>
|
||||
<parameter name="prob"
|
||||
direction="out"
|
||||
caller-allocates="0"
|
||||
transfer-ownership="full"
|
||||
optional="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">location to store the probability of the found
|
||||
caps, or %NULL</doc>
|
||||
<type name="Gst.TypeFindProbability"
|
||||
c:type="GstTypeFindProbability*"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</function>
|
||||
</namespace>
|
||||
</repository>
|
||||
|
|
2686
gir-files/GstCheck-1.0.gir
Normal file
2686
gir-files/GstCheck-1.0.gir
Normal file
File diff suppressed because it is too large
Load diff
|
@ -211,7 +211,7 @@ MT safe. Caller owns return value (gst_net_time_packet_free to free).</doc>
|
|||
<parameters>
|
||||
<parameter name="buffer" transfer-ownership="none">
|
||||
<doc xml:space="preserve">a buffer from which to construct the packet, or NULL</doc>
|
||||
<array zero-terminated="0" c:type="guint8*">
|
||||
<array zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
|
|
@ -831,7 +831,7 @@ gst_discoverer_stream_info_list_free().</doc>
|
|||
containing informations about how to install the various missing elements
|
||||
for @info to be usable. If you wish to use the strings after the life-time
|
||||
of @info, you will need to copy them.</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8"/>
|
||||
</array>
|
||||
</return-value>
|
||||
|
@ -1684,8 +1684,11 @@ information like name, description, format and preset.</doc>
|
|||
<doc xml:space="preserve">The name of the target</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</parameter>
|
||||
<parameter name="profilename" transfer-ownership="none">
|
||||
<doc xml:space="preserve">(allow-none): The name of the profile, if %NULL
|
||||
<parameter name="profilename"
|
||||
transfer-ownership="none"
|
||||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">The name of the profile, if %NULL
|
||||
provided, it will default to the encoding profile called `default`.</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</parameter>
|
||||
|
@ -2744,7 +2747,7 @@ in debugging.</doc>
|
|||
<type name="gint" c:type="gint"/>
|
||||
</constant>
|
||||
<constant name="PLUGINS_BASE_VERSION_MICRO"
|
||||
value="2"
|
||||
value="4"
|
||||
c:type="GST_PLUGINS_BASE_VERSION_MICRO">
|
||||
<doc xml:space="preserve">The micro version of GStreamer's gst-plugins-base libraries at compile time.</doc>
|
||||
<type name="gint" c:type="gint"/>
|
||||
|
@ -2782,7 +2785,7 @@ If mpegversion is 4, the "base-profile" field is also set in @caps.</doc>
|
|||
<doc xml:space="preserve">a pointer to the AudioSpecificConfig
|
||||
as specified in the Elementary Stream Descriptor (esds)
|
||||
in ISO/IEC 14496-1. (See below for more details)</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2806,7 +2809,7 @@ Since 1.10</doc>
|
|||
<doc xml:space="preserve">a pointer to the AudioSpecificConfig
|
||||
as specified in the Elementary Stream Descriptor (esds)
|
||||
in ISO/IEC 14496-1.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2857,7 +2860,7 @@ determined.</doc>
|
|||
<doc xml:space="preserve">a pointer to the AudioSpecificConfig
|
||||
as specified in the Elementary Stream Descriptor (esds)
|
||||
in ISO/IEC 14496-1.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2884,7 +2887,7 @@ determined.</doc>
|
|||
<doc xml:space="preserve">a pointer to the AudioSpecificConfig
|
||||
as specified in the Elementary Stream Descriptor (esds)
|
||||
in ISO/IEC 14496-1.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2909,7 +2912,7 @@ Since 1.10</doc>
|
|||
<doc xml:space="preserve">a pointer to the AudioSpecificConfig
|
||||
as specified in the Elementary Stream Descriptor (esds)
|
||||
in ISO/IEC 14496-1.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2951,7 +2954,7 @@ for more details on the parameters.</doc>
|
|||
</parameter>
|
||||
<parameter name="sps" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the sequence parameter set for the stream.</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2973,7 +2976,7 @@ same format as for gst_codec_utils_h264_get_profile().</doc>
|
|||
<parameters>
|
||||
<parameter name="sps" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the sequence parameter set for the stream.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3020,7 +3023,7 @@ byte.
|
|||
<parameters>
|
||||
<parameter name="sps" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the sequence parameter set for the stream.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3050,7 +3053,7 @@ Since 1.4</doc>
|
|||
<parameter name="profile_tier_level" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the profile_tier_level
|
||||
struct</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3075,7 +3078,7 @@ Since 1.4</doc>
|
|||
<parameter name="profile_tier_level" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the profile_tier_level
|
||||
for the stream</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3129,7 +3132,7 @@ Since 1.4</doc>
|
|||
<parameter name="profile_tier_level" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the profile_tier_level
|
||||
structure for the stream.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3154,7 +3157,7 @@ Since 1.4</doc>
|
|||
<parameter name="profile_tier_level" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the profile_tier_level
|
||||
for the stream.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3182,7 +3185,7 @@ parameters.</doc>
|
|||
<parameter name="vis_obj_seq" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the visual object
|
||||
sequence for the stream.</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3206,7 +3209,7 @@ object sequence start code. Only the first byte
|
|||
<parameter name="vis_obj_seq" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the visual object
|
||||
sequence for the stream.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3230,7 +3233,7 @@ object sequence start code. Only the first byte
|
|||
<parameter name="vis_obj_seq" transfer-ownership="none">
|
||||
<doc xml:space="preserve">Pointer to the visual object
|
||||
sequence for the stream.</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3275,7 +3278,7 @@ invalid Opus caps.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">the mapping between the streams</doc>
|
||||
<array zero-terminated="0" c:type="guint8*">
|
||||
<array zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3338,7 +3341,7 @@ invalid Opus caps.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">the mapping between the streams</doc>
|
||||
<array zero-terminated="0" c:type="guint8*">
|
||||
<array zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3405,7 +3408,7 @@ invalid Opus caps.</doc>
|
|||
caller-allocates="0"
|
||||
transfer-ownership="full">
|
||||
<doc xml:space="preserve">the mapping between the streams</doc>
|
||||
<array zero-terminated="0" c:type="guint8" fixed-size="256">
|
||||
<array zero-terminated="0" c:type="guint8*" fixed-size="256">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3464,7 +3467,7 @@ invalid Opus caps.</doc>
|
|||
caller-allocates="0"
|
||||
transfer-ownership="full">
|
||||
<doc xml:space="preserve">the mapping between the streams</doc>
|
||||
<array zero-terminated="0" c:type="guint8" fixed-size="256">
|
||||
<array zero-terminated="0" c:type="guint8*" fixed-size="256">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3542,7 +3545,7 @@ installed but no suitable video decoder and no suitable audio decoder).</doc>
|
|||
<parameter name="details" transfer-ownership="none">
|
||||
<doc xml:space="preserve">NULL-terminated array
|
||||
of installer string details (see below)</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar* const*">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3627,7 +3630,7 @@ gst_install_plugins_async() instead of this function.</doc>
|
|||
<parameter name="details" transfer-ownership="none">
|
||||
<doc xml:space="preserve">NULL-terminated array
|
||||
of installer string details</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar* const*">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
|
|
@ -2527,7 +2527,7 @@ all matching headers will be removed.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the data</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -4126,7 +4126,7 @@ are reached. #GST_RTSP_EINTR when @watch was flushing.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="data" transfer-ownership="full">
|
||||
<doc xml:space="preserve">the data to queue</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
|
|
@ -292,7 +292,7 @@ parameters to decrypt and verify the data.</doc>
|
|||
</parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the encrypted envelope key</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -317,7 +317,7 @@ parameters to decrypt and verify the data.</doc>
|
|||
</parameter>
|
||||
<parameter name="rand" transfer-ownership="none">
|
||||
<doc xml:space="preserve">random data</doc>
|
||||
<array length="0" zero-terminated="0" c:type="guint8*">
|
||||
<array length="0" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -361,7 +361,7 @@ parameters to decrypt and verify the data.</doc>
|
|||
</parameter>
|
||||
<parameter name="ts_value" transfer-ownership="none">
|
||||
<doc xml:space="preserve">The timestamp value of the specified @type</doc>
|
||||
<array zero-terminated="0" c:type="guint8*">
|
||||
<array zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -857,7 +857,7 @@ payload.</doc>
|
|||
</parameter>
|
||||
<parameter name="vf_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the Valid From data</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -867,7 +867,7 @@ payload.</doc>
|
|||
</parameter>
|
||||
<parameter name="vt_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the Valid To data</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -897,7 +897,7 @@ payload.</doc>
|
|||
</parameter>
|
||||
<parameter name="key_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the key of type @key_type</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -926,7 +926,7 @@ salt data will be removed.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">the salt</doc>
|
||||
<array length="0" zero-terminated="0" c:type="guint8*">
|
||||
<array length="0" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -951,7 +951,7 @@ salt data will be removed.</doc>
|
|||
</parameter>
|
||||
<parameter name="spi_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the SPI/MKI data</doc>
|
||||
<array length="0" zero-terminated="0" c:type="guint8*">
|
||||
<array length="0" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -981,7 +981,7 @@ salt data will be removed.</doc>
|
|||
</parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the encrypted envelope key</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1006,7 +1006,7 @@ salt data will be removed.</doc>
|
|||
</parameter>
|
||||
<parameter name="rand" transfer-ownership="none">
|
||||
<doc xml:space="preserve">random values</doc>
|
||||
<array length="0" zero-terminated="0" c:type="guint8*">
|
||||
<array length="0" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1036,7 +1036,7 @@ and @val.</doc>
|
|||
</parameter>
|
||||
<parameter name="val" transfer-ownership="none">
|
||||
<doc xml:space="preserve">@len bytes of data</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1141,7 +1141,7 @@ at @idx.</doc>
|
|||
</parameter>
|
||||
<parameter name="ts_value" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the timestamp value</doc>
|
||||
<array zero-terminated="0" c:type="guint8*">
|
||||
<array zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2794,7 +2794,7 @@ gst_sdp_media_init() before it can be used again.</doc>
|
|||
</parameter>
|
||||
<parameter name="repeat" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the repeat times</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -3917,7 +3917,7 @@ stack and initialized with gst_sdp_message_init().</doc>
|
|||
<parameters>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the start of the buffer</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -4053,7 +4053,7 @@ a conference session.</doc>
|
|||
</parameter>
|
||||
<parameter name="repeat" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the repeat times</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -4273,7 +4273,7 @@ a=rtcp-fb:(payload) (param1) [param2]...</doc>
|
|||
<parameters>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the start of the buffer</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
|
|
@ -1039,7 +1039,7 @@ WINDOWS-1252/ISO-8859-1 is assumed (which will almost always succeed).</doc>
|
|||
<parameters>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">string data</doc>
|
||||
<array length="1" zero-terminated="0" c:type="gchar*">
|
||||
<array length="1" zero-terminated="0" c:type="const gchar*">
|
||||
<type name="gchar"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1050,7 +1050,7 @@ WINDOWS-1252/ISO-8859-1 is assumed (which will almost always succeed).</doc>
|
|||
<parameter name="env_vars" transfer-ownership="none">
|
||||
<doc xml:space="preserve">
|
||||
a NULL-terminated string array of environment variable names, or NULL</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1391,7 +1391,7 @@ data (we can't trust the declared mime type).</doc>
|
|||
<parameters>
|
||||
<parameter name="image_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the (encoded) image</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1423,7 +1423,7 @@ more information on image tags in GStreamer.</doc>
|
|||
</parameter>
|
||||
<parameter name="image_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the (encoded) image</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1505,7 +1505,7 @@ vorbiscomment packet.</doc>
|
|||
<parameters>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">data to convert</doc>
|
||||
<array length="1" zero-terminated="0" c:type="guint8*">
|
||||
<array length="1" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1515,7 +1515,7 @@ vorbiscomment packet.</doc>
|
|||
</parameter>
|
||||
<parameter name="id_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">identification data at start of stream</doc>
|
||||
<array length="3" zero-terminated="0" c:type="guint8*">
|
||||
<array length="3" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1551,7 +1551,7 @@ vorbiscomment packet.</doc>
|
|||
</parameter>
|
||||
<parameter name="id_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">identification data at start of stream</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1596,7 +1596,7 @@ parsed data.</doc>
|
|||
<parameters>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">128 bytes of data containing the ID3v1 tag</doc>
|
||||
<array zero-terminated="0" c:type="guint8*" fixed-size="128">
|
||||
<array zero-terminated="0" c:type="const guint8*" fixed-size="128">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1655,7 +1655,7 @@ is put in the beginning of the buffer.</doc>
|
|||
</parameter>
|
||||
<parameter name="id_data" transfer-ownership="none">
|
||||
<doc xml:space="preserve">identification data at start of stream</doc>
|
||||
<array length="2" zero-terminated="0" c:type="guint8*">
|
||||
<array length="2" zero-terminated="0" c:type="const guint8*">
|
||||
<type name="guint8" c:type="guint8"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -1693,7 +1693,7 @@ be used</doc>
|
|||
<parameter name="schemas" transfer-ownership="none">
|
||||
<doc xml:space="preserve">
|
||||
%NULL terminated array of schemas to be used on serialization</doc>
|
||||
<array c:type="gchar**">
|
||||
<array c:type="const gchar**">
|
||||
<type name="utf8" c:type="gchar*"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
|
|
@ -1880,7 +1880,7 @@ Performs the multiplication, meta->matrix X matrix.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="matrix" transfer-ownership="none">
|
||||
<doc xml:space="preserve">a 4x4 transformation matrix to be applied</doc>
|
||||
<type name="gfloat" c:type="const gfloat"/>
|
||||
<type name="gfloat" c:type="const gfloat*"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
|
@ -2151,7 +2151,7 @@ supports all the video bufferpool options.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">pixel lines</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="width" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the number of pixels on one line</doc>
|
||||
|
@ -2814,7 +2814,7 @@ the component values in range [0.0 .. 1.0] back to their representation in
|
|||
caller-allocates="1"
|
||||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">output offsets</doc>
|
||||
<array zero-terminated="0" c:type="gint" fixed-size="4">
|
||||
<array zero-terminated="0" c:type="gint*" fixed-size="4">
|
||||
<type name="gint" c:type="gint"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -2823,7 +2823,7 @@ the component values in range [0.0 .. 1.0] back to their representation in
|
|||
caller-allocates="1"
|
||||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">output scale</doc>
|
||||
<array zero-terminated="0" c:type="gint" fixed-size="4">
|
||||
<array zero-terminated="0" c:type="gint*" fixed-size="4">
|
||||
<type name="gint" c:type="gint"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -4532,7 +4532,7 @@ performance is achived when @quantizer is a power of 2.
|
|||
</parameter>
|
||||
<parameter name="quantizer" transfer-ownership="none">
|
||||
<doc xml:space="preserve">quantizer</doc>
|
||||
<type name="guint" c:type="guint"/>
|
||||
<type name="guint" c:type="guint*"/>
|
||||
</parameter>
|
||||
<parameter name="width" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the width of the lines</doc>
|
||||
|
@ -6758,11 +6758,11 @@ formats this means that a complete pixel needs to be packed.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">pointers to the destination data planes</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="stride" transfer-ownership="none">
|
||||
<doc xml:space="preserve">strides of the destination planes</doc>
|
||||
<type name="gint" c:type="const gint"/>
|
||||
<type name="gint" c:type="const gint*"/>
|
||||
</parameter>
|
||||
<parameter name="chroma_site" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the chroma siting of the target when subsampled (not used)</doc>
|
||||
|
@ -6816,11 +6816,11 @@ separate step after unpacking.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">pointers to the data planes</doc>
|
||||
<type name="gpointer" c:type="const gpointer"/>
|
||||
<type name="gpointer" c:type="const gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="stride" transfer-ownership="none">
|
||||
<doc xml:space="preserve">strides of the planes</doc>
|
||||
<type name="gint" c:type="const gint"/>
|
||||
<type name="gint" c:type="const gint*"/>
|
||||
</parameter>
|
||||
<parameter name="x" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the x position in the image to start from</doc>
|
||||
|
@ -7172,7 +7172,7 @@ All video planes of @buffer will be mapped and the pointers will be set in
|
|||
c:type="GstVideoGLTextureUploadMeta*"/>
|
||||
</parameter>
|
||||
<parameter name="texture_id" transfer-ownership="none">
|
||||
<type name="guint" c:type="guint"/>
|
||||
<type name="guint" c:type="guint*"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</callback>
|
||||
|
@ -7233,7 +7233,7 @@ to upload something to an OpenGL texture.</doc>
|
|||
</instance-parameter>
|
||||
<parameter name="texture_id" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the texture IDs to upload to</doc>
|
||||
<type name="guint" c:type="guint"/>
|
||||
<type name="guint" c:type="guint*"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
|
@ -10470,7 +10470,7 @@ gst_video_scaler_get_info().</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">source pixels lines</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="dest"
|
||||
transfer-ownership="none"
|
||||
|
@ -11484,7 +11484,7 @@ parameters.</doc>
|
|||
</parameter>
|
||||
<parameter name="texture_type" transfer-ownership="none">
|
||||
<doc xml:space="preserve">array of #GstVideoGLTextureType</doc>
|
||||
<type name="VideoGLTextureType" c:type="GstVideoGLTextureType"/>
|
||||
<type name="VideoGLTextureType" c:type="GstVideoGLTextureType*"/>
|
||||
</parameter>
|
||||
<parameter name="upload"
|
||||
transfer-ownership="none"
|
||||
|
@ -11582,11 +11582,15 @@ gst_buffer_add_video_meta_full() with them.</doc>
|
|||
</parameter>
|
||||
<parameter name="offset" transfer-ownership="none">
|
||||
<doc xml:space="preserve">offset of each plane</doc>
|
||||
<type name="gsize" c:type="gsize"/>
|
||||
<array zero-terminated="0" c:type="gsize*" fixed-size="4">
|
||||
<type name="gsize" c:type="gsize"/>
|
||||
</array>
|
||||
</parameter>
|
||||
<parameter name="stride" transfer-ownership="none">
|
||||
<doc xml:space="preserve">stride of each plane</doc>
|
||||
<type name="gint" c:type="gint"/>
|
||||
<array zero-terminated="0" c:type="gint*" fixed-size="4">
|
||||
<type name="gint" c:type="gint"/>
|
||||
</array>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</function>
|
||||
|
@ -12562,7 +12566,7 @@ not contain a valid chroma description.</doc>
|
|||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">pixel lines</doc>
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
<type name="gpointer" c:type="gpointer*"/>
|
||||
</parameter>
|
||||
<parameter name="width" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the number of pixels on one line</doc>
|
||||
|
@ -12721,7 +12725,7 @@ the component values in range [0.0 .. 1.0] back to their representation in
|
|||
caller-allocates="1"
|
||||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">output offsets</doc>
|
||||
<array zero-terminated="0" c:type="gint" fixed-size="4">
|
||||
<array zero-terminated="0" c:type="gint*" fixed-size="4">
|
||||
<type name="gint" c:type="gint"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -12730,7 +12734,7 @@ the component values in range [0.0 .. 1.0] back to their representation in
|
|||
caller-allocates="1"
|
||||
transfer-ownership="none">
|
||||
<doc xml:space="preserve">output scale</doc>
|
||||
<array zero-terminated="0" c:type="gint" fixed-size="4">
|
||||
<array zero-terminated="0" c:type="gint*" fixed-size="4">
|
||||
<type name="gint" c:type="gint"/>
|
||||
</array>
|
||||
</parameter>
|
||||
|
@ -12949,7 +12953,7 @@ performance is achived when @quantizer is a power of 2.
|
|||
</parameter>
|
||||
<parameter name="quantizer" transfer-ownership="none">
|
||||
<doc xml:space="preserve">quantizer</doc>
|
||||
<type name="guint" c:type="guint"/>
|
||||
<type name="guint" c:type="guint*"/>
|
||||
</parameter>
|
||||
<parameter name="width" transfer-ownership="none">
|
||||
<doc xml:space="preserve">the width of the lines</doc>
|
||||
|
|
|
@ -5,6 +5,67 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
|
@ -305,18 +366,21 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
|
|||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
|
||||
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
[package]
|
||||
name = "gstreamer-app"
|
||||
version = "0.12.0"
|
||||
version = "0.12.2"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer App library"
|
||||
repository = "https://github.com/sdroege/gstreamer-rs"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_app"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_app"
|
||||
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
libc = "0.2"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gstreamer-app-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-base = { path = "../gstreamer-base" }
|
||||
glib-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-app-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
gstreamer-base = { version = "0.12", path = "../gstreamer-base" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
@ -36,6 +36,3 @@ embed-lgpl-docs = ["rustdoc-stripper"]
|
|||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-app-sys/dox", "glib/dox", "gstreamer/dox", "gstreamer-base/dox"]
|
||||
default-features = []
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" }
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-app.svg)](https://crates.io/crates/gstreamer-app) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
|
||||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-app.svg)](https://crates.io/crates/gstreamer-app) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) (App library) bindings for Rust.
|
||||
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_app/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
@ -14,7 +16,7 @@ API metadata provided by the GStreamer project. Older versions before 0.8.0 were
|
|||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
|
@ -48,7 +50,20 @@ On Debian/Ubuntu they can be installed with
|
|||
$ 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
|
||||
gstreamer1.0-libav libgstrtspserver-1.0-dev
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ apt-get install libgstreamer-plugins-bad1.0-dev
|
||||
```
|
||||
|
||||
Package names on other distributions should be similar.
|
||||
|
@ -64,11 +79,21 @@ provided by the GStreamer project.
|
|||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||
gst-plugins-bad gst-plugins-ugly gst-libav
|
||||
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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
|
@ -79,7 +104,7 @@ After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
@ -96,9 +121,14 @@ the GStreamer project.
|
|||
```
|
||||
$ pacman -S 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-plugins-ugly mingw-w64-x86_64-gst-libav \
|
||||
mingw-w64-x86_64-gst-rtsp-server
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.msi` files for your platform from the
|
||||
|
@ -118,7 +148,7 @@ $ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG
|
|||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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
|
||||
|
@ -134,12 +164,12 @@ 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://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
|
||||
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
|
|
@ -5,6 +5,67 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
|
@ -305,18 +366,21 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
|
|||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
|
||||
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
[package]
|
||||
name = "gstreamer-audio"
|
||||
version = "0.12.0"
|
||||
version = "0.12.2"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Audio library"
|
||||
repository = "https://github.com/sdroege/gstreamer-rs"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_audio"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_audio"
|
||||
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gstreamer-audio-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-audio-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
array-init = "0.0"
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
|
@ -34,6 +34,3 @@ embed-lgpl-docs = ["rustdoc-stripper"]
|
|||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-audio-sys/dox", "glib/dox", "gstreamer/dox"]
|
||||
default-features = []
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" }
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-audio.svg)](https://crates.io/crates/gstreamer-audio) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
|
||||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-audio.svg)](https://crates.io/crates/gstreamer-audio) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) (Audio library) bindings for Rust.
|
||||
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_audio/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
@ -14,7 +16,7 @@ API metadata provided by the GStreamer project. Older versions before 0.8.0 were
|
|||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
|
@ -48,7 +50,20 @@ On Debian/Ubuntu they can be installed with
|
|||
$ 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
|
||||
gstreamer1.0-libav libgstrtspserver-1.0-dev
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ apt-get install libgstreamer-plugins-bad1.0-dev
|
||||
```
|
||||
|
||||
Package names on other distributions should be similar.
|
||||
|
@ -64,11 +79,21 @@ provided by the GStreamer project.
|
|||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||
gst-plugins-bad gst-plugins-ugly gst-libav
|
||||
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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
|
@ -79,7 +104,7 @@ After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
@ -96,9 +121,14 @@ the GStreamer project.
|
|||
```
|
||||
$ pacman -S 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-plugins-ugly mingw-w64-x86_64-gst-libav \
|
||||
mingw-w64-x86_64-gst-rtsp-server
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.msi` files for your platform from the
|
||||
|
@ -118,7 +148,7 @@ $ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG
|
|||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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
|
||||
|
@ -134,12 +164,12 @@ 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://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
|
||||
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
|
|
@ -303,6 +303,7 @@ impl PartialEq for AudioInfo {
|
|||
impl Eq for AudioInfo {}
|
||||
|
||||
unsafe impl Send for AudioInfo {}
|
||||
unsafe impl Sync for AudioInfo {}
|
||||
|
||||
impl glib::types::StaticType for AudioInfo {
|
||||
fn static_type() -> glib::types::Type {
|
||||
|
|
|
@ -5,6 +5,67 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
|
@ -305,18 +366,21 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
|
|||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
|
||||
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
[package]
|
||||
name = "gstreamer-base"
|
||||
version = "0.12.0"
|
||||
version = "0.12.2"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Base library"
|
||||
repository = "https://github.com/sdroege/gstreamer-rs"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_base"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_base"
|
||||
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
@ -34,6 +34,3 @@ embed-lgpl-docs = ["rustdoc-stripper"]
|
|||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-base-sys/dox", "glib/dox", "gstreamer/dox"]
|
||||
default-features = []
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" }
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-app.svg)](https://crates.io/crates/gstreamer-app) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
|
||||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-base.svg)](https://crates.io/crates/gstreamer-base) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) (Base library) bindings for Rust.
|
||||
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_base/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
@ -14,7 +16,7 @@ API metadata provided by the GStreamer project. Older versions before 0.8.0 were
|
|||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
|
@ -48,7 +50,20 @@ On Debian/Ubuntu they can be installed with
|
|||
$ 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
|
||||
gstreamer1.0-libav libgstrtspserver-1.0-dev
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ apt-get install libgstreamer-plugins-bad1.0-dev
|
||||
```
|
||||
|
||||
Package names on other distributions should be similar.
|
||||
|
@ -64,11 +79,21 @@ provided by the GStreamer project.
|
|||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||
gst-plugins-bad gst-plugins-ugly gst-libav
|
||||
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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
|
@ -79,7 +104,7 @@ After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
@ -96,9 +121,14 @@ the GStreamer project.
|
|||
```
|
||||
$ pacman -S 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-plugins-ugly mingw-w64-x86_64-gst-libav \
|
||||
mingw-w64-x86_64-gst-rtsp-server
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.msi` files for your platform from the
|
||||
|
@ -118,7 +148,7 @@ $ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG
|
|||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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
|
||||
|
@ -134,12 +164,12 @@ 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://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
|
||||
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::ObjectExt;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
|
@ -193,3 +194,9 @@ impl Default for Adapter {
|
|||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl glib::SendUnique for Adapter {
|
||||
fn is_unique(&self) -> bool {
|
||||
self.ref_count() == 1
|
||||
}
|
||||
}
|
||||
|
|
386
gstreamer-check/CHANGELOG.md
Normal file
386
gstreamer-check/CHANGELOG.md
Normal file
|
@ -0,0 +1,386 @@
|
|||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
- Explicitly define [bin] section for discoverer example to fix a cargo
|
||||
warning
|
||||
|
||||
### Added
|
||||
- Add unsafe gst::deinit() function
|
||||
- Ord/PartialOrd impls on gst::Seqnum
|
||||
- Getter for current pad mode
|
||||
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
|
||||
in a thread-safe way
|
||||
|
||||
## [0.11.5] - 2018-07-24
|
||||
### Fixed
|
||||
- `gst::Bus`'s sync handler must unref every message if
|
||||
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
|
||||
|
||||
## [0.11.4] - 2018-07-19
|
||||
### Fixed
|
||||
- `gst::Caps::subtract()` does not leak its arguments anymore
|
||||
- `gst::Caps::get_structure()` gracefully returns `None` if the index
|
||||
is out of bounds instead of a `g_return_val_if_fail()`
|
||||
- `gst::Structure::new()` has to give away ownership of the info structure
|
||||
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
|
||||
structure by value
|
||||
- Typefind tests don't fail anymore if the system has typefind factories
|
||||
without caps
|
||||
|
||||
### Added
|
||||
- An additional assertion that ensures that miniobjects are actually
|
||||
writable before creating a mutable reference
|
||||
|
||||
## [0.11.3] - 2018-06-08
|
||||
### Added
|
||||
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
|
||||
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
|
||||
- `fmt::Debug` impls for mini objects also print the pointer value now to make
|
||||
it easier to track them in debug logs
|
||||
- `PlayerVisualization` has accessors for the name and description fields now,
|
||||
without which there is no sensible way to use them or to set a player
|
||||
visualization
|
||||
|
||||
## [0.11.2] - 2018-05-09
|
||||
### Fixed
|
||||
- Work-around various floating reference handling changes between 1.12 and
|
||||
1.14 to be able to run with both versions without memory leaks or other
|
||||
reference count problems.
|
||||
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
|
||||
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
|
||||
already previously fixed.
|
||||
|
||||
### Changed
|
||||
- Change the appsrc need-data and all appsink callbacks to not require the
|
||||
Sync bound anymore and change from Fn to FnMut. They can only be called from
|
||||
a single thread at a time. This change is only done for the corresponding
|
||||
callbacks, not the signals.
|
||||
|
||||
## [0.11.1] - 2018-04-07
|
||||
### Fixed
|
||||
- Fix Structure::to_string() to not run into an infinite recursion but call
|
||||
the method on the contained StructureRef instead of on itself
|
||||
|
||||
## [0.11.0] - 2018-03-20
|
||||
### Changed
|
||||
- Updated everything to GStreamer 1.14.0
|
||||
- Event, Message and Query types were refactored to improve usability.
|
||||
Especially newly constructed queries allow to directly use the type-specific
|
||||
functions to be used without first creating a view
|
||||
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
|
||||
original functions work with refs instead of full frames
|
||||
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
|
||||
- GstPlayer has GstObject as parent class now
|
||||
|
||||
### Added
|
||||
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
|
||||
- GstPromise, GstAudioStreamAlign and various other 1.14 API
|
||||
- GstVideoFilter and GstBufferPool bindings
|
||||
- Element::call_async()
|
||||
- Debug impl For Toc and TocEntry
|
||||
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
|
||||
|
||||
### Fixed
|
||||
- Memory leak in gst_video::convert_sample_async()
|
||||
|
||||
## [0.10.2] - 2018-02-18
|
||||
### Fixed
|
||||
- Fix building of messages with custom fields for types that don't have a
|
||||
GstStructure
|
||||
|
||||
### Added
|
||||
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref(), which work with
|
||||
VideoFrameRefs instead of full VideoFrames
|
||||
- Getters for the BaseSrc/Sink/Transform configured segment
|
||||
- Document the gstreamer-player-1.0 dependency in the README.md
|
||||
|
||||
## [0.10.1] - 2018-01-03
|
||||
### Fixed
|
||||
- Don't require &mut self for TagSetterExtManual::add()
|
||||
|
||||
### Added
|
||||
- A TagSetter example application
|
||||
- Bindings for gst_video::convert_sample() and ::convert_sample_async()
|
||||
- Bindings for gst_video::VideoRectangle
|
||||
- Debug impl for Sample and ::with_buffer_list() constructor
|
||||
- A borrowing version of VideoFrame: VideoFrameRef
|
||||
- Bindings for GstVideoFilter
|
||||
|
||||
### Changed
|
||||
- Deprecated Sample::get_info() in favour of ::get_structure()
|
||||
- Player has gst::Object as another parent class now
|
||||
|
||||
## [0.10.0] - 2017-12-22
|
||||
### Fixed
|
||||
- Various clippy warnings
|
||||
- Memory leak of the tag list in Toc::merge_tags()
|
||||
- Property getters use Values of the correct type
|
||||
- Event::get_structure(), Message::get_structure() and
|
||||
Query::get_structure() can return None for the structure
|
||||
- Various other nullability fixes all over the API, changing functions to
|
||||
accept Option<> or returning Option<>, or only plain types
|
||||
- Functions taking paths/filenames now actually take Paths instead of &strs
|
||||
- Element::remove_pad() is not giving away a new reference to the pad
|
||||
anymore, which caused a memory leak of all pads ever removed
|
||||
- Precision handling in ClockTime's Display impl
|
||||
- Video/AudioInfo are only Send, not Sync
|
||||
|
||||
### Added
|
||||
- Various enums now also derive useful traits like Copy, Clone and Hash in
|
||||
addition to PartialEq, Eq and Debug
|
||||
- TagList::merge() and insert() for combining tag lists
|
||||
- EventType gained many useful functions to work with event types and
|
||||
a PartialOrd impl to check expected event order of event types where it matters
|
||||
- MessageRef/EventRef/QueryRef implement ToOwned
|
||||
- Bindings for Registry and PluginFeature
|
||||
- Event::set_running_time_offset() for adjusting the offset while events
|
||||
pass through the pipeline
|
||||
- Event/Message GroupIds and Seqnums now have a newtype wrapper around u32
|
||||
instead of the plain value, making usage of them slightly more typesafe.
|
||||
Also add an "invalid" value for both, as exists in latest GStreamer now.
|
||||
- FormattedValue, GenericFormattedValue and related types were
|
||||
implemented now, which allows more convenient and type-safe usage of
|
||||
formatted values (time, bytes, etc)
|
||||
- Bindings for force-keyunit and still-frame events were added
|
||||
- MappedBuffer/BufferMap now implement various other useful traits, including
|
||||
AsRef<[u8]>, AsMut, Deref, DerefMut, Debug, PartialEq and Eq
|
||||
- Add VideoMultiviewFramePacking enum, and use it in Player
|
||||
- Bindings for the GStreamer Net library, including PTP/NTP/network client
|
||||
clocks and the GStreamer NetClock provider for network synchronization of
|
||||
pipelines
|
||||
- IteratorError implements std::error:Error
|
||||
- Plugin::add_dependency() and ::add_dependency_simple() was added
|
||||
- Rank and TypeFindProbability implement PartialOrd/Ord now
|
||||
- Bindings for TypeFind, TypeFindFactory and the typefind helpers
|
||||
- StreamCollection::iter() for iterating over all contained streams
|
||||
- ErrorMessage type that can be used e.g. in a Result for passing an error
|
||||
message from somewhere to upper layers to then be posted on an element the
|
||||
same way gst_element_error!() would've done
|
||||
|
||||
### Changed
|
||||
- Sample::new(), TagList::add(), Structure::set() and similar
|
||||
functions take the values (ToSendValue impls) by reference instead of value.
|
||||
They were not consumed by the function before.
|
||||
- The Debug impls of various types, including Event/Buffer/Message/Query/Structure
|
||||
were improved to print all the fields, similar to what GST_PTR_FORMAT would
|
||||
do in C
|
||||
- Switched to lazy_static 1.0
|
||||
- Gap event and Duration tag are using ClockTimes now, as well as various
|
||||
Player signals
|
||||
- Segment is now based on a generic type FormattedSegment that can
|
||||
take any format (time, bytes, etc) or a GenericFormattedValue for more
|
||||
type-safety and convenience. Also functions for "casting" between a generic
|
||||
segment and a segment with a specific format exist on this now
|
||||
- AppSrc and AppSink now have a builder for the callbacks, making it
|
||||
unnecessary to always provide all callbacks even if only one is actually
|
||||
needed
|
||||
- Various functions that returned bool for errors, are now returning a Result
|
||||
- Player configuration is now a custom type with more convenient API
|
||||
- Player VideoInfo uses a Fraction instead of (u32,u32) for the framerate and
|
||||
pixel-aspect-ratio
|
||||
- VideoFrame API has more consistent API between writable and read-only
|
||||
variants
|
||||
- Buffer::copy_into() was added, and ::copy_region() now takes a
|
||||
BufferCopyFlags parameter instead of always using the default flags
|
||||
- ChildProxy::set_child_property() takes a &ToValue now to follow the API of
|
||||
Object::set_property() and improve usability
|
||||
- Proxy/GhostPad default pad functions use the correct specific pad type now
|
||||
instead of a generic Pad
|
||||
- Bus::add_signal_watch_full() takes a Priority for the priority instead of u32
|
||||
- Clock::(un)adjust_with_calibration() takes no clock parameter anymore
|
||||
|
||||
### Removed
|
||||
- FormatValue was removed in favour of GenericFormattedValue and the
|
||||
connected traits and specific format impls
|
||||
|
||||
## [0.9.1] - 2017-11-26
|
||||
### Fixed
|
||||
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
|
||||
`PadLinkError`/`PadLinkSuccess` too
|
||||
|
||||
## [0.9.0] - 2017-11-26
|
||||
### Added
|
||||
- Bindings for (outputting to) the GStreamer logging system
|
||||
- Bindings for the GStreamer base library
|
||||
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
|
||||
functions
|
||||
- Bindings for `StaticCaps` and `StaticPadTemplate`
|
||||
- Bindings for `deep-notify` signal on `Object`
|
||||
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
|
||||
from an element with context information (file, line, module, etc.) similar
|
||||
to the C `GST_ELEMENT_ERROR` macro
|
||||
- Support for setting custom fields in `Messages`/`Events` during construction
|
||||
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
|
||||
`AsMut<[u8]>`
|
||||
- Support for using the `Read` trait on `Adapter`
|
||||
- Functions for getting all sink/src/all pads of an `Element`, and all children
|
||||
of a `Bin`
|
||||
- Builder for `Caps` and `Structures` in addition to the existing functions
|
||||
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
|
||||
- Rust ports of the basic tutorials 1 to 8 from
|
||||
https://gstreamer.freedesktop.org/documentation/tutorials/
|
||||
- "Getting started" and "Installation" sections to the README.md
|
||||
- "dox" feature for generating documentation for all available configurations
|
||||
|
||||
### Fixed
|
||||
- `StackTraceFlags` are only available since 1.12
|
||||
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
|
||||
examples and tutorials, to be able to show a window or anything else
|
||||
|
||||
### Changed
|
||||
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
|
||||
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
|
||||
and other traits as needed and ensures that no accidential calculations with
|
||||
`CLOCK_TIME_NONE` can happen
|
||||
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
|
||||
`Seek` events now return a `FormatValue` type. This contains the actual
|
||||
`Format` together with the value and does any required conversions. This
|
||||
also makes it harder to accidentially mix e.g. values in bytes and time
|
||||
- `PadProbeId` does not implement `Clone`/`Copy` anymore
|
||||
- Property notify watches return a custom type instead of ulong
|
||||
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
|
||||
`glib::Error` now. Using arbitrary ones does not work
|
||||
- `Iterator` bindings were completely rewritten and provide the item type as a
|
||||
generic type parameter now, greatly simplifying its usage
|
||||
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
|
||||
`Structures`, as their content must be possible to send to different threads
|
||||
safely
|
||||
- `Message::get_src()` can return `None`
|
||||
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
|
||||
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
|
||||
- Moved `copy()` from `GstRc` directly to `MiniObject`
|
||||
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
|
||||
implement an `into_result()` function that splits them into a `Result` with
|
||||
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
|
||||
accidentially ignore errors.
|
||||
- Error enums implement the `Error` trait
|
||||
|
||||
- Many examples use the `failure` crate for error handling now, cleaning up the
|
||||
error handling code quite a bit
|
||||
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
|
||||
|
||||
## [0.8.2] - 2017-11-11
|
||||
### Fixed
|
||||
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
|
||||
GstRc<BufferRef> already implements StaticType if BufferRef does, and
|
||||
without this it was not possible to use Buffers in GValues.
|
||||
- Free memory of the appsink/appsrc callbacks with the correct type. It was
|
||||
crashing because of using the wrong type before.
|
||||
- Fix documentation URLs in Cargo.toml.
|
||||
|
||||
### Added
|
||||
- Installation instructions and links to documentation for getting started to
|
||||
README.md.
|
||||
|
||||
## [0.8.1] - 2017-09-15
|
||||
### Added
|
||||
- Implement Send+Sync for Query, Message and Event, and their corresponding
|
||||
Ref types.
|
||||
|
||||
### Fixed
|
||||
- Constructor for gst_player::Player now works properly with GStreamer 1.12
|
||||
when passing a video renderer or signal dispatcher. There was a reference
|
||||
counting bug.
|
||||
- Instead of returning &'static references from functions, return references
|
||||
with a generic, unbound lifetime instead.
|
||||
See https://github.com/rust-lang/rust/pull/42417#issue-233404573
|
||||
- Various "unused external crate" warnings and clippy warnings everywhere.
|
||||
|
||||
### Changed
|
||||
- Remove Cargo.lock from GIT, it's not very useful for library crates.
|
||||
- Run everything through latest rustfmt-nightly.
|
||||
- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of
|
||||
u64::MAX) in the examples.
|
||||
|
||||
## [0.8.0] - 2017-08-31
|
||||
|
||||
- Initial release of the autogenerated GStreamer bindings. Older versions
|
||||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
36
gstreamer-check/Cargo.toml
Normal file
36
gstreamer-check/Cargo.toml
Normal file
|
@ -0,0 +1,36 @@
|
|||
[package]
|
||||
name = "gstreamer-check"
|
||||
version = "0.12.2"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Check library"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_check"
|
||||
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
glib-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-check-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
v1_10 = ["gstreamer-sys/v1_10", "gstreamer-check-sys/v1_10"]
|
||||
v1_12 = ["gstreamer-sys/v1_12", "gstreamer-check-sys/v1_12", "v1_10"]
|
||||
v1_14 = ["gstreamer-sys/v1_14", "gstreamer-check-sys/v1_14", "v1_12"]
|
||||
#v1_16 = ["gstreamer-sys/v1_16", "gstreamer-check-sys/v1_16", "v1_14"]
|
||||
embed-lgpl-docs = ["rustdoc-stripper"]
|
||||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-check-sys/dox", "glib/dox", "gstreamer/dox"]
|
||||
default-features = []
|
201
gstreamer-check/LICENSE-APACHE
Normal file
201
gstreamer-check/LICENSE-APACHE
Normal file
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
23
gstreamer-check/LICENSE-MIT
Normal file
23
gstreamer-check/LICENSE-MIT
Normal file
|
@ -0,0 +1,23 @@
|
|||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
200
gstreamer-check/README.md
Normal file
200
gstreamer-check/README.md
Normal file
|
@ -0,0 +1,200 @@
|
|||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-check.svg)](https://crates.io/crates/gstreamer-check) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) (Check library) bindings for Rust.
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_check/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
||||
For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/).
|
||||
|
||||
The bindings (since 0.8.0) are 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. Older versions before 0.8.0 were manually
|
||||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## 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)
|
||||
|
||||
<a name="installation"/>
|
||||
|
||||
## Installation
|
||||
|
||||
To build the GStreamer bindings or anything depending on them, you need to
|
||||
have at least GStreamer 1.8 and gst-plugins-base 1.8 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.
|
||||
|
||||
<a name="installation-linux"/>
|
||||
|
||||
### 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
|
||||
|
||||
```
|
||||
$ 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
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ 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.
|
||||
|
||||
<a name="installation-macos"/>
|
||||
|
||||
### 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.
|
||||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ 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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and
|
||||
`gstreamer-1.0-devel-1.12.3-x86_64.pkg`.
|
||||
|
||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
||||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
||||
### 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.
|
||||
|
||||
#### MSYS2 / pacman
|
||||
|
||||
```
|
||||
$ pacman -S 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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### 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.12.3.msi` and
|
||||
`gstreamer-1.0-devel-x86_64-1.12.3.msi`.
|
||||
|
||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
||||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="getting-started"/>
|
||||
|
||||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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/master/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/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
||||
## 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
|
||||
|
||||
<a name="contribution"/>
|
||||
|
||||
## 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.
|
34
gstreamer-check/build.rs
Normal file
34
gstreamer-check/build.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
fn main() {
|
||||
manage_docs();
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))]
|
||||
fn manage_docs() {
|
||||
extern crate stripper_lib;
|
||||
use std::io;
|
||||
|
||||
let path = "src";
|
||||
let ignores: &[&str] = &[];
|
||||
|
||||
stripper_lib::loop_over_files(
|
||||
path.as_ref(),
|
||||
&mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true),
|
||||
&ignores,
|
||||
false,
|
||||
);
|
||||
|
||||
#[cfg(feature = "embed-lgpl-docs")]
|
||||
{
|
||||
let docs = include_str!("../docs/gstreamer-check/docs.md");
|
||||
let mut infos = stripper_lib::parse_cmts(docs.lines(), true);
|
||||
stripper_lib::loop_over_files(
|
||||
path.as_ref(),
|
||||
&mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true),
|
||||
&ignores,
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))]
|
||||
fn manage_docs() {}
|
9
gstreamer-check/src/auto/mod.rs
Normal file
9
gstreamer-check/src/auto/mod.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod test_clock;
|
||||
pub use self::test_clock::TestClock;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {}
|
176
gstreamer-check/src/auto/test_clock.rs
Normal file
176
gstreamer-check/src/auto/test_clock.rs
Normal file
|
@ -0,0 +1,176 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::object::Downcast;
|
||||
use glib::signal::connect;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct TestClock(Object<ffi::GstTestClock, ffi::GstTestClockClass>): [
|
||||
gst::Clock => gst_ffi::GstClock,
|
||||
gst::Object => gst_ffi::GstObject,
|
||||
];
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_test_clock_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl TestClock {
|
||||
pub fn new() -> TestClock {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { gst::Clock::from_glib_full(ffi::gst_test_clock_new()).downcast_unchecked() }
|
||||
}
|
||||
|
||||
pub fn new_with_start_time(start_time: gst::ClockTime) -> TestClock {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
gst::Clock::from_glib_full(ffi::gst_test_clock_new_with_start_time(
|
||||
start_time.to_glib(),
|
||||
))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn advance_time(&self, delta: gst::ClockTimeDiff) {
|
||||
unsafe {
|
||||
ffi::gst_test_clock_advance_time(self.to_glib_none().0, delta);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn crank(&self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_test_clock_crank(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_next_entry_time(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_test_clock_get_next_entry_time(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn has_id(&self, id: /*Ignored*/gst::ClockID) -> bool {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_has_id() }
|
||||
//}
|
||||
|
||||
pub fn peek_id_count(&self) -> u32 {
|
||||
unsafe { ffi::gst_test_clock_peek_id_count(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
//pub fn peek_next_pending_id(&self, pending_id: /*Ignored*/&mut gst::ClockID) -> bool {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_peek_next_pending_id() }
|
||||
//}
|
||||
|
||||
//pub fn process_id_list(&self, pending_list: /*Ignored*/&[&gst::ClockID]) -> u32 {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_process_id_list() }
|
||||
//}
|
||||
|
||||
//pub fn process_next_clock_id(&self) -> /*Ignored*/Option<gst::ClockID> {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_process_next_clock_id() }
|
||||
//}
|
||||
|
||||
pub fn set_time(&self, new_time: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::gst_test_clock_set_time(self.to_glib_none().0, new_time.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn wait_for_multiple_pending_ids(&self, count: u32, pending_list: /*Unimplemented*/Vec<gst::ClockID>) {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_wait_for_multiple_pending_ids() }
|
||||
//}
|
||||
|
||||
//pub fn wait_for_next_pending_id(&self, pending_id: /*Ignored*/&mut gst::ClockID) {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_wait_for_next_pending_id() }
|
||||
//}
|
||||
|
||||
pub fn wait_for_pending_id_count(&self, count: u32) {
|
||||
unsafe {
|
||||
ffi::gst_test_clock_wait_for_pending_id_count(self.to_glib_none().0, count);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_clock_type(&self) -> gst::ClockType {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::ClockType as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0,
|
||||
"clock-type".to_glib_none().0,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_property_clock_type(&self, clock_type: gst::ClockType) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0,
|
||||
"clock-type".to_glib_none().0,
|
||||
Value::from(&clock_type).to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_start_time(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0,
|
||||
"start-time".to_glib_none().0,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn id_list_get_latest_time(pending_list: /*Ignored*/&[&gst::ClockID]) -> gst::ClockTime {
|
||||
// unsafe { TODO: call ffi::gst_test_clock_id_list_get_latest_time() }
|
||||
//}
|
||||
|
||||
pub fn connect_property_clock_type_notify<F: Fn(&TestClock) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&TestClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(
|
||||
self.to_glib_none().0,
|
||||
"notify::clock-type",
|
||||
transmute(notify_clock_type_trampoline as usize),
|
||||
Box_::into_raw(f) as *mut _,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for TestClock {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for TestClock {}
|
||||
unsafe impl Sync for TestClock {}
|
||||
|
||||
unsafe extern "C" fn notify_clock_type_trampoline(
|
||||
this: *mut ffi::GstTestClock,
|
||||
_param_spec: glib_ffi::gpointer,
|
||||
f: glib_ffi::gpointer,
|
||||
) {
|
||||
let f: &&(Fn(&TestClock) + Send + Sync + 'static) = transmute(f);
|
||||
f(&from_glib_borrow(this))
|
||||
}
|
2
gstreamer-check/src/auto/versions.txt
Normal file
2
gstreamer-check/src/auto/versions.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ 82cdb44)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
816
gstreamer-check/src/harness.rs
Normal file
816
gstreamer-check/src/harness.rs
Normal file
|
@ -0,0 +1,816 @@
|
|||
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::ops;
|
||||
use std::path;
|
||||
use std::ptr;
|
||||
use TestClock;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Harness(ptr::NonNull<ffi::GstHarness>, PhantomData<ffi::GstHarness>);
|
||||
|
||||
impl Drop for Harness {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_teardown(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Harness {}
|
||||
|
||||
impl Harness {
|
||||
pub fn add_element_full<
|
||||
'a,
|
||||
'b,
|
||||
'c,
|
||||
'd,
|
||||
P: IsA<gst::Element>,
|
||||
Q: Into<Option<&'a gst::StaticPadTemplate>>,
|
||||
R: Into<Option<&'b str>>,
|
||||
S: Into<Option<&'c gst::StaticPadTemplate>>,
|
||||
T: Into<Option<&'d str>>,
|
||||
>(
|
||||
&mut self,
|
||||
element: &P,
|
||||
hsrc: Q,
|
||||
element_sinkpad_name: R,
|
||||
hsink: S,
|
||||
element_srcpad_name: T,
|
||||
) {
|
||||
let hsrc = hsrc.into();
|
||||
let element_sinkpad_name = element_sinkpad_name.into();
|
||||
let element_sinkpad_name = element_sinkpad_name.to_glib_none();
|
||||
let hsink = hsink.into();
|
||||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_harness_add_element_full(
|
||||
self.0.as_ptr(),
|
||||
element.to_glib_none().0,
|
||||
hsrc.to_glib_none().0 as *mut _,
|
||||
element_sinkpad_name.0,
|
||||
hsink.to_glib_none().0 as *mut _,
|
||||
element_srcpad_name.0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_element_sink_pad<P: IsA<gst::Pad>>(&mut self, sinkpad: &P) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_element_sink_pad(self.0.as_ptr(), sinkpad.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_element_src_pad<P: IsA<gst::Pad>>(&mut self, srcpad: &P) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_element_src_pad(self.0.as_ptr(), srcpad.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_parse(&mut self, launchline: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_parse(self.0.as_ptr(), launchline.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_probe<F>(
|
||||
&mut self,
|
||||
element_name: &str,
|
||||
pad_name: &str,
|
||||
mask: gst::PadProbeType,
|
||||
func: F,
|
||||
) where
|
||||
F: Fn(&gst::Pad, &mut gst::PadProbeInfo) -> gst::PadProbeReturn + Send + Sync + 'static,
|
||||
{
|
||||
// Reimplementation of the C code so we don't have to duplicate all the callback code
|
||||
|
||||
let element = self.find_element(element_name).expect("Element not found");
|
||||
let pad = element.get_static_pad(pad_name).expect("Pad not found");
|
||||
pad.add_probe(mask, func);
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub fn add_propose_allocation_meta<'a, P: Into<Option<&'a gst::StructureRef>>>(
|
||||
&mut self,
|
||||
api: glib::types::Type,
|
||||
params: P,
|
||||
) {
|
||||
let params = params.into();
|
||||
unsafe {
|
||||
let params = params.map(|p| p.as_ptr()).unwrap_or(ptr::null_mut());
|
||||
ffi::gst_harness_add_propose_allocation_meta(self.0.as_ptr(), api.to_glib(), params);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_sink(&mut self, sink_element_name: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_sink(self.0.as_ptr(), sink_element_name.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_sink_harness(&mut self, sink_harness: Harness) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_sink_harness(self.0.as_ptr(), sink_harness.0.as_ptr());
|
||||
|
||||
mem::forget(sink_harness);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_sink_parse(&mut self, launchline: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_sink_parse(self.0.as_ptr(), launchline.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_src(&mut self, src_element_name: &str, has_clock_wait: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_src(
|
||||
self.0.as_ptr(),
|
||||
src_element_name.to_glib_none().0,
|
||||
has_clock_wait.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_src_harness(&mut self, src_harness: Harness, has_clock_wait: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_src_harness(
|
||||
self.0.as_ptr(),
|
||||
src_harness.0.as_ptr(),
|
||||
has_clock_wait.to_glib(),
|
||||
);
|
||||
|
||||
mem::forget(src_harness);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_src_parse(&mut self, launchline: &str, has_clock_wait: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_add_src_parse(
|
||||
self.0.as_ptr(),
|
||||
launchline.to_glib_none().0,
|
||||
has_clock_wait.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn buffers_in_queue(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_buffers_in_queue(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn buffers_received(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_buffers_received(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn crank_multiple_clock_waits(&mut self, waits: u32) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(
|
||||
ffi::gst_harness_crank_multiple_clock_waits(self.0.as_ptr(), waits),
|
||||
"Failed to crank multiple clock waits",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn crank_single_clock_wait(&mut self) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(
|
||||
ffi::gst_harness_crank_single_clock_wait(self.0.as_ptr()),
|
||||
"Failed to crank single clock wait",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn create_buffer(&mut self, size: usize) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_create_buffer(self.0.as_ptr(), size)) }
|
||||
}
|
||||
|
||||
pub fn dump_to_file<P: AsRef<path::Path>>(&mut self, filename: P) {
|
||||
let filename = filename.as_ref();
|
||||
unsafe {
|
||||
ffi::gst_harness_dump_to_file(self.0.as_ptr(), filename.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn events_in_queue(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_events_in_queue(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn events_received(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_events_received(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn find_element(&mut self, element_name: &str) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
|
||||
let ptr = ffi::gst_harness_find_element(self.0.as_ptr(), element_name.to_glib_none().0);
|
||||
|
||||
if ptr.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_full(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn get(&mut self, element_name: &str, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::gst_harness_get() }
|
||||
//}
|
||||
|
||||
//pub fn get_allocator(&mut self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams) {
|
||||
// unsafe { TODO: call ffi::gst_harness_get_allocator() }
|
||||
//}
|
||||
|
||||
pub fn get_last_pushed_timestamp(&self) -> gst::ClockTime {
|
||||
unsafe { from_glib(ffi::gst_harness_get_last_pushed_timestamp(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn get_testclock(&self) -> Option<TestClock> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_get_testclock(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn play(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_play(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pull(&mut self) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_pull(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn pull_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_pull_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn pull_upstream_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_pull_upstream_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn push(&mut self, buffer: gst::Buffer) -> gst::FlowReturn {
|
||||
unsafe { from_glib(ffi::gst_harness_push(self.0.as_ptr(), buffer.into_ptr())) }
|
||||
}
|
||||
|
||||
pub fn push_and_pull(&mut self, buffer: gst::Buffer) -> Option<gst::Buffer> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_harness_push_and_pull(
|
||||
self.0.as_ptr(),
|
||||
buffer.into_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn push_event(&mut self, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_harness_push_event(
|
||||
self.0.as_ptr(),
|
||||
event.into_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn push_from_src(&mut self) -> gst::FlowReturn {
|
||||
unsafe { from_glib(ffi::gst_harness_push_from_src(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn push_to_sink(&mut self) -> gst::FlowReturn {
|
||||
unsafe { from_glib(ffi::gst_harness_push_to_sink(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn push_upstream_event(&mut self, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_harness_push_upstream_event(
|
||||
self.0.as_ptr(),
|
||||
event.into_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn query_latency(&self) -> gst::ClockTime {
|
||||
unsafe { from_glib(ffi::gst_harness_query_latency(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
//pub fn set(&mut self, element_name: &str, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::gst_harness_set() }
|
||||
//}
|
||||
|
||||
pub fn set_blocking_push_mode(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_blocking_push_mode(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_caps(&mut self, in_: gst::Caps, out: gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_caps(self.0.as_ptr(), in_.into_ptr(), out.into_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_caps_str(&mut self, in_: &str, out: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_caps_str(
|
||||
self.0.as_ptr(),
|
||||
in_.to_glib_none().0,
|
||||
out.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_drop_buffers(&mut self, drop_buffers: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_drop_buffers(self.0.as_ptr(), drop_buffers.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_forwarding(&mut self, forwarding: bool) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_forwarding(self.0.as_ptr(), forwarding.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn set_propose_allocator<'a, 'b, P: Into<Option<&'a /*Ignored*/gst::Allocator>>, Q: Into<Option<&'b /*Ignored*/gst::AllocationParams>>>(&mut self, allocator: P, params: Q) {
|
||||
// unsafe { TODO: call ffi::gst_harness_set_propose_allocator() }
|
||||
//}
|
||||
|
||||
pub fn set_sink_caps(&mut self, caps: gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_sink_caps(self.0.as_ptr(), caps.into_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_sink_caps_str(&mut self, str: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_sink_caps_str(self.0.as_ptr(), str.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_src_caps(&mut self, caps: gst::Caps) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_src_caps(self.0.as_ptr(), caps.into_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_src_caps_str(&mut self, str: &str) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_src_caps_str(self.0.as_ptr(), str.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_time(&mut self, time: gst::ClockTime) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(
|
||||
ffi::gst_harness_set_time(self.0.as_ptr(), time.to_glib()),
|
||||
"Failed to set time",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_upstream_latency(&mut self, latency: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::gst_harness_set_upstream_latency(self.0.as_ptr(), latency.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sink_push_many(&mut self, pushes: u32) -> gst::FlowReturn {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_harness_sink_push_many(
|
||||
self.0.as_ptr(),
|
||||
pushes as i32,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn src_crank_and_push_many(&mut self, cranks: u32, pushes: u32) -> gst::FlowReturn {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_harness_src_crank_and_push_many(
|
||||
self.0.as_ptr(),
|
||||
cranks as i32,
|
||||
pushes as i32,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn src_push_event(&mut self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_harness_src_push_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
//pub fn stress_custom_start<'a, P: Into<Option<&'a /*Ignored*/glib::Func>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, init: P, callback: /*Unknown conversion*//*Unimplemented*/Func, data: Q, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_custom_start() }
|
||||
//}
|
||||
|
||||
//pub fn stress_property_start_full(&mut self, name: &str, value: /*Ignored*/&glib::Value, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_property_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_buffer_start_full(&mut self, caps: &mut gst::Caps, segment: /*Ignored*/&gst::Segment, buf: &mut gst::Buffer, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_buffer_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_buffer_with_cb_start_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, caps: &mut gst::Caps, segment: /*Ignored*/&gst::Segment, func: /*Unknown conversion*//*Unimplemented*/HarnessPrepareBufferFunc, data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_buffer_with_cb_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_event_start_full(&mut self, event: &mut gst::Event, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_event_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_event_with_cb_start_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, func: /*Unknown conversion*//*Unimplemented*/HarnessPrepareEventFunc, data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_event_with_cb_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_upstream_event_start_full(&mut self, event: &mut gst::Event, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_upstream_event_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_push_upstream_event_with_cb_start_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&mut self, func: /*Unknown conversion*//*Unimplemented*/HarnessPrepareEventFunc, data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_push_upstream_event_with_cb_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_requestpad_start_full(&mut self, templ: /*Ignored*/&gst::PadTemplate, name: &str, caps: &mut gst::Caps, release: bool, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_requestpad_start_full() }
|
||||
//}
|
||||
|
||||
//pub fn stress_statechange_start_full(&mut self, sleep: libc::c_ulong) -> /*Ignored*/Option<HarnessThread> {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_statechange_start_full() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn take_all_data_as_buffer(&mut self) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_take_all_data_as_buffer(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
pub fn take_all_data_as_bytes(&mut self) -> Option<glib::Bytes> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_take_all_data_as_bytes(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn try_pull(&mut self) -> Option<gst::Buffer> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_try_pull(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn try_pull_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_try_pull_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn try_pull_upstream_event(&mut self) -> Option<gst::Event> {
|
||||
unsafe { from_glib_full(ffi::gst_harness_try_pull_upstream_event(self.0.as_ptr())) }
|
||||
}
|
||||
|
||||
pub fn upstream_events_in_queue(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_upstream_events_in_queue(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn upstream_events_received(&self) -> u32 {
|
||||
unsafe { ffi::gst_harness_upstream_events_received(self.0.as_ptr()) }
|
||||
}
|
||||
|
||||
pub fn use_systemclock(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_use_systemclock(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn use_testclock(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_harness_use_testclock(self.0.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn wait_for_clock_id_waits(
|
||||
&mut self,
|
||||
waits: u32,
|
||||
timeout: u32,
|
||||
) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(
|
||||
ffi::gst_harness_wait_for_clock_id_waits(self.0.as_ptr(), waits, timeout),
|
||||
"Failed to wait for clock id waits",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn from_glib_full(ptr: *mut ffi::GstHarness) -> Harness {
|
||||
assert!(!ptr.is_null());
|
||||
|
||||
Harness(ptr::NonNull::new_unchecked(ptr), PhantomData)
|
||||
}
|
||||
|
||||
pub fn new(element_name: &str) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { Self::from_glib_full(ffi::gst_harness_new(element_name.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn new_empty() -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { Self::from_glib_full(ffi::gst_harness_new_empty()) }
|
||||
}
|
||||
|
||||
pub fn new_full<
|
||||
'a,
|
||||
'b,
|
||||
'c,
|
||||
'd,
|
||||
P: IsA<gst::Element>,
|
||||
Q: Into<Option<&'a gst::StaticPadTemplate>>,
|
||||
R: Into<Option<&'b str>>,
|
||||
S: Into<Option<&'c gst::StaticPadTemplate>>,
|
||||
T: Into<Option<&'d str>>,
|
||||
>(
|
||||
element: &P,
|
||||
hsrc: Q,
|
||||
element_sinkpad_name: R,
|
||||
hsink: S,
|
||||
element_srcpad_name: T,
|
||||
) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
let hsrc = hsrc.into();
|
||||
let element_sinkpad_name = element_sinkpad_name.into();
|
||||
let element_sinkpad_name = element_sinkpad_name.to_glib_none();
|
||||
let hsink = hsink.into();
|
||||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_full(
|
||||
element.to_glib_none().0,
|
||||
hsrc.to_glib_none().0 as *mut _,
|
||||
element_sinkpad_name.0,
|
||||
hsink.to_glib_none().0 as *mut _,
|
||||
element_srcpad_name.0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_parse(launchline: &str) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { Self::from_glib_full(ffi::gst_harness_new_parse(launchline.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn new_with_element<
|
||||
'a,
|
||||
'b,
|
||||
P: IsA<gst::Element>,
|
||||
Q: Into<Option<&'a str>>,
|
||||
R: Into<Option<&'b str>>,
|
||||
>(
|
||||
element: &P,
|
||||
element_sinkpad_name: Q,
|
||||
element_srcpad_name: R,
|
||||
) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
let element_sinkpad_name = element_sinkpad_name.into();
|
||||
let element_sinkpad_name = element_sinkpad_name.to_glib_none();
|
||||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_with_element(
|
||||
element.to_glib_none().0,
|
||||
element_sinkpad_name.0,
|
||||
element_srcpad_name.0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_padnames<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(
|
||||
element_name: &str,
|
||||
element_sinkpad_name: P,
|
||||
element_srcpad_name: Q,
|
||||
) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
let element_sinkpad_name = element_sinkpad_name.into();
|
||||
let element_sinkpad_name = element_sinkpad_name.to_glib_none();
|
||||
let element_srcpad_name = element_srcpad_name.into();
|
||||
let element_srcpad_name = element_srcpad_name.to_glib_none();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_with_padnames(
|
||||
element_name.to_glib_none().0,
|
||||
element_sinkpad_name.0,
|
||||
element_srcpad_name.0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_templates<
|
||||
'a,
|
||||
'b,
|
||||
P: Into<Option<&'a gst::StaticPadTemplate>>,
|
||||
Q: Into<Option<&'b gst::StaticPadTemplate>>,
|
||||
>(
|
||||
element_name: &str,
|
||||
hsrc: P,
|
||||
hsink: Q,
|
||||
) -> Harness {
|
||||
assert_initialized_main_thread!();
|
||||
let hsrc = hsrc.into();
|
||||
let hsink = hsink.into();
|
||||
unsafe {
|
||||
Self::from_glib_full(ffi::gst_harness_new_with_templates(
|
||||
element_name.to_glib_none().0,
|
||||
hsrc.to_glib_none().0 as *mut _,
|
||||
hsink.to_glib_none().0 as *mut _,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn stress_thread_stop(t: /*Ignored*/&mut HarnessThread) -> u32 {
|
||||
// unsafe { TODO: call ffi::gst_harness_stress_thread_stop() }
|
||||
//}
|
||||
|
||||
pub fn get_element(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
|
||||
let ptr = (*self.0.as_ptr()).element;
|
||||
|
||||
if ptr.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_none(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_sinkpad(&self) -> Option<gst::Pad> {
|
||||
unsafe {
|
||||
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
|
||||
let ptr = (*self.0.as_ptr()).sinkpad;
|
||||
|
||||
if ptr.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_none(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_srcpad(&self) -> Option<gst::Pad> {
|
||||
unsafe {
|
||||
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
|
||||
let ptr = (*self.0.as_ptr()).srcpad;
|
||||
|
||||
if ptr.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Clear floating flag if it is set
|
||||
if gobject_ffi::g_object_is_floating(ptr as *mut _) != glib_ffi::GFALSE {
|
||||
gobject_ffi::g_object_ref_sink(ptr as *mut _);
|
||||
}
|
||||
|
||||
from_glib_none(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_sink_harness<'a>(&'a self) -> Option<Ref<'a>> {
|
||||
unsafe {
|
||||
let sink_harness = (*self.0.as_ptr()).sink_harness;
|
||||
if sink_harness.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(Ref(
|
||||
Some(Harness(
|
||||
ptr::NonNull::new_unchecked(sink_harness),
|
||||
PhantomData,
|
||||
)),
|
||||
PhantomData,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_src_harness<'a>(&'a self) -> Option<Ref<'a>> {
|
||||
unsafe {
|
||||
let src_harness = (*self.0.as_ptr()).src_harness;
|
||||
if src_harness.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(Ref(
|
||||
Some(Harness(
|
||||
ptr::NonNull::new_unchecked(src_harness),
|
||||
PhantomData,
|
||||
)),
|
||||
PhantomData,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_mut_sink_harness<'a>(&'a mut self) -> Option<RefMut<'a>> {
|
||||
unsafe {
|
||||
let sink_harness = (*self.0.as_ptr()).sink_harness;
|
||||
if sink_harness.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(RefMut(
|
||||
Some(Harness(
|
||||
ptr::NonNull::new_unchecked(sink_harness),
|
||||
PhantomData,
|
||||
)),
|
||||
PhantomData,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_mut_src_harness<'a>(&'a mut self) -> Option<RefMut<'a>> {
|
||||
unsafe {
|
||||
let src_harness = (*self.0.as_ptr()).src_harness;
|
||||
if src_harness.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(RefMut(
|
||||
Some(Harness(
|
||||
ptr::NonNull::new_unchecked(src_harness),
|
||||
PhantomData,
|
||||
)),
|
||||
PhantomData,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Ref<'a>(Option<Harness>, PhantomData<&'a ffi::GstHarness>);
|
||||
|
||||
impl<'a> ops::Deref for Ref<'a> {
|
||||
type Target = Harness;
|
||||
|
||||
fn deref(&self) -> &Harness {
|
||||
self.0.as_ref().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Drop for Ref<'a> {
|
||||
fn drop(&mut self) {
|
||||
// We only really borrow
|
||||
mem::forget(self.0.take())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RefMut<'a>(Option<Harness>, PhantomData<&'a mut ffi::GstHarness>);
|
||||
|
||||
impl<'a> ops::Deref for RefMut<'a> {
|
||||
type Target = Harness;
|
||||
|
||||
fn deref(&self) -> &Harness {
|
||||
self.0.as_ref().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ops::DerefMut for RefMut<'a> {
|
||||
fn deref_mut(&mut self) -> &mut Harness {
|
||||
self.0.as_mut().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Drop for RefMut<'a> {
|
||||
fn drop(&mut self) {
|
||||
// We only really borrow
|
||||
mem::forget(self.0.take())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_identity_push_pull() {
|
||||
gst::init().unwrap();
|
||||
|
||||
let mut h = Harness::new("identity");
|
||||
let buf = gst::Buffer::new();
|
||||
let buf = h.push_and_pull(buf);
|
||||
assert!(buf.is_some());
|
||||
}
|
||||
}
|
48
gstreamer-check/src/lib.rs
Normal file
48
gstreamer-check/src/lib.rs
Normal file
|
@ -0,0 +1,48 @@
|
|||
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_check_sys as ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
||||
mod test_clock;
|
||||
|
||||
pub mod harness;
|
||||
pub use harness::Harness;
|
||||
|
||||
// Re-export all the traits in a prelude module, so that applications
|
||||
// can always "use gst::prelude::*" without getting conflicts
|
||||
pub mod prelude {
|
||||
pub use glib::prelude::*;
|
||||
pub use gst::prelude::*;
|
||||
|
||||
pub use auto::traits::*;
|
||||
}
|
76
gstreamer-check/src/test_clock.rs
Normal file
76
gstreamer-check/src/test_clock.rs
Normal file
|
@ -0,0 +1,76 @@
|
|||
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use std::ptr;
|
||||
use TestClock;
|
||||
|
||||
impl TestClock {
|
||||
pub fn has_id(&self, id: &gst::ClockId) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_test_clock_has_id(
|
||||
self.to_glib_none().0,
|
||||
id.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn peek_next_pending_id(&self) -> Option<gst::ClockId> {
|
||||
unsafe {
|
||||
let mut id = ptr::null_mut();
|
||||
let ret: bool = from_glib(ffi::gst_test_clock_peek_next_pending_id(
|
||||
self.to_glib_none().0,
|
||||
&mut id,
|
||||
));
|
||||
if ret {
|
||||
from_glib_full(id)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_id_list(&self, pending_list: &[&gst::ClockId]) -> u32 {
|
||||
unsafe {
|
||||
ffi::gst_test_clock_process_id_list(
|
||||
self.to_glib_none().0,
|
||||
pending_list.to_glib_none().0,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_next_clock_id(&self) -> Option<gst::ClockId> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_test_clock_process_next_clock_id(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn wait_for_multiple_pending_ids(&self, count: u32) -> Vec<gst::ClockId> {
|
||||
unsafe {
|
||||
let mut pending_list = ptr::null_mut();
|
||||
ffi::gst_test_clock_wait_for_multiple_pending_ids(
|
||||
self.to_glib_none().0,
|
||||
count,
|
||||
&mut pending_list,
|
||||
);
|
||||
FromGlibPtrContainer::from_glib_full(pending_list)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn wait_for_next_pending_id(&self) -> gst::ClockId {
|
||||
unsafe {
|
||||
let mut id = ptr::null_mut();
|
||||
ffi::gst_test_clock_wait_for_next_pending_id(self.to_glib_none().0, &mut id);
|
||||
from_glib_full(id)
|
||||
}
|
||||
}
|
||||
}
|
386
gstreamer-editing-services/CHANGELOG.md
Normal file
386
gstreamer-editing-services/CHANGELOG.md
Normal file
|
@ -0,0 +1,386 @@
|
|||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
- Explicitly define [bin] section for discoverer example to fix a cargo
|
||||
warning
|
||||
|
||||
### Added
|
||||
- Add unsafe gst::deinit() function
|
||||
- Ord/PartialOrd impls on gst::Seqnum
|
||||
- Getter for current pad mode
|
||||
- gst::Pad::sticky_events_foreach() for iterating over all sticky events
|
||||
in a thread-safe way
|
||||
|
||||
## [0.11.5] - 2018-07-24
|
||||
### Fixed
|
||||
- `gst::Bus`'s sync handler must unref every message if
|
||||
`gst::BusSyncReply::Drop` is returned, otherwise they are all leaked
|
||||
|
||||
## [0.11.4] - 2018-07-19
|
||||
### Fixed
|
||||
- `gst::Caps::subtract()` does not leak its arguments anymore
|
||||
- `gst::Caps::get_structure()` gracefully returns `None` if the index
|
||||
is out of bounds instead of a `g_return_val_if_fail()`
|
||||
- `gst::Structure::new()` has to give away ownership of the info structure
|
||||
but didn't. For 0.11 we internally copy, in 0.12 it will take the info
|
||||
structure by value
|
||||
- Typefind tests don't fail anymore if the system has typefind factories
|
||||
without caps
|
||||
|
||||
### Added
|
||||
- An additional assertion that ensures that miniobjects are actually
|
||||
writable before creating a mutable reference
|
||||
|
||||
## [0.11.3] - 2018-06-08
|
||||
### Added
|
||||
- `gst::Bus::remove_watch()` is now available to remove a bus watch again
|
||||
- `fmt::Debug` impls for `AudioInfo` and `VideoInfo` were added
|
||||
- `fmt::Debug` impls for mini objects also print the pointer value now to make
|
||||
it easier to track them in debug logs
|
||||
- `PlayerVisualization` has accessors for the name and description fields now,
|
||||
without which there is no sensible way to use them or to set a player
|
||||
visualization
|
||||
|
||||
## [0.11.2] - 2018-05-09
|
||||
### Fixed
|
||||
- Work-around various floating reference handling changes between 1.12 and
|
||||
1.14 to be able to run with both versions without memory leaks or other
|
||||
reference count problems.
|
||||
This affects NetTimeProvider, BufferPool, DeviceMonitor, Stream,
|
||||
StreamCollection, and Player, NetClientClock, NetClock, PtpClock which were
|
||||
already previously fixed.
|
||||
|
||||
### Changed
|
||||
- Change the appsrc need-data and all appsink callbacks to not require the
|
||||
Sync bound anymore and change from Fn to FnMut. They can only be called from
|
||||
a single thread at a time. This change is only done for the corresponding
|
||||
callbacks, not the signals.
|
||||
|
||||
## [0.11.1] - 2018-04-07
|
||||
### Fixed
|
||||
- Fix Structure::to_string() to not run into an infinite recursion but call
|
||||
the method on the contained StructureRef instead of on itself
|
||||
|
||||
## [0.11.0] - 2018-03-20
|
||||
### Changed
|
||||
- Updated everything to GStreamer 1.14.0
|
||||
- Event, Message and Query types were refactored to improve usability.
|
||||
Especially newly constructed queries allow to directly use the type-specific
|
||||
functions to be used without first creating a view
|
||||
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref() are gone now and the
|
||||
original functions work with refs instead of full frames
|
||||
- PadProbeId and NotifyIds are not Copy/Clone anymore and are taken by value
|
||||
- GstPlayer has GstObject as parent class now
|
||||
|
||||
### Added
|
||||
- GstPbutils, GstSdp, GstRtsp and GstRtspServer bindings
|
||||
- GstPromise, GstAudioStreamAlign and various other 1.14 API
|
||||
- GstVideoFilter and GstBufferPool bindings
|
||||
- Element::call_async()
|
||||
- Debug impl For Toc and TocEntry
|
||||
- Various new examples (RTP FEC, RTSP server, tag usage, ...)
|
||||
|
||||
### Fixed
|
||||
- Memory leak in gst_video::convert_sample_async()
|
||||
|
||||
## [0.10.2] - 2018-02-18
|
||||
### Fixed
|
||||
- Fix building of messages with custom fields for types that don't have a
|
||||
GstStructure
|
||||
|
||||
### Added
|
||||
- VideoFrameRef::copy_to_ref() and ::copy_plane_to_ref(), which work with
|
||||
VideoFrameRefs instead of full VideoFrames
|
||||
- Getters for the BaseSrc/Sink/Transform configured segment
|
||||
- Document the gstreamer-player-1.0 dependency in the README.md
|
||||
|
||||
## [0.10.1] - 2018-01-03
|
||||
### Fixed
|
||||
- Don't require &mut self for TagSetterExtManual::add()
|
||||
|
||||
### Added
|
||||
- A TagSetter example application
|
||||
- Bindings for gst_video::convert_sample() and ::convert_sample_async()
|
||||
- Bindings for gst_video::VideoRectangle
|
||||
- Debug impl for Sample and ::with_buffer_list() constructor
|
||||
- A borrowing version of VideoFrame: VideoFrameRef
|
||||
- Bindings for GstVideoFilter
|
||||
|
||||
### Changed
|
||||
- Deprecated Sample::get_info() in favour of ::get_structure()
|
||||
- Player has gst::Object as another parent class now
|
||||
|
||||
## [0.10.0] - 2017-12-22
|
||||
### Fixed
|
||||
- Various clippy warnings
|
||||
- Memory leak of the tag list in Toc::merge_tags()
|
||||
- Property getters use Values of the correct type
|
||||
- Event::get_structure(), Message::get_structure() and
|
||||
Query::get_structure() can return None for the structure
|
||||
- Various other nullability fixes all over the API, changing functions to
|
||||
accept Option<> or returning Option<>, or only plain types
|
||||
- Functions taking paths/filenames now actually take Paths instead of &strs
|
||||
- Element::remove_pad() is not giving away a new reference to the pad
|
||||
anymore, which caused a memory leak of all pads ever removed
|
||||
- Precision handling in ClockTime's Display impl
|
||||
- Video/AudioInfo are only Send, not Sync
|
||||
|
||||
### Added
|
||||
- Various enums now also derive useful traits like Copy, Clone and Hash in
|
||||
addition to PartialEq, Eq and Debug
|
||||
- TagList::merge() and insert() for combining tag lists
|
||||
- EventType gained many useful functions to work with event types and
|
||||
a PartialOrd impl to check expected event order of event types where it matters
|
||||
- MessageRef/EventRef/QueryRef implement ToOwned
|
||||
- Bindings for Registry and PluginFeature
|
||||
- Event::set_running_time_offset() for adjusting the offset while events
|
||||
pass through the pipeline
|
||||
- Event/Message GroupIds and Seqnums now have a newtype wrapper around u32
|
||||
instead of the plain value, making usage of them slightly more typesafe.
|
||||
Also add an "invalid" value for both, as exists in latest GStreamer now.
|
||||
- FormattedValue, GenericFormattedValue and related types were
|
||||
implemented now, which allows more convenient and type-safe usage of
|
||||
formatted values (time, bytes, etc)
|
||||
- Bindings for force-keyunit and still-frame events were added
|
||||
- MappedBuffer/BufferMap now implement various other useful traits, including
|
||||
AsRef<[u8]>, AsMut, Deref, DerefMut, Debug, PartialEq and Eq
|
||||
- Add VideoMultiviewFramePacking enum, and use it in Player
|
||||
- Bindings for the GStreamer Net library, including PTP/NTP/network client
|
||||
clocks and the GStreamer NetClock provider for network synchronization of
|
||||
pipelines
|
||||
- IteratorError implements std::error:Error
|
||||
- Plugin::add_dependency() and ::add_dependency_simple() was added
|
||||
- Rank and TypeFindProbability implement PartialOrd/Ord now
|
||||
- Bindings for TypeFind, TypeFindFactory and the typefind helpers
|
||||
- StreamCollection::iter() for iterating over all contained streams
|
||||
- ErrorMessage type that can be used e.g. in a Result for passing an error
|
||||
message from somewhere to upper layers to then be posted on an element the
|
||||
same way gst_element_error!() would've done
|
||||
|
||||
### Changed
|
||||
- Sample::new(), TagList::add(), Structure::set() and similar
|
||||
functions take the values (ToSendValue impls) by reference instead of value.
|
||||
They were not consumed by the function before.
|
||||
- The Debug impls of various types, including Event/Buffer/Message/Query/Structure
|
||||
were improved to print all the fields, similar to what GST_PTR_FORMAT would
|
||||
do in C
|
||||
- Switched to lazy_static 1.0
|
||||
- Gap event and Duration tag are using ClockTimes now, as well as various
|
||||
Player signals
|
||||
- Segment is now based on a generic type FormattedSegment that can
|
||||
take any format (time, bytes, etc) or a GenericFormattedValue for more
|
||||
type-safety and convenience. Also functions for "casting" between a generic
|
||||
segment and a segment with a specific format exist on this now
|
||||
- AppSrc and AppSink now have a builder for the callbacks, making it
|
||||
unnecessary to always provide all callbacks even if only one is actually
|
||||
needed
|
||||
- Various functions that returned bool for errors, are now returning a Result
|
||||
- Player configuration is now a custom type with more convenient API
|
||||
- Player VideoInfo uses a Fraction instead of (u32,u32) for the framerate and
|
||||
pixel-aspect-ratio
|
||||
- VideoFrame API has more consistent API between writable and read-only
|
||||
variants
|
||||
- Buffer::copy_into() was added, and ::copy_region() now takes a
|
||||
BufferCopyFlags parameter instead of always using the default flags
|
||||
- ChildProxy::set_child_property() takes a &ToValue now to follow the API of
|
||||
Object::set_property() and improve usability
|
||||
- Proxy/GhostPad default pad functions use the correct specific pad type now
|
||||
instead of a generic Pad
|
||||
- Bus::add_signal_watch_full() takes a Priority for the priority instead of u32
|
||||
- Clock::(un)adjust_with_calibration() takes no clock parameter anymore
|
||||
|
||||
### Removed
|
||||
- FormatValue was removed in favour of GenericFormattedValue and the
|
||||
connected traits and specific format impls
|
||||
|
||||
## [0.9.1] - 2017-11-26
|
||||
### Fixed
|
||||
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
|
||||
`PadLinkError`/`PadLinkSuccess` too
|
||||
|
||||
## [0.9.0] - 2017-11-26
|
||||
### Added
|
||||
- Bindings for (outputting to) the GStreamer logging system
|
||||
- Bindings for the GStreamer base library
|
||||
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
|
||||
functions
|
||||
- Bindings for `StaticCaps` and `StaticPadTemplate`
|
||||
- Bindings for `deep-notify` signal on `Object`
|
||||
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
|
||||
from an element with context information (file, line, module, etc.) similar
|
||||
to the C `GST_ELEMENT_ERROR` macro
|
||||
- Support for setting custom fields in `Messages`/`Events` during construction
|
||||
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
|
||||
`AsMut<[u8]>`
|
||||
- Support for using the `Read` trait on `Adapter`
|
||||
- Functions for getting all sink/src/all pads of an `Element`, and all children
|
||||
of a `Bin`
|
||||
- Builder for `Caps` and `Structures` in addition to the existing functions
|
||||
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
|
||||
- Rust ports of the basic tutorials 1 to 8 from
|
||||
https://gstreamer.freedesktop.org/documentation/tutorials/
|
||||
- "Getting started" and "Installation" sections to the README.md
|
||||
- "dox" feature for generating documentation for all available configurations
|
||||
|
||||
### Fixed
|
||||
- `StackTraceFlags` are only available since 1.12
|
||||
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
|
||||
examples and tutorials, to be able to show a window or anything else
|
||||
|
||||
### Changed
|
||||
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
|
||||
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
|
||||
and other traits as needed and ensures that no accidential calculations with
|
||||
`CLOCK_TIME_NONE` can happen
|
||||
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
|
||||
`Seek` events now return a `FormatValue` type. This contains the actual
|
||||
`Format` together with the value and does any required conversions. This
|
||||
also makes it harder to accidentially mix e.g. values in bytes and time
|
||||
- `PadProbeId` does not implement `Clone`/`Copy` anymore
|
||||
- Property notify watches return a custom type instead of ulong
|
||||
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
|
||||
`glib::Error` now. Using arbitrary ones does not work
|
||||
- `Iterator` bindings were completely rewritten and provide the item type as a
|
||||
generic type parameter now, greatly simplifying its usage
|
||||
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
|
||||
`Structures`, as their content must be possible to send to different threads
|
||||
safely
|
||||
- `Message::get_src()` can return `None`
|
||||
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
|
||||
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
|
||||
- Moved `copy()` from `GstRc` directly to `MiniObject`
|
||||
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
|
||||
implement an `into_result()` function that splits them into a `Result` with
|
||||
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
|
||||
accidentially ignore errors.
|
||||
- Error enums implement the `Error` trait
|
||||
|
||||
- Many examples use the `failure` crate for error handling now, cleaning up the
|
||||
error handling code quite a bit
|
||||
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
|
||||
|
||||
## [0.8.2] - 2017-11-11
|
||||
### Fixed
|
||||
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
|
||||
GstRc<BufferRef> already implements StaticType if BufferRef does, and
|
||||
without this it was not possible to use Buffers in GValues.
|
||||
- Free memory of the appsink/appsrc callbacks with the correct type. It was
|
||||
crashing because of using the wrong type before.
|
||||
- Fix documentation URLs in Cargo.toml.
|
||||
|
||||
### Added
|
||||
- Installation instructions and links to documentation for getting started to
|
||||
README.md.
|
||||
|
||||
## [0.8.1] - 2017-09-15
|
||||
### Added
|
||||
- Implement Send+Sync for Query, Message and Event, and their corresponding
|
||||
Ref types.
|
||||
|
||||
### Fixed
|
||||
- Constructor for gst_player::Player now works properly with GStreamer 1.12
|
||||
when passing a video renderer or signal dispatcher. There was a reference
|
||||
counting bug.
|
||||
- Instead of returning &'static references from functions, return references
|
||||
with a generic, unbound lifetime instead.
|
||||
See https://github.com/rust-lang/rust/pull/42417#issue-233404573
|
||||
- Various "unused external crate" warnings and clippy warnings everywhere.
|
||||
|
||||
### Changed
|
||||
- Remove Cargo.lock from GIT, it's not very useful for library crates.
|
||||
- Run everything through latest rustfmt-nightly.
|
||||
- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of
|
||||
u64::MAX) in the examples.
|
||||
|
||||
## [0.8.0] - 2017-08-31
|
||||
|
||||
- Initial release of the autogenerated GStreamer bindings. Older versions
|
||||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
43
gstreamer-editing-services/Cargo.toml
Normal file
43
gstreamer-editing-services/Cargo.toml
Normal file
|
@ -0,0 +1,43 @@
|
|||
[package]
|
||||
name = "gstreamer-editing-services"
|
||||
version = "0.12.2"
|
||||
authors = ["Thibault Saunier <tsaunier@igalia.com>", "Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Editing Services"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_editing_services"
|
||||
keywords = ["gstreamer", "multimedia", "gnome", "nle"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
bitflags = "1.0"
|
||||
glib-sys = "0.7"
|
||||
gio-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-pbutils-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-editing-services-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gio = "0.5"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
gstreamer-base = { version = "0.12", path = "../gstreamer-base" }
|
||||
gstreamer-pbutils = { version = "0.12.2", path = "../gstreamer-pbutils" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
v1_8 = ["gstreamer-editing-services-sys/v1_8"]
|
||||
v1_10 = ["gstreamer-editing-services-sys/v1_10"]
|
||||
v1_12 = ["gstreamer-editing-services-sys/v1_12", "v1_10"]
|
||||
v1_14 = ["gstreamer-editing-services-sys/v1_14", "v1_12"]
|
||||
v1_16 = ["gstreamer-editing-services-sys/v1_16", "v1_14"]
|
||||
embed-lgpl-docs = ["rustdoc-stripper"]
|
||||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-editing-services-sys/dox", "glib/dox", "gstreamer/dox"]
|
205
gstreamer-editing-services/README.md
Normal file
205
gstreamer-editing-services/README.md
Normal file
|
@ -0,0 +1,205 @@
|
|||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-editing-services.svg)](https://crates.io/crates/gstreamer-editing-services) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer Editing Services](https://gstreamer.freedesktop.org/) bindings for Rust.
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_editing_services/).
|
||||
|
||||
NOTE: The GStreamer Editing Services API is not Thread Safe and before the 1.16
|
||||
release this was not properly expressed in the code, leading to possible data
|
||||
unsafety even in the rust bindings. We strongly encourage you to run with
|
||||
GES >= 1.16.
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
||||
For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/).
|
||||
|
||||
The bindings (since 0.8.0) are 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. Older versions before 0.8.0 were manually
|
||||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## 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)
|
||||
|
||||
<a name="installation"/>
|
||||
|
||||
## Installation
|
||||
|
||||
To build the GStreamer bindings or anything depending on them, you need to
|
||||
have at least GStreamer 1.8 and gst-plugins-base 1.8 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.
|
||||
|
||||
<a name="installation-linux"/>
|
||||
|
||||
### 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
|
||||
|
||||
```
|
||||
$ 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
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ 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.
|
||||
|
||||
<a name="installation-macos"/>
|
||||
|
||||
### 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.
|
||||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ 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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and
|
||||
`gstreamer-1.0-devel-1.12.3-x86_64.pkg`.
|
||||
|
||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
||||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
||||
### 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.
|
||||
|
||||
#### MSYS2 / pacman
|
||||
|
||||
```
|
||||
$ pacman -S 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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### 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.12.3.msi` and
|
||||
`gstreamer-1.0-devel-x86_64-1.12.3.msi`.
|
||||
|
||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
||||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="getting-started"/>
|
||||
|
||||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
||||
## 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
|
||||
|
||||
<a name="contribution"/>
|
||||
|
||||
## 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.
|
34
gstreamer-editing-services/build.rs
Normal file
34
gstreamer-editing-services/build.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
fn main() {
|
||||
manage_docs();
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))]
|
||||
fn manage_docs() {
|
||||
extern crate stripper_lib;
|
||||
use std::io;
|
||||
|
||||
let path = "src";
|
||||
let ignores: &[&str] = &[];
|
||||
|
||||
stripper_lib::loop_over_files(
|
||||
path.as_ref(),
|
||||
&mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true),
|
||||
&ignores,
|
||||
false,
|
||||
);
|
||||
|
||||
#[cfg(feature = "embed-lgpl-docs")]
|
||||
{
|
||||
let docs = include_str!("../docs/gstreamer-editing-services/docs.md");
|
||||
let mut infos = stripper_lib::parse_cmts(docs.lines(), true);
|
||||
stripper_lib::loop_over_files(
|
||||
path.as_ref(),
|
||||
&mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true),
|
||||
&ignores,
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))]
|
||||
fn manage_docs() {}
|
245
gstreamer-editing-services/src/auto/asset.rs
Normal file
245
gstreamer-editing-services/src/auto/asset.rs
Normal file
|
@ -0,0 +1,245 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use Extractable;
|
||||
use ffi;
|
||||
#[cfg(feature = "futures")]
|
||||
use futures_core;
|
||||
use gio;
|
||||
use gio_ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Asset(Object<ffi::GESAsset, ffi::GESAssetClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_asset_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Asset {
|
||||
pub fn needs_reload(extractable_type: glib::types::Type, id: &str) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::ges_asset_needs_reload(extractable_type.to_glib(), id.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn request<'a, P: Into<Option<&'a str>>>(extractable_type: glib::types::Type, id: P) -> Result<Option<Asset>, Error> {
|
||||
assert_initialized_main_thread!();
|
||||
let id = id.into();
|
||||
let id = id.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ges_asset_request(extractable_type.to_glib(), id.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn request_async<'a, P: Into<Option<&'a gio::Cancellable>>, Q: FnOnce(Result<Asset, Error>) + Send + 'static>(extractable_type: glib::types::Type, id: &str, cancellable: P, callback: Q) {
|
||||
assert_initialized_main_thread!();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
let user_data: Box<Box<Q>> = Box::new(Box::new(callback));
|
||||
unsafe extern "C" fn request_async_trampoline<Q: FnOnce(Result<Asset, Error>) + Send + 'static>(_source_object: *mut gobject_ffi::GObject, res: *mut gio_ffi::GAsyncResult, user_data: glib_ffi::gpointer)
|
||||
{
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ges_asset_request_finish(res, &mut error);
|
||||
let result = if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) };
|
||||
let callback: Box<Box<Q>> = Box::from_raw(user_data as *mut _);
|
||||
callback(result);
|
||||
}
|
||||
let callback = request_async_trampoline::<Q>;
|
||||
unsafe {
|
||||
ffi::ges_asset_request_async(extractable_type.to_glib(), id.to_glib_none().0, cancellable.0, Some(callback), Box::into_raw(user_data) as *mut _);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "futures")]
|
||||
pub fn request_async_future(extractable_type: glib::types::Type, id: &str) -> Box_<futures_core::Future<Item = Asset, Error = Error>> {
|
||||
use gio::GioFuture;
|
||||
use fragile::Fragile;
|
||||
|
||||
let id = String::from(id);
|
||||
GioFuture::new(&(), move |_obj, send| {
|
||||
let cancellable = gio::Cancellable::new();
|
||||
let send = Fragile::new(send);
|
||||
Self::request_async(
|
||||
extractable_type,
|
||||
&id,
|
||||
Some(&cancellable),
|
||||
move |res| {
|
||||
let _ = send.into_inner().send(res);
|
||||
},
|
||||
);
|
||||
|
||||
cancellable
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AssetExt {
|
||||
fn extract(&self) -> Result<Option<Extractable>, Error>;
|
||||
|
||||
fn get_error(&self) -> Option<Error>;
|
||||
|
||||
fn get_extractable_type(&self) -> glib::types::Type;
|
||||
|
||||
fn get_id(&self) -> Option<String>;
|
||||
|
||||
fn get_proxy(&self) -> Option<Asset>;
|
||||
|
||||
fn get_proxy_target(&self) -> Option<Asset>;
|
||||
|
||||
fn list_proxies(&self) -> Vec<Asset>;
|
||||
|
||||
fn set_proxy<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, proxy: Q) -> bool;
|
||||
|
||||
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> bool;
|
||||
|
||||
fn set_property_proxy_target<P: IsA<Asset> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, proxy_target: Option<&P>);
|
||||
|
||||
fn connect_property_extractable_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Asset> + IsA<glib::object::Object>> AssetExt for O {
|
||||
fn extract(&self) -> Result<Option<Extractable>, Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ges_asset_extract(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_error(&self) -> Option<Error> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_asset_get_error(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_extractable_type(&self) -> glib::types::Type {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_asset_get_extractable_type(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_id(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_asset_get_id(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_proxy(&self) -> Option<Asset> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_asset_get_proxy(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_proxy_target(&self) -> Option<Asset> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_asset_get_proxy_target(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn list_proxies(&self) -> Vec<Asset> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::ges_asset_list_proxies(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_proxy<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, proxy: Q) -> bool {
|
||||
let proxy = proxy.into();
|
||||
let proxy = proxy.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::ges_asset_set_proxy(self.to_glib_none().0, proxy.0))
|
||||
}
|
||||
}
|
||||
|
||||
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_asset_unproxy(self.to_glib_none().0, proxy.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_proxy_target<P: IsA<Asset> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, proxy_target: Option<&P>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "proxy-target".to_glib_none().0, Value::from(proxy_target).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_extractable_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::extractable-type",
|
||||
transmute(notify_extractable_type_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::id",
|
||||
transmute(notify_id_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::proxy",
|
||||
transmute(notify_proxy_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::proxy-target",
|
||||
transmute(notify_proxy_target_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_extractable_type_trampoline<P>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Asset> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Asset::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_id_trampoline<P>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Asset> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Asset::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_proxy_trampoline<P>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Asset> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Asset::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_proxy_target_trampoline<P>(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Asset> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Asset::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
23
gstreamer-editing-services/src/auto/base_effect.rs
Normal file
23
gstreamer-editing-services/src/auto/base_effect.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Extractable;
|
||||
use TimelineElement;
|
||||
use TrackElement;
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct BaseEffect(Object<ffi::GESBaseEffect, ffi::GESBaseEffectClass>): TrackElement, TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_base_effect_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl BaseEffect {}
|
178
gstreamer-editing-services/src/auto/clip.rs
Normal file
178
gstreamer-editing-services/src/auto/clip.rs
Normal file
|
@ -0,0 +1,178 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use BaseEffect;
|
||||
use Container;
|
||||
use Extractable;
|
||||
use Layer;
|
||||
use TimelineElement;
|
||||
use Track;
|
||||
use TrackElement;
|
||||
use TrackType;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Clip(Object<ffi::GESClip, ffi::GESClipClass>): Container, TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_clip_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ClipExt {
|
||||
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> Option<TrackElement>;
|
||||
|
||||
fn find_track_element<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, type_: glib::types::Type) -> Option<TrackElement>;
|
||||
|
||||
fn find_track_elements<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, track_type: TrackType, type_: glib::types::Type) -> Vec<TrackElement>;
|
||||
|
||||
fn get_layer(&self) -> Option<Layer>;
|
||||
|
||||
fn get_supported_formats(&self) -> TrackType;
|
||||
|
||||
fn get_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32;
|
||||
|
||||
fn get_top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32;
|
||||
|
||||
fn get_top_effects(&self) -> Vec<TrackElement>;
|
||||
|
||||
fn move_to_layer(&self, layer: &Layer) -> bool;
|
||||
|
||||
fn set_supported_formats(&self, supportedformats: TrackType);
|
||||
|
||||
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> bool;
|
||||
|
||||
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> bool;
|
||||
|
||||
fn split(&self, position: u64) -> Option<Clip>;
|
||||
|
||||
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Clip> + IsA<glib::object::Object>> ClipExt for O {
|
||||
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> Option<TrackElement> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_clip_add_asset(self.to_glib_none().0, asset.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn find_track_element<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, type_: glib::types::Type) -> Option<TrackElement> {
|
||||
let track = track.into();
|
||||
let track = track.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_clip_find_track_element(self.to_glib_none().0, track.0, type_.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn find_track_elements<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, track_type: TrackType, type_: glib::types::Type) -> Vec<TrackElement> {
|
||||
let track = track.into();
|
||||
let track = track.to_glib_none();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_clip_find_track_elements(self.to_glib_none().0, track.0, track_type.to_glib(), type_.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_layer(&self) -> Option<Layer> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_clip_get_layer(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_supported_formats(&self) -> TrackType {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_clip_get_supported_formats(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32 {
|
||||
unsafe {
|
||||
ffi::ges_clip_get_top_effect_index(self.to_glib_none().0, effect.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32 {
|
||||
unsafe {
|
||||
ffi::ges_clip_get_top_effect_position(self.to_glib_none().0, effect.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_top_effects(&self) -> Vec<TrackElement> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_clip_get_top_effects(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn move_to_layer(&self, layer: &Layer) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_clip_move_to_layer(self.to_glib_none().0, layer.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_supported_formats(&self, supportedformats: TrackType) {
|
||||
unsafe {
|
||||
ffi::ges_clip_set_supported_formats(self.to_glib_none().0, supportedformats.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_clip_set_top_effect_index(self.to_glib_none().0, effect.to_glib_none().0, newindex))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_clip_set_top_effect_priority(self.to_glib_none().0, effect.to_glib_none().0, newpriority))
|
||||
}
|
||||
}
|
||||
|
||||
fn split(&self, position: u64) -> Option<Clip> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_clip_split(self.to_glib_none().0, position))
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::layer",
|
||||
transmute(notify_layer_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::supported-formats",
|
||||
transmute(notify_supported_formats_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_layer_trampoline<P>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Clip> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Clip::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_supported_formats_trampoline<P>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Clip> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Clip::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
143
gstreamer-editing-services/src/auto/container.rs
Normal file
143
gstreamer-editing-services/src/auto/container.rs
Normal file
|
@ -0,0 +1,143 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Edge;
|
||||
use EditMode;
|
||||
use Extractable;
|
||||
use Layer;
|
||||
use TimelineElement;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Container(Object<ffi::GESContainer, ffi::GESContainerClass>): TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_container_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Container {
|
||||
pub fn group(containers: &[Container]) -> Option<Container> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_container_group(containers.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GESContainerExt {
|
||||
fn add<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn edit(&self, layers: &[Layer], new_layer_priority: i32, mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn get_children(&self, recursive: bool) -> Vec<TimelineElement>;
|
||||
|
||||
fn remove<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn ungroup(&self, recursive: bool) -> Vec<Container>;
|
||||
|
||||
fn get_property_height(&self) -> u32;
|
||||
|
||||
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Container> + IsA<glib::object::Object>> GESContainerExt for O {
|
||||
fn add<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_container_add(self.to_glib_none().0, child.to_glib_none().0), "Failed to add element")
|
||||
}
|
||||
}
|
||||
|
||||
fn edit(&self, layers: &[Layer], new_layer_priority: i32, mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_container_edit(self.to_glib_none().0, layers.to_glib_none().0, new_layer_priority, mode.to_glib(), edge.to_glib(), position), "Failed to edit container")
|
||||
}
|
||||
}
|
||||
|
||||
fn get_children(&self, recursive: bool) -> Vec<TimelineElement> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_container_get_children(self.to_glib_none().0, recursive.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn remove<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_container_remove(self.to_glib_none().0, child.to_glib_none().0), "Failed to remove element")
|
||||
}
|
||||
}
|
||||
|
||||
fn ungroup(&self, recursive: bool) -> Vec<Container> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_container_ungroup(self.to_glib_full(), recursive.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_height(&self) -> u32 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u32 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "height".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &TimelineElement) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "child-added",
|
||||
transmute(child_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &TimelineElement) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "child-removed",
|
||||
transmute(child_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::height",
|
||||
transmute(notify_height_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn child_added_trampoline<P>(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer)
|
||||
where P: IsA<Container> {
|
||||
let f: &&(Fn(&P, &TimelineElement) + 'static) = transmute(f);
|
||||
f(&Container::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(element))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn child_removed_trampoline<P>(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer)
|
||||
where P: IsA<Container> {
|
||||
let f: &&(Fn(&P, &TimelineElement) + 'static) = transmute(f);
|
||||
f(&Container::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(element))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_height_trampoline<P>(this: *mut ffi::GESContainer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Container> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Container::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
70
gstreamer-editing-services/src/auto/effect.rs
Normal file
70
gstreamer-editing-services/src/auto/effect.rs
Normal file
|
@ -0,0 +1,70 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use BaseEffect;
|
||||
use Extractable;
|
||||
use TimelineElement;
|
||||
use TrackElement;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Effect(Object<ffi::GESEffect, ffi::GESEffectClass>): BaseEffect, TrackElement, TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_effect_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Effect {
|
||||
pub fn new(bin_description: &str) -> Effect {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_effect_new(bin_description.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait EffectExt {
|
||||
fn get_property_bin_description(&self) -> Option<String>;
|
||||
|
||||
fn connect_property_bin_description_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Effect> + IsA<glib::object::Object>> EffectExt for O {
|
||||
fn get_property_bin_description(&self) -> Option<String> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<String as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "bin-description".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_bin_description_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::bin-description",
|
||||
transmute(notify_bin_description_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_bin_description_trampoline<P>(this: *mut ffi::GESEffect, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Effect> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Effect::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
142
gstreamer-editing-services/src/auto/enums.rs
Normal file
142
gstreamer-editing-services/src/auto/enums.rs
Normal file
|
@ -0,0 +1,142 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::StaticType;
|
||||
use glib::Type;
|
||||
use glib::translate::*;
|
||||
use glib::value::FromValue;
|
||||
use glib::value::FromValueOptional;
|
||||
use glib::value::SetValue;
|
||||
use glib::value::Value;
|
||||
use gobject_ffi;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum Edge {
|
||||
EdgeStart,
|
||||
EdgeEnd,
|
||||
EdgeNone,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for Edge {
|
||||
type GlibType = ffi::GESEdge;
|
||||
|
||||
fn to_glib(&self) -> ffi::GESEdge {
|
||||
match *self {
|
||||
Edge::EdgeStart => ffi::GES_EDGE_START,
|
||||
Edge::EdgeEnd => ffi::GES_EDGE_END,
|
||||
Edge::EdgeNone => ffi::GES_EDGE_NONE,
|
||||
Edge::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GESEdge> for Edge {
|
||||
fn from_glib(value: ffi::GESEdge) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => Edge::EdgeStart,
|
||||
1 => Edge::EdgeEnd,
|
||||
2 => Edge::EdgeNone,
|
||||
value => Edge::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for Edge {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::ges_edge_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for Edge {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for Edge {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for Edge {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum EditMode {
|
||||
EditNormal,
|
||||
EditRipple,
|
||||
EditRoll,
|
||||
EditTrim,
|
||||
EditSlide,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for EditMode {
|
||||
type GlibType = ffi::GESEditMode;
|
||||
|
||||
fn to_glib(&self) -> ffi::GESEditMode {
|
||||
match *self {
|
||||
EditMode::EditNormal => ffi::GES_EDIT_MODE_NORMAL,
|
||||
EditMode::EditRipple => ffi::GES_EDIT_MODE_RIPPLE,
|
||||
EditMode::EditRoll => ffi::GES_EDIT_MODE_ROLL,
|
||||
EditMode::EditTrim => ffi::GES_EDIT_MODE_TRIM,
|
||||
EditMode::EditSlide => ffi::GES_EDIT_MODE_SLIDE,
|
||||
EditMode::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GESEditMode> for EditMode {
|
||||
fn from_glib(value: ffi::GESEditMode) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => EditMode::EditNormal,
|
||||
1 => EditMode::EditRipple,
|
||||
2 => EditMode::EditRoll,
|
||||
3 => EditMode::EditTrim,
|
||||
4 => EditMode::EditSlide,
|
||||
value => EditMode::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for EditMode {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::ges_edit_mode_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for EditMode {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for EditMode {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for EditMode {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
48
gstreamer-editing-services/src/auto/extractable.rs
Normal file
48
gstreamer-editing-services/src/auto/extractable.rs
Normal file
|
@ -0,0 +1,48 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Extractable(Object<ffi::GESExtractable, ffi::GESExtractableInterface>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_extractable_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ExtractableExt {
|
||||
fn get_asset(&self) -> Option<Asset>;
|
||||
|
||||
fn get_id(&self) -> Option<String>;
|
||||
|
||||
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
|
||||
}
|
||||
|
||||
impl<O: IsA<Extractable>> ExtractableExt for O {
|
||||
fn get_asset(&self) -> Option<Asset> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_extractable_get_asset(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_id(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_extractable_get_id(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_extractable_set_asset(self.to_glib_none().0, asset.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
116
gstreamer-editing-services/src/auto/flags.rs
Normal file
116
gstreamer-editing-services/src/auto/flags.rs
Normal file
|
@ -0,0 +1,116 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::StaticType;
|
||||
use glib::Type;
|
||||
use glib::translate::*;
|
||||
use glib::value::FromValue;
|
||||
use glib::value::FromValueOptional;
|
||||
use glib::value::SetValue;
|
||||
use glib::value::Value;
|
||||
use gobject_ffi;
|
||||
|
||||
bitflags! {
|
||||
pub struct PipelineFlags: u32 {
|
||||
const AUDIO_PREVIEW = 1;
|
||||
const VIDEO_PREVIEW = 2;
|
||||
const FULL_PREVIEW = 3;
|
||||
const RENDER = 4;
|
||||
const SMART_RENDER = 8;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for PipelineFlags {
|
||||
type GlibType = ffi::GESPipelineFlags;
|
||||
|
||||
fn to_glib(&self) -> ffi::GESPipelineFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GESPipelineFlags> for PipelineFlags {
|
||||
fn from_glib(value: ffi::GESPipelineFlags) -> PipelineFlags {
|
||||
skip_assert_initialized!();
|
||||
PipelineFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for PipelineFlags {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::ges_pipeline_flags_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for PipelineFlags {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for PipelineFlags {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for PipelineFlags {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct TrackType: u32 {
|
||||
const UNKNOWN = 1;
|
||||
const AUDIO = 2;
|
||||
const VIDEO = 4;
|
||||
const TEXT = 8;
|
||||
const CUSTOM = 16;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for TrackType {
|
||||
type GlibType = ffi::GESTrackType;
|
||||
|
||||
fn to_glib(&self) -> ffi::GESTrackType {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GESTrackType> for TrackType {
|
||||
fn from_glib(value: ffi::GESTrackType) -> TrackType {
|
||||
skip_assert_initialized!();
|
||||
TrackType::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for TrackType {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ffi::ges_track_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for TrackType {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for TrackType {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for TrackType {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
219
gstreamer-editing-services/src/auto/group.rs
Normal file
219
gstreamer-editing-services/src/auto/group.rs
Normal file
|
@ -0,0 +1,219 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Container;
|
||||
use Extractable;
|
||||
use TimelineElement;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Group(Object<ffi::GESGroup, ffi::GESGroupClass>): Container, TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_group_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Group {
|
||||
pub fn new() -> Group {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_group_new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Group {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GroupExt {
|
||||
fn get_property_duration(&self) -> u64;
|
||||
|
||||
fn set_property_duration(&self, duration: u64);
|
||||
|
||||
fn get_property_in_point(&self) -> u64;
|
||||
|
||||
fn set_property_in_point(&self, in_point: u64);
|
||||
|
||||
fn get_property_max_duration(&self) -> u64;
|
||||
|
||||
fn set_property_max_duration(&self, max_duration: u64);
|
||||
|
||||
fn get_property_priority(&self) -> u32;
|
||||
|
||||
fn set_property_priority(&self, priority: u32);
|
||||
|
||||
fn get_property_start(&self) -> u64;
|
||||
|
||||
fn set_property_start(&self, start: u64);
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Group> + IsA<glib::object::Object>> GroupExt for O {
|
||||
fn get_property_duration(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "duration".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_duration(&self, duration: u64) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "duration".to_glib_none().0, Value::from(&duration).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_in_point(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "in-point".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_in_point(&self, in_point: u64) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "in-point".to_glib_none().0, Value::from(&in_point).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_max_duration(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "max-duration".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_max_duration(&self, max_duration: u64) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "max-duration".to_glib_none().0, Value::from(&max_duration).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_priority(&self) -> u32 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u32 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "priority".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_priority(&self, priority: u32) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "priority".to_glib_none().0, Value::from(&priority).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_start(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "start".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_start(&self, start: u64) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "start".to_glib_none().0, Value::from(&start).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::duration",
|
||||
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::in-point",
|
||||
transmute(notify_in_point_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::max-duration",
|
||||
transmute(notify_max_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::priority",
|
||||
transmute(notify_priority_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::start",
|
||||
transmute(notify_start_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Group> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Group::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_in_point_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Group> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Group::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_max_duration_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Group> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Group::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_priority_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Group> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Group::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_start_trampoline<P>(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Group> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Group::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
220
gstreamer-editing-services/src/auto/layer.rs
Normal file
220
gstreamer-editing-services/src/auto/layer.rs
Normal file
|
@ -0,0 +1,220 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use Clip;
|
||||
use Extractable;
|
||||
use Timeline;
|
||||
use TrackType;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Layer(Object<ffi::GESLayer, ffi::GESLayerClass>): Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_layer_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Layer {
|
||||
pub fn new() -> Layer {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_layer_new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Layer {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait LayerExt {
|
||||
fn add_asset<P: IsA<Asset>>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option<Clip>;
|
||||
|
||||
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> bool;
|
||||
|
||||
fn get_auto_transition(&self) -> bool;
|
||||
|
||||
fn get_clips(&self) -> Vec<Clip>;
|
||||
|
||||
fn get_clips_in_interval(&self, start: gst::ClockTime, end: gst::ClockTime) -> Vec<Clip>;
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_priority(&self) -> u32;
|
||||
|
||||
fn get_timeline(&self) -> Option<Timeline>;
|
||||
|
||||
fn is_empty(&self) -> bool;
|
||||
|
||||
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> bool;
|
||||
|
||||
fn set_auto_transition(&self, auto_transition: bool);
|
||||
|
||||
#[cfg_attr(feature = "v1_16", deprecated)]
|
||||
fn set_priority(&self, priority: u32);
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline);
|
||||
|
||||
fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
#[cfg_attr(feature = "v1_16", deprecated)]
|
||||
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Layer> + IsA<glib::object::Object>> LayerExt for O {
|
||||
fn add_asset<P: IsA<Asset>>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option<Clip> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_layer_add_asset(self.to_glib_none().0, asset.to_glib_none().0, start.to_glib(), inpoint.to_glib(), duration.to_glib(), track_types.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_layer_add_clip(self.to_glib_none().0, clip.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_auto_transition(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_layer_get_auto_transition(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_clips(&self) -> Vec<Clip> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_layer_get_clips(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_clips_in_interval(&self, start: gst::ClockTime, end: gst::ClockTime) -> Vec<Clip> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_layer_get_clips_in_interval(self.to_glib_none().0, start.to_glib(), end.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_layer_get_duration(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_priority(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::ges_layer_get_priority(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_timeline(&self) -> Option<Timeline> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_layer_get_timeline(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_layer_is_empty(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_layer_remove_clip(self.to_glib_none().0, clip.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_auto_transition(&self, auto_transition: bool) {
|
||||
unsafe {
|
||||
ffi::ges_layer_set_auto_transition(self.to_glib_none().0, auto_transition.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_priority(&self, priority: u32) {
|
||||
unsafe {
|
||||
ffi::ges_layer_set_priority(self.to_glib_none().0, priority);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline) {
|
||||
unsafe {
|
||||
ffi::ges_layer_set_timeline(self.to_glib_none().0, timeline.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Clip) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "clip-added",
|
||||
transmute(clip_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Clip) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "clip-removed",
|
||||
transmute(clip_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::auto-transition",
|
||||
transmute(notify_auto_transition_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::priority",
|
||||
transmute(notify_priority_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn clip_added_trampoline<P>(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer)
|
||||
where P: IsA<Layer> {
|
||||
let f: &&(Fn(&P, &Clip) + 'static) = transmute(f);
|
||||
f(&Layer::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(clip))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn clip_removed_trampoline<P>(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer)
|
||||
where P: IsA<Layer> {
|
||||
let f: &&(Fn(&P, &Clip) + 'static) = transmute(f);
|
||||
f(&Layer::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(clip))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_auto_transition_trampoline<P>(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Layer> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Layer::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_priority_trampoline<P>(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Layer> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Layer::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
98
gstreamer-editing-services/src/auto/mod.rs
Normal file
98
gstreamer-editing-services/src/auto/mod.rs
Normal file
|
@ -0,0 +1,98 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod asset;
|
||||
pub use self::asset::Asset;
|
||||
pub use self::asset::AssetExt;
|
||||
|
||||
mod base_effect;
|
||||
pub use self::base_effect::BaseEffect;
|
||||
|
||||
mod clip;
|
||||
pub use self::clip::Clip;
|
||||
pub use self::clip::ClipExt;
|
||||
|
||||
mod container;
|
||||
pub use self::container::Container;
|
||||
pub use self::container::GESContainerExt;
|
||||
|
||||
mod effect;
|
||||
pub use self::effect::Effect;
|
||||
pub use self::effect::EffectExt;
|
||||
|
||||
mod extractable;
|
||||
pub use self::extractable::Extractable;
|
||||
pub use self::extractable::ExtractableExt;
|
||||
|
||||
mod group;
|
||||
pub use self::group::Group;
|
||||
pub use self::group::GroupExt;
|
||||
|
||||
mod layer;
|
||||
pub use self::layer::Layer;
|
||||
pub use self::layer::LayerExt;
|
||||
|
||||
mod pipeline;
|
||||
pub use self::pipeline::Pipeline;
|
||||
pub use self::pipeline::GESPipelineExt;
|
||||
|
||||
mod project;
|
||||
pub use self::project::Project;
|
||||
pub use self::project::ProjectExt;
|
||||
|
||||
mod timeline;
|
||||
pub use self::timeline::Timeline;
|
||||
pub use self::timeline::TimelineExt;
|
||||
|
||||
mod timeline_element;
|
||||
pub use self::timeline_element::TimelineElement;
|
||||
pub use self::timeline_element::TimelineElementExt;
|
||||
|
||||
mod track;
|
||||
pub use self::track::Track;
|
||||
pub use self::track::GESTrackExt;
|
||||
|
||||
mod track_element;
|
||||
pub use self::track_element::TrackElement;
|
||||
pub use self::track_element::TrackElementExt;
|
||||
|
||||
mod uri_clip;
|
||||
pub use self::uri_clip::UriClip;
|
||||
pub use self::uri_clip::UriClipExt;
|
||||
|
||||
mod uri_clip_asset;
|
||||
pub use self::uri_clip_asset::UriClipAsset;
|
||||
pub use self::uri_clip_asset::UriClipAssetExt;
|
||||
|
||||
mod uri_source_asset;
|
||||
pub use self::uri_source_asset::UriSourceAsset;
|
||||
pub use self::uri_source_asset::UriSourceAssetExt;
|
||||
|
||||
mod enums;
|
||||
pub use self::enums::Edge;
|
||||
pub use self::enums::EditMode;
|
||||
|
||||
mod flags;
|
||||
pub use self::flags::PipelineFlags;
|
||||
pub use self::flags::TrackType;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
pub use super::AssetExt;
|
||||
pub use super::ClipExt;
|
||||
pub use super::GESContainerExt;
|
||||
pub use super::EffectExt;
|
||||
pub use super::ExtractableExt;
|
||||
pub use super::GroupExt;
|
||||
pub use super::LayerExt;
|
||||
pub use super::GESPipelineExt;
|
||||
pub use super::ProjectExt;
|
||||
pub use super::TimelineExt;
|
||||
pub use super::TimelineElementExt;
|
||||
pub use super::GESTrackExt;
|
||||
pub use super::TrackElementExt;
|
||||
pub use super::UriClipExt;
|
||||
pub use super::UriClipAssetExt;
|
||||
pub use super::UriSourceAssetExt;
|
||||
}
|
324
gstreamer-editing-services/src/auto/pipeline.rs
Normal file
324
gstreamer-editing-services/src/auto/pipeline.rs
Normal file
|
@ -0,0 +1,324 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use PipelineFlags;
|
||||
use Timeline;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use gst_pbutils;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Pipeline(Object<ffi::GESPipeline, ffi::GESPipelineClass>): [
|
||||
gst::Pipeline => gst_ffi::GstPipeline,
|
||||
gst::Element => gst_ffi::GstElement,
|
||||
gst::Object => gst_ffi::GstObject,
|
||||
];
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_pipeline_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Pipeline {
|
||||
pub fn new() -> Pipeline {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_pipeline_new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Pipeline {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GESPipelineExt {
|
||||
fn get_mode(&self) -> PipelineFlags;
|
||||
|
||||
fn get_thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample>;
|
||||
|
||||
fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample>;
|
||||
|
||||
fn preview_get_audio_sink(&self) -> Option<gst::Element>;
|
||||
|
||||
fn preview_get_video_sink(&self) -> Option<gst::Element>;
|
||||
|
||||
fn preview_set_audio_sink<P: IsA<gst::Element>>(&self, sink: &P);
|
||||
|
||||
fn preview_set_video_sink<P: IsA<gst::Element>>(&self, sink: &P);
|
||||
|
||||
fn save_thumbnail(&self, width: i32, height: i32, format: &str, location: &str) -> Result<(), Error>;
|
||||
|
||||
fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(&self, output_uri: &str, profile: &P) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline) -> bool;
|
||||
|
||||
fn get_property_audio_filter(&self) -> Option<gst::Element>;
|
||||
|
||||
fn set_property_audio_filter<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, audio_filter: Option<&P>);
|
||||
|
||||
fn get_property_audio_sink(&self) -> Option<gst::Element>;
|
||||
|
||||
fn set_property_audio_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, audio_sink: Option<&P>);
|
||||
|
||||
fn get_property_timeline(&self) -> Option<Timeline>;
|
||||
|
||||
fn get_property_video_filter(&self) -> Option<gst::Element>;
|
||||
|
||||
fn set_property_video_filter<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_filter: Option<&P>);
|
||||
|
||||
fn get_property_video_sink(&self) -> Option<gst::Element>;
|
||||
|
||||
fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>);
|
||||
|
||||
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Pipeline> + IsA<glib::object::Object>> GESPipelineExt for O {
|
||||
fn get_mode(&self) -> PipelineFlags {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_pipeline_get_mode(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_pipeline_get_thumbnail(self.to_glib_none().0, caps.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_pipeline_get_thumbnail_rgb24(self.to_glib_none().0, width, height))
|
||||
}
|
||||
}
|
||||
|
||||
fn preview_get_audio_sink(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_pipeline_preview_get_audio_sink(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn preview_get_video_sink(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_pipeline_preview_get_video_sink(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn preview_set_audio_sink<P: IsA<gst::Element>>(&self, sink: &P) {
|
||||
unsafe {
|
||||
ffi::ges_pipeline_preview_set_audio_sink(self.to_glib_none().0, sink.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn preview_set_video_sink<P: IsA<gst::Element>>(&self, sink: &P) {
|
||||
unsafe {
|
||||
ffi::ges_pipeline_preview_set_video_sink(self.to_glib_none().0, sink.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn save_thumbnail(&self, width: i32, height: i32, format: &str, location: &str) -> Result<(), Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ges_pipeline_save_thumbnail(self.to_glib_none().0, width, height, format.to_glib_none().0, location.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_pipeline_set_mode(self.to_glib_none().0, mode.to_glib()), "Failed to set mode")
|
||||
}
|
||||
}
|
||||
|
||||
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(&self, output_uri: &str, profile: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_pipeline_set_render_settings(self.to_glib_none().0, output_uri.to_glib_none().0, profile.to_glib_none().0), "Failed to set render settings")
|
||||
}
|
||||
}
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_pipeline_set_timeline(self.to_glib_none().0, timeline.to_glib_full()))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_audio_filter(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "audio-filter".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_audio_filter<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, audio_filter: Option<&P>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "audio-filter".to_glib_none().0, Value::from(audio_filter).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_audio_sink(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "audio-sink".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_audio_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, audio_sink: Option<&P>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "audio-sink".to_glib_none().0, Value::from(audio_sink).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_timeline(&self) -> Option<Timeline> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<Timeline as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "timeline".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_video_filter(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-filter".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_video_filter<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_filter: Option<&P>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-filter".to_glib_none().0, Value::from(video_filter).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_video_sink(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-sink".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-sink".to_glib_none().0, Value::from(video_sink).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::audio-filter",
|
||||
transmute(notify_audio_filter_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::audio-sink",
|
||||
transmute(notify_audio_sink_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::mode",
|
||||
transmute(notify_mode_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::timeline",
|
||||
transmute(notify_timeline_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::video-filter",
|
||||
transmute(notify_video_filter_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::video-sink",
|
||||
transmute(notify_video_sink_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_audio_filter_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Pipeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Pipeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_audio_sink_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Pipeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Pipeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_mode_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Pipeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Pipeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_timeline_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Pipeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Pipeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_video_filter_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Pipeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Pipeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_video_sink_trampoline<P>(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Pipeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Pipeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
265
gstreamer-editing-services/src/auto/project.rs
Normal file
265
gstreamer-editing-services/src/auto/project.rs
Normal file
|
@ -0,0 +1,265 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use Error;
|
||||
use Timeline;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst_pbutils;
|
||||
use libc;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Project(Object<ffi::GESProject, ffi::GESProjectClass>): Asset;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_project_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Project {
|
||||
pub fn new<'a, P: Into<Option<&'a str>>>(uri: P) -> Project {
|
||||
assert_initialized_main_thread!();
|
||||
let uri = uri.into();
|
||||
let uri = uri.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_project_new(uri.0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ProjectExt {
|
||||
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
|
||||
|
||||
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> bool;
|
||||
|
||||
fn create_asset<'a, P: Into<Option<&'a str>>>(&self, id: P, extractable_type: glib::types::Type) -> bool;
|
||||
|
||||
fn create_asset_sync<'a, P: Into<Option<&'a str>>>(&self, id: P, extractable_type: glib::types::Type) -> Result<Option<Asset>, Error>;
|
||||
|
||||
fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option<Asset>;
|
||||
|
||||
fn get_loading_assets(&self) -> Vec<Asset>;
|
||||
|
||||
fn get_uri(&self) -> Option<String>;
|
||||
|
||||
fn list_assets(&self, filter: glib::types::Type) -> Vec<Asset>;
|
||||
|
||||
fn list_encoding_profiles(&self) -> Vec<gst_pbutils::EncodingProfile>;
|
||||
|
||||
fn load(&self, timeline: &Timeline) -> Result<(), Error>;
|
||||
|
||||
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
|
||||
|
||||
fn save<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, timeline: &Timeline, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error>;
|
||||
|
||||
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<String> + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Project> + IsA<glib::object::Object>> ProjectExt for O {
|
||||
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_project_add_asset(self.to_glib_none().0, asset.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_project_add_encoding_profile(self.to_glib_none().0, profile.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn create_asset<'a, P: Into<Option<&'a str>>>(&self, id: P, extractable_type: glib::types::Type) -> bool {
|
||||
let id = id.into();
|
||||
let id = id.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::ges_project_create_asset(self.to_glib_none().0, id.0, extractable_type.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn create_asset_sync<'a, P: Into<Option<&'a str>>>(&self, id: P, extractable_type: glib::types::Type) -> Result<Option<Asset>, Error> {
|
||||
let id = id.into();
|
||||
let id = id.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ges_project_create_asset_sync(self.to_glib_none().0, id.0, extractable_type.to_glib(), &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option<Asset> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_project_get_asset(self.to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_loading_assets(&self) -> Vec<Asset> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_project_get_loading_assets(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uri(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_project_get_uri(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn list_assets(&self, filter: glib::types::Type) -> Vec<Asset> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_project_list_assets(self.to_glib_none().0, filter.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn list_encoding_profiles(&self) -> Vec<gst_pbutils::EncodingProfile> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::ges_project_list_encoding_profiles(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn load(&self, timeline: &Timeline) -> Result<(), Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ges_project_load(self.to_glib_none().0, timeline.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_project_remove_asset(self.to_glib_none().0, asset.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn save<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, timeline: &Timeline, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error> {
|
||||
let formatter_asset = formatter_asset.into();
|
||||
let formatter_asset = formatter_asset.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ges_project_save(self.to_glib_none().0, timeline.to_glib_none().0, uri.to_glib_none().0, formatter_asset.0, overwrite.to_glib(), &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Asset) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "asset-added",
|
||||
transmute(asset_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Asset) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "asset-loading",
|
||||
transmute(asset_loading_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Asset) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "asset-removed",
|
||||
transmute(asset_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Error, &str, glib::types::Type) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "error-loading-asset",
|
||||
transmute(error_loading_asset_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Timeline) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "loaded",
|
||||
transmute(loaded_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<String> + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Error, &Asset) -> Option<String> + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "missing-uri",
|
||||
transmute(missing_uri_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::uri",
|
||||
transmute(notify_uri_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn asset_added_trampoline<P>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer)
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P, &Asset) + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(asset))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn asset_loading_trampoline<P>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer)
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P, &Asset) + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(asset))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn asset_removed_trampoline<P>(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer)
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P, &Asset) + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(asset))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn error_loading_asset_trampoline<P>(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, id: *mut libc::c_char, extractable_type: glib_ffi::GType, f: glib_ffi::gpointer)
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P, &Error, &str, glib::types::Type) + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(error), &String::from_glib_none(id), from_glib(extractable_type))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn loaded_trampoline<P>(this: *mut ffi::GESProject, timeline: *mut ffi::GESTimeline, f: glib_ffi::gpointer)
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P, &Timeline) + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(timeline))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn missing_uri_trampoline<P>(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, wrong_asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) -> *mut libc::c_char
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P, &Error, &Asset) -> Option<String> + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(error), &from_glib_borrow(wrong_asset)).to_glib_full()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_uri_trampoline<P>(this: *mut ffi::GESProject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Project> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Project::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
460
gstreamer-editing-services/src/auto/timeline.rs
Normal file
460
gstreamer-editing-services/src/auto/timeline.rs
Normal file
|
@ -0,0 +1,460 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use Error;
|
||||
use Extractable;
|
||||
use Group;
|
||||
use Layer;
|
||||
use TimelineElement;
|
||||
use Track;
|
||||
use TrackElement;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Timeline(Object<ffi::GESTimeline, ffi::GESTimelineClass>): [
|
||||
gst::Element => gst_ffi::GstElement,
|
||||
gst::Object => gst_ffi::GstObject,
|
||||
Extractable,
|
||||
];
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_timeline_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Timeline {
|
||||
pub fn new() -> Timeline {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_new())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_audio_video() -> Timeline {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_new_audio_video())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_from_uri(uri: &str) -> Result<Option<Timeline>, Error> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ges_timeline_new_from_uri(uri.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Timeline {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TimelineExt {
|
||||
fn add_layer(&self, layer: &Layer) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn append_layer(&self) -> Layer;
|
||||
|
||||
fn commit(&self) -> bool;
|
||||
|
||||
fn commit_sync(&self) -> bool;
|
||||
|
||||
fn get_auto_transition(&self) -> bool;
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_element(&self, name: &str) -> Option<TimelineElement>;
|
||||
|
||||
fn get_groups(&self) -> Vec<Group>;
|
||||
|
||||
fn get_layer(&self, priority: u32) -> Option<Layer>;
|
||||
|
||||
fn get_layers(&self) -> Vec<Layer>;
|
||||
|
||||
fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<gst::Pad>;
|
||||
|
||||
fn get_snapping_distance(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_track_for_pad<P: IsA<gst::Pad>>(&self, pad: &P) -> Option<Track>;
|
||||
|
||||
fn get_tracks(&self) -> Vec<Track>;
|
||||
|
||||
fn is_empty(&self) -> bool;
|
||||
|
||||
fn load_from_uri(&self, uri: &str) -> Result<(), Error>;
|
||||
|
||||
fn move_layer(&self, layer: &Layer, new_layer_priority: u32) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn paste_element<P: IsA<TimelineElement>>(&self, element: &P, position: gst::ClockTime, layer_priority: i32) -> Option<TimelineElement>;
|
||||
|
||||
fn remove_layer(&self, layer: &Layer) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn remove_track<P: IsA<Track>>(&self, track: &P) -> bool;
|
||||
|
||||
fn save_to_uri<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error>;
|
||||
|
||||
fn set_auto_transition(&self, auto_transition: bool);
|
||||
|
||||
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime);
|
||||
|
||||
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
//fn connect_group_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
//fn connect_select_tracks_for_object<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Timeline> + IsA<glib::object::Object>> TimelineExt for O {
|
||||
fn add_layer(&self, layer: &Layer) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_timeline_add_layer(self.to_glib_none().0, layer.to_glib_none().0), "Failed to add layer")
|
||||
}
|
||||
}
|
||||
|
||||
fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_timeline_add_track(self.to_glib_none().0, track.to_glib_full()), "Failed to add track")
|
||||
}
|
||||
}
|
||||
|
||||
fn append_layer(&self) -> Layer {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_append_layer(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn commit(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_commit(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn commit_sync(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_commit_sync(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_auto_transition(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_get_auto_transition(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_get_duration(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_element(&self, name: &str) -> Option<TimelineElement> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_timeline_get_element(self.to_glib_none().0, name.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_groups(&self) -> Vec<Group> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::ges_timeline_get_groups(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_layer(&self, priority: u32) -> Option<Layer> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_timeline_get_layer(self.to_glib_none().0, priority))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_layers(&self) -> Vec<Layer> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_layers(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<gst::Pad> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_get_pad_for_track(self.to_glib_none().0, track.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_snapping_distance(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_get_snapping_distance(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_track_for_pad<P: IsA<gst::Pad>>(&self, pad: &P) -> Option<Track> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_get_track_for_pad(self.to_glib_none().0, pad.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tracks(&self) -> Vec<Track> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_tracks(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_is_empty(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn load_from_uri(&self, uri: &str) -> Result<(), Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ges_timeline_load_from_uri(self.to_glib_none().0, uri.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn move_layer(&self, layer: &Layer, new_layer_priority: u32) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_timeline_move_layer(self.to_glib_none().0, layer.to_glib_none().0, new_layer_priority), "Failed to move layer")
|
||||
}
|
||||
}
|
||||
|
||||
fn paste_element<P: IsA<TimelineElement>>(&self, element: &P, position: gst::ClockTime, layer_priority: i32) -> Option<TimelineElement> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_paste_element(self.to_glib_none().0, element.to_glib_none().0, position.to_glib(), layer_priority))
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_layer(&self, layer: &Layer) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_timeline_remove_layer(self.to_glib_none().0, layer.to_glib_none().0), "Failed to remove layer")
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_track<P: IsA<Track>>(&self, track: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_remove_track(self.to_glib_none().0, track.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn save_to_uri<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error> {
|
||||
let formatter_asset = formatter_asset.into();
|
||||
let formatter_asset = formatter_asset.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ges_timeline_save_to_uri(self.to_glib_none().0, uri.to_glib_none().0, formatter_asset.0, overwrite.to_glib(), &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn set_auto_transition(&self, auto_transition: bool) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_set_auto_transition(self.to_glib_none().0, auto_transition.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_set_snapping_distance(self.to_glib_none().0, snapping_distance.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "commited",
|
||||
transmute(commited_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Group) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "group-added",
|
||||
transmute(group_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
//fn connect_group_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
||||
// Empty ctype children: *.PtrArray TypeId { ns_id: 1, id: 51 }
|
||||
//}
|
||||
|
||||
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Layer) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "layer-added",
|
||||
transmute(layer_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Layer) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "layer-removed",
|
||||
transmute(layer_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
//fn connect_select_tracks_for_object<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
||||
// Empty ctype return value *.PtrArray TypeId { ns_id: 1, id: 16 }
|
||||
//}
|
||||
|
||||
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "snapping-ended",
|
||||
transmute(snapping_ended_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "snapping-started",
|
||||
transmute(snapping_started_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Track) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "track-added",
|
||||
transmute(track_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Track) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "track-removed",
|
||||
transmute(track_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::auto-transition",
|
||||
transmute(notify_auto_transition_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::duration",
|
||||
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::snapping-distance",
|
||||
transmute(notify_snapping_distance_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn commited_trampoline<P>(this: *mut ffi::GESTimeline, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn group_added_trampoline<P>(this: *mut ffi::GESTimeline, group: *mut ffi::GESGroup, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &Group) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(group))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn layer_added_trampoline<P>(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &Layer) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(layer))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn layer_removed_trampoline<P>(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &Layer) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(layer))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn snapping_ended_trampoline<P>(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &TrackElement, &TrackElement, u64) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object), &from_glib_borrow(p0), p1)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn snapping_started_trampoline<P>(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &TrackElement, &TrackElement, u64) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object), &from_glib_borrow(p0), p1)
|
||||
}
|
||||
|
||||
unsafe extern "C" fn track_added_trampoline<P>(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &Track) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(track))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn track_removed_trampoline<P>(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P, &Track) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(track))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_auto_transition_trampoline<P>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_snapping_distance_trampoline<P>(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Timeline> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Timeline::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
495
gstreamer-editing-services/src/auto/timeline_element.rs
Normal file
495
gstreamer-editing-services/src/auto/timeline_element.rs
Normal file
|
@ -0,0 +1,495 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Extractable;
|
||||
use Timeline;
|
||||
use TrackType;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct TimelineElement(Object<ffi::GESTimelineElement, ffi::GESTimelineElementClass>): Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_timeline_element_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TimelineElementExt {
|
||||
//fn add_child_property<P: IsA</*Ignored*/glib::ParamSpec>, Q: IsA<glib::Object>>(&self, pspec: &P, child: &Q) -> bool;
|
||||
|
||||
fn copy(&self, deep: bool) -> Option<TimelineElement>;
|
||||
|
||||
//fn get_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
|
||||
|
||||
//fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool;
|
||||
|
||||
//fn get_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/glib::Value);
|
||||
|
||||
//fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported);
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_inpoint(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_max_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_name(&self) -> Option<String>;
|
||||
|
||||
fn get_parent(&self) -> Option<TimelineElement>;
|
||||
|
||||
fn get_priority(&self) -> u32;
|
||||
|
||||
fn get_start(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_timeline(&self) -> Option<Timeline>;
|
||||
|
||||
fn get_toplevel_parent(&self) -> Option<TimelineElement>;
|
||||
|
||||
fn get_track_types(&self) -> TrackType;
|
||||
|
||||
//fn list_children_properties(&self) -> /*Ignored*/Vec<glib::ParamSpec>;
|
||||
|
||||
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<glib::Object>;
|
||||
|
||||
fn paste(&self, paste_position: gst::ClockTime) -> Option<TimelineElement>;
|
||||
|
||||
//fn remove_child_property<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P) -> bool;
|
||||
|
||||
fn ripple(&self, start: gst::ClockTime) -> bool;
|
||||
|
||||
fn ripple_end(&self, end: gst::ClockTime) -> bool;
|
||||
|
||||
fn roll_end(&self, end: gst::ClockTime) -> bool;
|
||||
|
||||
fn roll_start(&self, start: gst::ClockTime) -> bool;
|
||||
|
||||
//fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
|
||||
|
||||
//fn set_child_property(&self, property_name: &str, value: /*Ignored*/&mut glib::Value) -> bool;
|
||||
|
||||
//fn set_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/&mut glib::Value);
|
||||
|
||||
//fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported);
|
||||
|
||||
fn set_duration(&self, duration: gst::ClockTime);
|
||||
|
||||
fn set_inpoint(&self, inpoint: gst::ClockTime);
|
||||
|
||||
fn set_max_duration(&self, maxduration: gst::ClockTime);
|
||||
|
||||
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> bool;
|
||||
|
||||
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> bool;
|
||||
|
||||
fn set_priority(&self, priority: u32);
|
||||
|
||||
fn set_start(&self, start: gst::ClockTime);
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline) -> bool;
|
||||
|
||||
fn trim(&self, start: gst::ClockTime) -> bool;
|
||||
|
||||
fn get_property_in_point(&self) -> u64;
|
||||
|
||||
fn set_property_in_point(&self, in_point: u64);
|
||||
|
||||
fn get_property_serialize(&self) -> bool;
|
||||
|
||||
fn set_property_serialize(&self, serialize: bool);
|
||||
|
||||
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_serialize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<TimelineElement> + IsA<glib::object::Object>> TimelineElementExt for O {
|
||||
//fn add_child_property<P: IsA</*Ignored*/glib::ParamSpec>, Q: IsA<glib::Object>>(&self, pspec: &P, child: &Q) -> bool {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_add_child_property() }
|
||||
//}
|
||||
|
||||
fn copy(&self, deep: bool) -> Option<TimelineElement> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_element_copy(self.to_glib_none().0, deep.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_get_child_properties() }
|
||||
//}
|
||||
|
||||
//fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_get_child_property() }
|
||||
//}
|
||||
|
||||
//fn get_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/glib::Value) {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_get_child_property_by_pspec() }
|
||||
//}
|
||||
|
||||
//fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_get_child_property_valist() }
|
||||
//}
|
||||
|
||||
fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_get_duration(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_inpoint(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_get_inpoint(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_max_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_get_max_duration(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_name(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_timeline_element_get_name(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_parent(&self) -> Option<TimelineElement> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_timeline_element_get_parent(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_priority(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::ges_timeline_element_get_priority(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_start(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_get_start(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_timeline(&self) -> Option<Timeline> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_timeline_element_get_timeline(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_toplevel_parent(&self) -> Option<TimelineElement> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ges_timeline_element_get_toplevel_parent(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_track_types(&self) -> TrackType {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_get_track_types(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn list_children_properties(&self) -> /*Ignored*/Vec<glib::ParamSpec> {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_list_children_properties() }
|
||||
//}
|
||||
|
||||
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<glib::Object> {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_lookup_child() }
|
||||
//}
|
||||
|
||||
fn paste(&self, paste_position: gst::ClockTime) -> Option<TimelineElement> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_timeline_element_paste(self.to_glib_none().0, paste_position.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
//fn remove_child_property<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P) -> bool {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_remove_child_property() }
|
||||
//}
|
||||
|
||||
fn ripple(&self, start: gst::ClockTime) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_ripple(self.to_glib_none().0, start.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn ripple_end(&self, end: gst::ClockTime) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_ripple_end(self.to_glib_none().0, end.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn roll_end(&self, end: gst::ClockTime) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_roll_end(self.to_glib_none().0, end.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn roll_start(&self, start: gst::ClockTime) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_roll_start(self.to_glib_none().0, start.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
//fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_set_child_properties() }
|
||||
//}
|
||||
|
||||
//fn set_child_property(&self, property_name: &str, value: /*Ignored*/&mut glib::Value) -> bool {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_set_child_property() }
|
||||
//}
|
||||
|
||||
//fn set_child_property_by_pspec<P: IsA</*Ignored*/glib::ParamSpec>>(&self, pspec: &P, value: /*Ignored*/&mut glib::Value) {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_set_child_property_by_pspec() }
|
||||
//}
|
||||
|
||||
//fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
|
||||
// unsafe { TODO: call ffi::ges_timeline_element_set_child_property_valist() }
|
||||
//}
|
||||
|
||||
fn set_duration(&self, duration: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_element_set_duration(self.to_glib_none().0, duration.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_inpoint(&self, inpoint: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_element_set_inpoint(self.to_glib_none().0, inpoint.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_max_duration(&self, maxduration: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_element_set_max_duration(self.to_glib_none().0, maxduration.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> bool {
|
||||
let name = name.into();
|
||||
let name = name.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_set_name(self.to_glib_none().0, name.0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_set_parent(self.to_glib_none().0, parent.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_priority(&self, priority: u32) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_element_set_priority(self.to_glib_none().0, priority);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_start(&self, start: gst::ClockTime) {
|
||||
unsafe {
|
||||
ffi::ges_timeline_element_set_start(self.to_glib_none().0, start.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_set_timeline(self.to_glib_none().0, timeline.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn trim(&self, start: gst::ClockTime) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_timeline_element_trim(self.to_glib_none().0, start.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_in_point(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "in-point".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_in_point(&self, in_point: u64) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "in-point".to_glib_none().0, Value::from(&in_point).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_serialize(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "serialize".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_serialize(&self, serialize: bool) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "serialize".to_glib_none().0, Value::from(&serialize).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
||||
// Ignored prop: GObject.ParamSpec
|
||||
//}
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::duration",
|
||||
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::in-point",
|
||||
transmute(notify_in_point_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::max-duration",
|
||||
transmute(notify_max_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::name",
|
||||
transmute(notify_name_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::parent",
|
||||
transmute(notify_parent_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::priority",
|
||||
transmute(notify_priority_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_serialize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::serialize",
|
||||
transmute(notify_serialize_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::start",
|
||||
transmute(notify_start_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::timeline",
|
||||
transmute(notify_timeline_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_in_point_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_max_duration_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_name_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_parent_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_priority_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_serialize_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_start_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_timeline_trampoline<P>(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TimelineElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TimelineElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
300
gstreamer-editing-services/src/auto/track.rs
Normal file
300
gstreamer-editing-services/src/auto/track.rs
Normal file
|
@ -0,0 +1,300 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Timeline;
|
||||
use TrackElement;
|
||||
use TrackType;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use gst_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Track(Object<ffi::GESTrack, ffi::GESTrackClass>): [
|
||||
gst::Element => gst_ffi::GstElement,
|
||||
gst::Object => gst_ffi::GstObject,
|
||||
];
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_track_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Track {
|
||||
pub fn new(type_: TrackType, caps: &gst::Caps) -> Track {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_new(type_.to_glib(), caps.to_glib_full()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GESTrackExt {
|
||||
fn add_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn commit(&self) -> bool;
|
||||
|
||||
fn get_caps(&self) -> Option<gst::Caps>;
|
||||
|
||||
fn get_elements(&self) -> Vec<TrackElement>;
|
||||
|
||||
fn get_mixing(&self) -> bool;
|
||||
|
||||
fn get_timeline(&self) -> Option<Timeline>;
|
||||
|
||||
fn remove_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
//fn set_create_element_for_gap_func(&self, func: /*Unknown conversion*//*Unimplemented*/CreateElementForGapFunc);
|
||||
|
||||
fn set_mixing(&self, mixing: bool);
|
||||
|
||||
fn set_restriction_caps(&self, caps: &gst::Caps);
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline);
|
||||
|
||||
fn update_restriction_caps(&self, caps: &gst::Caps);
|
||||
|
||||
fn get_property_duration(&self) -> u64;
|
||||
|
||||
fn get_property_restriction_caps(&self) -> Option<gst::Caps>;
|
||||
|
||||
fn get_property_track_type(&self) -> TrackType;
|
||||
|
||||
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Track> + IsA<glib::object::Object>> GESTrackExt for O {
|
||||
fn add_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_track_add_element(self.to_glib_none().0, object.to_glib_none().0), "Failed to add element")
|
||||
}
|
||||
}
|
||||
|
||||
fn commit(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_commit(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_caps(&self) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_get_caps(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_elements(&self) -> Vec<TrackElement> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ges_track_get_elements(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_mixing(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_get_mixing(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_timeline(&self) -> Option<Timeline> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_get_timeline(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib::error::BoolError::from_glib(ffi::ges_track_remove_element(self.to_glib_none().0, object.to_glib_none().0), "Failed to remove element")
|
||||
}
|
||||
}
|
||||
|
||||
//fn set_create_element_for_gap_func(&self, func: /*Unknown conversion*//*Unimplemented*/CreateElementForGapFunc) {
|
||||
// unsafe { TODO: call ffi::ges_track_set_create_element_for_gap_func() }
|
||||
//}
|
||||
|
||||
fn set_mixing(&self, mixing: bool) {
|
||||
unsafe {
|
||||
ffi::ges_track_set_mixing(self.to_glib_none().0, mixing.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_restriction_caps(&self, caps: &gst::Caps) {
|
||||
unsafe {
|
||||
ffi::ges_track_set_restriction_caps(self.to_glib_none().0, caps.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_timeline(&self, timeline: &Timeline) {
|
||||
unsafe {
|
||||
ffi::ges_track_set_timeline(self.to_glib_none().0, timeline.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn update_restriction_caps(&self, caps: &gst::Caps) {
|
||||
unsafe {
|
||||
ffi::ges_track_update_restriction_caps(self.to_glib_none().0, caps.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_duration(&self) -> u64 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "duration".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_restriction_caps(&self) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gst::Caps as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "restriction-caps".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get()
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_track_type(&self) -> TrackType {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<TrackType as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "track-type".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "commited",
|
||||
transmute(commited_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &TrackElement) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "track-element-added",
|
||||
transmute(track_element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &TrackElement) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "track-element-removed",
|
||||
transmute(track_element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::caps",
|
||||
transmute(notify_caps_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::duration",
|
||||
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::mixing",
|
||||
transmute(notify_mixing_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::restriction-caps",
|
||||
transmute(notify_restriction_caps_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::track-type",
|
||||
transmute(notify_track_type_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn commited_trampoline<P>(this: *mut ffi::GESTrack, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn track_element_added_trampoline<P>(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P, &TrackElement) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(effect))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn track_element_removed_trampoline<P>(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P, &TrackElement) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(effect))
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_caps_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_mixing_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_restriction_caps_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_track_type_trampoline<P>(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<Track> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&Track::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
221
gstreamer-editing-services/src/auto/track_element.rs
Normal file
221
gstreamer-editing-services/src/auto/track_element.rs
Normal file
|
@ -0,0 +1,221 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Edge;
|
||||
use EditMode;
|
||||
use Extractable;
|
||||
use Layer;
|
||||
use TimelineElement;
|
||||
use Track;
|
||||
use TrackType;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct TrackElement(Object<ffi::GESTrackElement, ffi::GESTrackElementClass>): TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_track_element_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TrackElementExt {
|
||||
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]);
|
||||
|
||||
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool;
|
||||
|
||||
//fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 };
|
||||
|
||||
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<gst::ControlBinding>;
|
||||
|
||||
fn get_element(&self) -> Option<gst::Element>;
|
||||
|
||||
fn get_gnlobject(&self) -> Option<gst::Element>;
|
||||
|
||||
fn get_nleobject(&self) -> Option<gst::Element>;
|
||||
|
||||
fn get_track(&self) -> Option<Track>;
|
||||
|
||||
fn get_track_type(&self) -> TrackType;
|
||||
|
||||
fn is_active(&self) -> bool;
|
||||
|
||||
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<gst::Element>;
|
||||
|
||||
fn remove_control_binding(&self, property_name: &str) -> bool;
|
||||
|
||||
fn set_active(&self, active: bool) -> bool;
|
||||
|
||||
//fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool;
|
||||
|
||||
fn set_track_type(&self, type_: TrackType);
|
||||
|
||||
fn get_property_active(&self) -> bool;
|
||||
|
||||
//fn connect_control_binding_added<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
//fn connect_control_binding_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<TrackElement> + IsA<glib::object::Object>> TrackElementExt for O {
|
||||
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]) {
|
||||
unsafe {
|
||||
ffi::ges_track_element_add_children_props(self.to_glib_none().0, element.to_glib_none().0, wanted_categories.to_glib_none().0, blacklist.to_glib_none().0, whitelist.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_element_edit(self.to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), edge.to_glib(), position))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 } {
|
||||
// unsafe { TODO: call ffi::ges_track_element_get_all_control_bindings() }
|
||||
//}
|
||||
|
||||
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<gst::ControlBinding> {
|
||||
// unsafe { TODO: call ffi::ges_track_element_get_control_binding() }
|
||||
//}
|
||||
|
||||
fn get_element(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_element_get_element(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_gnlobject(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_element_get_gnlobject(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_nleobject(&self) -> Option<gst::Element> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_element_get_nleobject(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_track(&self) -> Option<Track> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_track_element_get_track(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_track_type(&self) -> TrackType {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_element_get_track_type(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_active(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_element_is_active(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<gst::Element> {
|
||||
// unsafe { TODO: call ffi::ges_track_element_lookup_child() }
|
||||
//}
|
||||
|
||||
fn remove_control_binding(&self, property_name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_element_remove_control_binding(self.to_glib_none().0, property_name.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_active(&self, active: bool) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_track_element_set_active(self.to_glib_none().0, active.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
//fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool {
|
||||
// unsafe { TODO: call ffi::ges_track_element_set_control_source() }
|
||||
//}
|
||||
|
||||
fn set_track_type(&self, type_: TrackType) {
|
||||
unsafe {
|
||||
ffi::ges_track_element_set_track_type(self.to_glib_none().0, type_.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_active(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "active".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
//fn connect_control_binding_added<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
||||
// Ignored control_binding: Gst.ControlBinding
|
||||
//}
|
||||
|
||||
//fn connect_control_binding_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
||||
// Ignored control_binding: Gst.ControlBinding
|
||||
//}
|
||||
|
||||
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::active",
|
||||
transmute(notify_active_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::track",
|
||||
transmute(notify_track_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::track-type",
|
||||
transmute(notify_track_type_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_active_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TrackElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TrackElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_track_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TrackElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TrackElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_track_type_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<TrackElement> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&TrackElement::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
168
gstreamer-editing-services/src/auto/uri_clip.rs
Normal file
168
gstreamer-editing-services/src/auto/uri_clip.rs
Normal file
|
@ -0,0 +1,168 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Clip;
|
||||
use Container;
|
||||
use Extractable;
|
||||
use TimelineElement;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct UriClip(Object<ffi::GESUriClip, ffi::GESUriClipClass>): Clip, Container, TimelineElement, Extractable;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_uri_clip_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl UriClip {
|
||||
pub fn new(uri: &str) -> UriClip {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_uri_clip_new(uri.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait UriClipExt {
|
||||
fn get_uri(&self) -> Option<String>;
|
||||
|
||||
fn is_image(&self) -> bool;
|
||||
|
||||
fn is_muted(&self) -> bool;
|
||||
|
||||
fn set_is_image(&self, is_image: bool);
|
||||
|
||||
fn set_mute(&self, mute: bool);
|
||||
|
||||
fn get_property_is_image(&self) -> bool;
|
||||
|
||||
fn get_property_mute(&self) -> bool;
|
||||
|
||||
fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<UriClip> + IsA<glib::object::Object>> UriClipExt for O {
|
||||
fn get_uri(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_uri_clip_get_uri(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_image(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_uri_clip_is_image(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_muted(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_uri_clip_is_muted(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_is_image(&self, is_image: bool) {
|
||||
unsafe {
|
||||
ffi::ges_uri_clip_set_is_image(self.to_glib_none().0, is_image.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_mute(&self, mute: bool) {
|
||||
unsafe {
|
||||
ffi::ges_uri_clip_set_mute(self.to_glib_none().0, mute.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_is_image(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "is-image".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_mute(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "mute".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::is-image",
|
||||
transmute(notify_is_image_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::mute",
|
||||
transmute(notify_mute_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::supported-formats",
|
||||
transmute(notify_supported_formats_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_uri_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::uri",
|
||||
transmute(notify_uri_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_is_image_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<UriClip> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&UriClip::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_mute_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<UriClip> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&UriClip::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_supported_formats_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<UriClip> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&UriClip::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_uri_trampoline<P>(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<UriClip> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&UriClip::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
106
gstreamer-editing-services/src/auto/uri_clip_asset.rs
Normal file
106
gstreamer-editing-services/src/auto/uri_clip_asset.rs
Normal file
|
@ -0,0 +1,106 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use Error;
|
||||
use UriSourceAsset;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst;
|
||||
use gst_pbutils;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct UriClipAsset(Object<ffi::GESUriClipAsset, ffi::GESUriClipAssetClass>): Asset;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_uri_clip_asset_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl UriClipAsset {
|
||||
//pub fn new<'a, P: Into<Option<&'a gio::Cancellable>>, Q: /*Unimplemented*/gio::AsyncReadyCallback>(uri: &str, cancellable: P, callback: Q) {
|
||||
// unsafe { TODO: call ffi::ges_uri_clip_asset_new() }
|
||||
//}
|
||||
|
||||
pub fn request_sync(uri: &str) -> Result<Option<UriClipAsset>, Error> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ges_uri_clip_asset_request_sync(uri.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait UriClipAssetExt {
|
||||
fn get_duration(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_info(&self) -> Option<gst_pbutils::DiscovererInfo>;
|
||||
|
||||
fn get_stream_assets(&self) -> Vec<UriSourceAsset>;
|
||||
|
||||
fn is_image(&self) -> bool;
|
||||
|
||||
fn set_property_duration(&self, duration: u64);
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<UriClipAsset> + IsA<glib::object::Object>> UriClipAssetExt for O {
|
||||
fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_uri_clip_asset_get_duration(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_info(&self) -> Option<gst_pbutils::DiscovererInfo> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_uri_clip_asset_get_info(const_override(self.to_glib_none().0)))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_assets(&self) -> Vec<UriSourceAsset> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::ges_uri_clip_asset_get_stream_assets(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_image(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ges_uri_clip_asset_is_image(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_duration(&self, duration: u64) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "duration".to_glib_none().0, Value::from(&duration).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "notify::duration",
|
||||
transmute(notify_duration_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn notify_duration_trampoline<P>(this: *mut ffi::GESUriClipAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
||||
where P: IsA<UriClipAsset> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&UriClipAsset::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
50
gstreamer-editing-services/src/auto/uri_source_asset.rs
Normal file
50
gstreamer-editing-services/src/auto/uri_source_asset.rs
Normal file
|
@ -0,0 +1,50 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Asset;
|
||||
use UriClipAsset;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst_pbutils;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct UriSourceAsset(Object<ffi::GESUriSourceAsset, ffi::GESUriSourceAssetClass>): Asset;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ges_uri_source_asset_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub trait UriSourceAssetExt {
|
||||
fn get_filesource_asset(&self) -> Option<UriClipAsset>;
|
||||
|
||||
fn get_stream_info(&self) -> Option<gst_pbutils::DiscovererStreamInfo>;
|
||||
|
||||
fn get_stream_uri(&self) -> Option<String>;
|
||||
}
|
||||
|
||||
impl<O: IsA<UriSourceAsset>> UriSourceAssetExt for O {
|
||||
fn get_filesource_asset(&self) -> Option<UriClipAsset> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_uri_source_asset_get_filesource_asset(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_info(&self) -> Option<gst_pbutils::DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_uri_source_asset_get_stream_info(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_uri(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ges_uri_source_asset_get_stream_uri(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
2
gstreamer-editing-services/src/auto/versions.txt
Normal file
2
gstreamer-editing-services/src/auto/versions.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ f5fca82)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
90
gstreamer-editing-services/src/lib.rs
Normal file
90
gstreamer-editing-services/src/lib.rs
Normal file
|
@ -0,0 +1,90 @@
|
|||
// Copyright (C) 2018 Thibault Saunier <tsaunier@igalia.com>
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate libc;
|
||||
|
||||
use std::sync::{Once, ONCE_INIT};
|
||||
|
||||
extern crate gio_sys as gio_ffi;
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_base_sys as gst_base_ffi;
|
||||
extern crate gstreamer_editing_services_sys as ffi;
|
||||
extern crate gstreamer_pbutils as gst_pbutils;
|
||||
extern crate gstreamer_pbutils_sys as gst_pbutils_ffi;
|
||||
extern crate gstreamer_sys as gst_ffi;
|
||||
|
||||
use glib::translate::from_glib;
|
||||
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate gio;
|
||||
|
||||
static GES_INIT: Once = ONCE_INIT;
|
||||
|
||||
pub use glib::{
|
||||
BoolError, Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value,
|
||||
};
|
||||
|
||||
pub fn init() -> Result<(), BoolError> {
|
||||
if gst::init().is_err() {
|
||||
return Err(BoolError("Could not initialize GStreamer."));
|
||||
}
|
||||
|
||||
unsafe {
|
||||
if from_glib(ffi::ges_init()) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(BoolError("Could not initialize GES."))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn deinit() {
|
||||
ffi::ges_deinit();
|
||||
}
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
() => {
|
||||
if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE {
|
||||
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||
}
|
||||
::GES_INIT.call_once(|| {
|
||||
unsafe { ::ffi::ges_init() };
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! skip_assert_initialized {
|
||||
() => {};
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
||||
mod timeline_element;
|
||||
pub use timeline_element::TimelineElementExtManual;
|
||||
|
||||
// Re-export all the traits in a prelude module, so that applications
|
||||
// can always "use gst::prelude::*" without getting conflicts
|
||||
pub mod prelude {
|
||||
pub use glib::prelude::*;
|
||||
pub use gst::prelude::*;
|
||||
pub use timeline_element::TimelineElementExtManual;
|
||||
|
||||
pub use auto::traits::*;
|
||||
}
|
66
gstreamer-editing-services/src/timeline_element.rs
Normal file
66
gstreamer-editing-services/src/timeline_element.rs
Normal file
|
@ -0,0 +1,66 @@
|
|||
// Copyright (C) 2018 Thibault Saunier <tsaunier@igalia.com>
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use std::ptr;
|
||||
use TimelineElement;
|
||||
|
||||
pub trait TimelineElementExtManual {
|
||||
fn get_child_property(&self, name: &str) -> Option<glib::Value>;
|
||||
fn set_child_property(&self, name: &str, value: &glib::ToValue) -> Result<(), glib::BoolError>;
|
||||
}
|
||||
|
||||
impl<O: IsA<TimelineElement>> TimelineElementExtManual for O {
|
||||
fn get_child_property(&self, name: &str) -> Option<glib::Value> {
|
||||
unsafe {
|
||||
let found: bool = from_glib(ffi::ges_timeline_element_lookup_child(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
ptr::null_mut(),
|
||||
ptr::null_mut(),
|
||||
));
|
||||
if !found {
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut value = glib::Value::uninitialized();
|
||||
ffi::ges_timeline_element_get_child_property(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
Some(value)
|
||||
}
|
||||
}
|
||||
|
||||
fn set_child_property(&self, name: &str, value: &glib::ToValue) -> Result<(), glib::BoolError> {
|
||||
unsafe {
|
||||
let found: bool = from_glib(ffi::ges_timeline_element_lookup_child(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
ptr::null_mut(),
|
||||
ptr::null_mut(),
|
||||
));
|
||||
if !found {
|
||||
return Err(glib::BoolError("Child property not found"));
|
||||
}
|
||||
|
||||
let value = value.to_value();
|
||||
ffi::ges_timeline_element_set_child_property(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
value.to_glib_none().0,
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,67 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
|
@ -305,18 +366,21 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
|
|||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
|
||||
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
[package]
|
||||
name = "gstreamer-net"
|
||||
version = "0.12.0"
|
||||
version = "0.12.2"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Net library"
|
||||
repository = "https://github.com/sdroege/gstreamer-rs"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_net"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_net"
|
||||
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gstreamer-net-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-net-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
@ -32,6 +32,3 @@ embed-lgpl-docs = ["rustdoc-stripper"]
|
|||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-net-sys/dox", "glib/dox", "gstreamer/dox"]
|
||||
default-features = []
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" }
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-app.svg)](https://crates.io/crates/gstreamer-app) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
|
||||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-net.svg)](https://crates.io/crates/gstreamer-net) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) (Net library) bindings for Rust.
|
||||
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_net/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
@ -14,7 +16,7 @@ API metadata provided by the GStreamer project. Older versions before 0.8.0 were
|
|||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
|
@ -48,7 +50,20 @@ On Debian/Ubuntu they can be installed with
|
|||
$ 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
|
||||
gstreamer1.0-libav libgstrtspserver-1.0-dev
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ apt-get install libgstreamer-plugins-bad1.0-dev
|
||||
```
|
||||
|
||||
Package names on other distributions should be similar.
|
||||
|
@ -64,11 +79,21 @@ provided by the GStreamer project.
|
|||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||
gst-plugins-bad gst-plugins-ugly gst-libav
|
||||
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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
|
@ -79,7 +104,7 @@ After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
@ -96,9 +121,14 @@ the GStreamer project.
|
|||
```
|
||||
$ pacman -S 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-plugins-ugly mingw-w64-x86_64-gst-libav \
|
||||
mingw-w64-x86_64-gst-rtsp-server
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.msi` files for your platform from the
|
||||
|
@ -118,7 +148,7 @@ $ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG
|
|||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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
|
||||
|
@ -134,12 +164,12 @@ 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://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
|
||||
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
|
|
@ -31,7 +31,8 @@ impl NetClientClock {
|
|||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
base_time.to_glib(),
|
||||
)).downcast_unchecked()
|
||||
))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
} else {
|
||||
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
|
||||
|
@ -41,7 +42,8 @@ impl NetClientClock {
|
|||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
base_time.to_glib(),
|
||||
)).downcast_unchecked()
|
||||
))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@ impl NtpClock {
|
|||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
base_time.to_glib(),
|
||||
)).downcast_unchecked()
|
||||
))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
} else {
|
||||
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
|
||||
|
@ -41,7 +42,8 @@ impl NtpClock {
|
|||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
base_time.to_glib(),
|
||||
)).downcast_unchecked()
|
||||
))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,34 +14,21 @@ use glib::translate::*;
|
|||
use gst;
|
||||
|
||||
impl PtpClock {
|
||||
pub fn new<'a, P: Into<Option<&'a str>>>(
|
||||
name: P,
|
||||
remote_address: &str,
|
||||
remote_port: i32,
|
||||
base_time: gst::ClockTime,
|
||||
) -> PtpClock {
|
||||
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, domain: u32) -> PtpClock {
|
||||
assert_initialized_main_thread!();
|
||||
let name = name.into();
|
||||
let name = name.to_glib_none();
|
||||
let (major, minor, _, _) = gst::version();
|
||||
if (major, minor) > (1, 12) {
|
||||
unsafe {
|
||||
gst::Clock::from_glib_full(ffi::gst_ntp_clock_new(
|
||||
name.0,
|
||||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
base_time.to_glib(),
|
||||
)).downcast_unchecked()
|
||||
gst::Clock::from_glib_full(ffi::gst_ptp_clock_new(name.0, domain))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
} else {
|
||||
// Workaround for bad floating reference handling in 1.12. This issue was fixed for 1.13
|
||||
unsafe {
|
||||
gst::Clock::from_glib_none(ffi::gst_ntp_clock_new(
|
||||
name.0,
|
||||
remote_address.to_glib_none().0,
|
||||
remote_port,
|
||||
base_time.to_glib(),
|
||||
)).downcast_unchecked()
|
||||
gst::Clock::from_glib_none(ffi::gst_ptp_clock_new(name.0, domain))
|
||||
.downcast_unchecked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,67 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
|
||||
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
|
||||
|
||||
## [0.12.2] - 2018-11-26
|
||||
### Fixed
|
||||
- PTP clock constructor actually creates a PTP instead of NTP clock
|
||||
|
||||
### Added
|
||||
- Bindings for GStreamer Editing Services
|
||||
- Bindings for GStreamer Check testing library
|
||||
- Bindings for the encoding profile API (encodebin)
|
||||
- VideoFrame, VideoInfo, AudioInfo, StructureRef implements Send and Sync now
|
||||
- VideoFrame has a function to get the raw FFI pointer
|
||||
- From impls from the Error/Success enums to the combined enums like
|
||||
FlowReturn
|
||||
- Bin-to-dot file functions were added to the Bin trait
|
||||
- gst_base::Adapter implements SendUnique now
|
||||
|
||||
### Changed
|
||||
- All references were updated from GitHub to freedesktop.org GitLab
|
||||
- Fix various links in the README.md
|
||||
- Link to the correct location for the documentation
|
||||
- Remove GitLab badge as that only works with gitlab.com currently
|
||||
|
||||
## [0.12.1] - 2018-09-21
|
||||
### Added
|
||||
- More complete bindings for the gst_video::VideoOverlay interface, especially
|
||||
gst_video::is_video_overlay_prepare_window_handle_message()
|
||||
|
||||
## [0.12.0] - 2018-09-08
|
||||
### Added
|
||||
- Bindings for the GStreamer SDP and WebRTC libraries
|
||||
- Generic API for working with tags that is based on string tag names and
|
||||
glib::Value for the tag values
|
||||
- Bindings for Aggregator and AggregatorPad
|
||||
- Bindings for BaseTransform/BaseSrc::get_buffer_pool()
|
||||
- Optional serde implementations for the basic GStreamer data flow and metadata types
|
||||
|
||||
### Changed
|
||||
- Use ptr::NonNull in various places
|
||||
- Updated to muldiv 0.2, num-rational 0.2
|
||||
- Bus::create_watch() can't return None
|
||||
- Remove CallbackGuard as unwinding across FFI boundaries is not undefined
|
||||
behaviour anymore but will directly cause a panic
|
||||
- Changed from the futures to the futures-preview crate as an optional
|
||||
dependency
|
||||
- Various Caps operations take a &CapsRef instead of &Caps
|
||||
- "deep-notify" signal takes the whole ParamSpec as parameter instead of only
|
||||
the signal name
|
||||
- Some structs were changed from empty struct to empty enums
|
||||
- Pad probe code does not take an additional reference to the data anymore,
|
||||
potentially passing writable events/buffers into the probe
|
||||
- ValueExt::compare() is implemented around std::cmp::Ordering now instead of
|
||||
a custom enum that was basically the same
|
||||
|
||||
### Fixed
|
||||
- Pad::add_probe() can return None if an IDLE probe was already called and
|
||||
removed in the meantime
|
||||
- Various compiler and clippy warnings
|
||||
|
||||
### Removed
|
||||
- std::Iterator impl for gst::Iterator. It was awkward to use because the
|
||||
gst::Iterator could fail at each iteration
|
||||
|
||||
## [0.11.6] - 2018-08-27
|
||||
### Fixed
|
||||
- Build with NLL/two-phase borrows
|
||||
|
@ -305,18 +366,21 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
|
|||
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.11.6...HEAD
|
||||
[0.11.6]: https://github.com/sdroege/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://github.com/sdroege/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://github.com/sdroege/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://github.com/sdroege/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://github.com/sdroege/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://github.com/sdroege/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://github.com/sdroege/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://github.com/sdroege/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://github.com/sdroege/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://github.com/sdroege/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://github.com/sdroege/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...HEAD
|
||||
[0.12.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.1...0.12.2
|
||||
[0.12.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.0...0.12.1
|
||||
[0.12.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.6...0.12.0
|
||||
[0.11.6]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.5...0.11.6
|
||||
[0.11.5]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.4...0.11.5
|
||||
[0.11.4]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.3...0.11.4
|
||||
[0.11.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.2...0.11.3
|
||||
[0.11.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.1...0.11.2
|
||||
[0.11.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.11.0...0.11.1
|
||||
[0.11.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.2...0.11.0
|
||||
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.1...0.10.2
|
||||
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.10.0...0.10.1
|
||||
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.1...0.10.0
|
||||
[0.9.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.9.0...0.9.1
|
||||
[0.9.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.9.0
|
||||
[0.8.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.1...0.8.2
|
||||
[0.8.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.8.0...0.8.1
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
[package]
|
||||
name = "gstreamer-pbutils"
|
||||
version = "0.12.0"
|
||||
version = "0.12.2"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Base Utils library"
|
||||
repository = "https://github.com/sdroege/gstreamer-rs"
|
||||
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
|
||||
license = "MIT/Apache-2.0"
|
||||
readme = "README.md"
|
||||
homepage = "https://gstreamer.freedesktop.org"
|
||||
documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_pbutils"
|
||||
documentation = "https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_pbutils"
|
||||
keywords = ["gstreamer", "multimedia", "audio", "pbutils", "gnome"]
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
libc = "0.2"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
gstreamer-pbutils-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = "0.7"
|
||||
gobject-sys = "0.7"
|
||||
gstreamer-sys = { version = "0.6", features = ["v1_8"] }
|
||||
gstreamer-pbutils-sys = { version = "0.6", features = ["v1_8"] }
|
||||
glib = "0.6"
|
||||
gstreamer = { version = "0.12", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
@ -34,6 +34,3 @@ embed-lgpl-docs = ["rustdoc-stripper"]
|
|||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-pbutils-sys/dox"]
|
||||
default-features = []
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "sdroege/gstreamer-rs", branch = "master" }
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# gstreamer-pbutils-rs [![crates.io](https://img.shields.io/crates/v/gstreamer.svg)](https://crates.io/crates/gstreamer) [![Build Status](https://travis-ci.org/sdroege/gstreamer-rs.svg?branch=master)](https://travis-ci.org/sdroege/gstreamer-rs)
|
||||
# NOTE: The canonical repository for gstreamer-rs has moved to [freedesktop.org GitLab](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)!
|
||||
|
||||
# gstreamer-pbutils-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-pbutils.svg)](https://crates.io/crates/gstreamer-pbutils) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master)
|
||||
|
||||
[GStreamer](https://gstreamer.freedesktop.org/) (Pbutils library) bindings for Rust.
|
||||
Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/).
|
||||
Documentation can be found [here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer_pbutils/).
|
||||
|
||||
These bindings are providing a safe API that can be used to interface with
|
||||
GStreamer, e.g. for writing GStreamer-based applications.
|
||||
|
@ -14,7 +16,7 @@ API metadata provided by the GStreamer project. Older versions before 0.8.0 were
|
|||
written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
|
||||
The API of the two is incompatible.
|
||||
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs
|
||||
A crate for writing GStreamer plugins in Rust can be found here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
|
||||
|
||||
## Table of Contents
|
||||
1. [Installation](#installation)
|
||||
|
@ -48,7 +50,20 @@ On Debian/Ubuntu they can be installed with
|
|||
$ 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
|
||||
gstreamer1.0-libav libgstrtspserver-1.0-dev
|
||||
```
|
||||
|
||||
The minimum required version of the above libraries is >= 1.8. If you
|
||||
build the gstreamer-player sub-crate, or any of the examples that
|
||||
depend on gstreamer-player, you must ensure that in addition to the
|
||||
above packages, `libgstreamer-plugins-bad1.0-dev` is installed and
|
||||
that the version is >= 1.12. See the `Cargo.toml` files for the full
|
||||
details,
|
||||
|
||||
```
|
||||
# Only if you wish to install gstreamer-player, make sure the version
|
||||
# of this package is >= 1.12.
|
||||
$ apt-get install libgstreamer-plugins-bad1.0-dev
|
||||
```
|
||||
|
||||
Package names on other distributions should be similar.
|
||||
|
@ -64,11 +79,21 @@ provided by the GStreamer project.
|
|||
|
||||
#### Homebrew
|
||||
|
||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||
`--with-*` flags may be required.
|
||||
|
||||
```
|
||||
$ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||
gst-plugins-bad gst-plugins-ugly gst-libav
|
||||
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
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||
|
@ -79,7 +104,7 @@ After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|||
and set the `PKG_CONFIG_PATH` environment variable
|
||||
|
||||
```
|
||||
$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
```
|
||||
|
||||
<a name="installation-windows"/>
|
||||
|
@ -96,9 +121,14 @@ the GStreamer project.
|
|||
```
|
||||
$ pacman -S 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-plugins-ugly mingw-w64-x86_64-gst-libav \
|
||||
mingw-w64-x86_64-gst-rtsp-server
|
||||
```
|
||||
|
||||
If you wish to install the gstreamer-player sub-crate, make sure the
|
||||
version of these libraries is >= 1.12. Otherwise, a version >= 1.8 is
|
||||
sufficient.
|
||||
|
||||
#### GStreamer Binaries
|
||||
|
||||
You need to download the *two* `.msi` files for your platform from the
|
||||
|
@ -118,7 +148,7 @@ $ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG
|
|||
## Getting Started
|
||||
|
||||
The API reference can be found
|
||||
[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is
|
||||
[here](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/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
|
||||
|
@ -134,12 +164,12 @@ 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://github.com/sdroege/gstreamer-rs/tree/master/tutorials)
|
||||
[tutorials](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/tutorials)
|
||||
directory.
|
||||
|
||||
Some further examples for various aspects of GStreamer and how to use it from
|
||||
Rust can be found in the
|
||||
[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples)
|
||||
[examples](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/tree/master/examples)
|
||||
directory.
|
||||
|
||||
<a name="license"/>
|
||||
|
|
24
gstreamer-pbutils/src/auto/encoding_audio_profile.rs
Normal file
24
gstreamer-pbutils/src/auto/encoding_audio_profile.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use EncodingProfile;
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingAudioProfile(Object<ffi::GstEncodingAudioProfile, ffi::GstEncodingAudioProfileClass>): EncodingProfile;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_encoding_audio_profile_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodingAudioProfile {}
|
||||
|
||||
unsafe impl Send for EncodingAudioProfile {}
|
||||
unsafe impl Sync for EncodingAudioProfile {}
|
43
gstreamer-pbutils/src/auto/encoding_container_profile.rs
Normal file
43
gstreamer-pbutils/src/auto/encoding_container_profile.rs
Normal file
|
@ -0,0 +1,43 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use EncodingProfile;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingContainerProfile(Object<ffi::GstEncodingContainerProfile, ffi::GstEncodingContainerProfileClass>): EncodingProfile;
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::gst_encoding_container_profile_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for EncodingContainerProfile {}
|
||||
unsafe impl Sync for EncodingContainerProfile {}
|
||||
|
||||
pub trait EncodingContainerProfileExt {
|
||||
fn contains_profile<P: IsA<EncodingProfile>>(&self, profile: &P) -> bool;
|
||||
|
||||
fn get_profiles(&self) -> Vec<EncodingProfile>;
|
||||
}
|
||||
|
||||
impl<O: IsA<EncodingContainerProfile>> EncodingContainerProfileExt for O {
|
||||
fn contains_profile<P: IsA<EncodingProfile>>(&self, profile: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_encoding_container_profile_contains_profile(self.to_glib_none().0, profile.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_profiles(&self) -> Vec<EncodingProfile> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_encoding_container_profile_get_profiles(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue