forked from mirrors/gstreamer-rs
Compare commits
62 commits
Author | SHA1 | Date | |
---|---|---|---|
|
ec6a999649 | ||
|
251548e5e5 | ||
|
a71cc91001 | ||
|
e6df685667 | ||
|
d373fcac84 | ||
|
38e7a4f8d4 | ||
|
b4f94e98f5 | ||
|
d418278dba | ||
|
25860f7701 | ||
|
a40835351f | ||
|
18ced8dda4 | ||
|
ac15298d49 | ||
|
bc42a245ce | ||
|
0868bce87d | ||
|
7dfe7c09bd | ||
|
2a442f6ec1 | ||
|
5b00f973a6 | ||
|
161351e5c4 | ||
|
1528510c68 | ||
|
23fe9efe08 | ||
|
dcec895b30 | ||
|
cf6d15bc00 | ||
|
de85702408 | ||
|
5149dc254d | ||
|
168db3b948 | ||
|
eb87563479 | ||
|
c00bceb123 | ||
|
98701dac1b | ||
|
1427a05c32 | ||
|
c28ab78795 | ||
|
163030e984 | ||
|
2ead2e60eb | ||
|
ec3a11cec1 | ||
|
65f548cd98 | ||
|
0c4d6cf151 | ||
|
d9f4be0170 | ||
|
fa8a9db311 | ||
|
058d792548 | ||
|
9c0f1d0103 | ||
|
1dc66b58d8 | ||
|
97ff067b9c | ||
|
4cf3166317 | ||
|
68e1f31fd2 | ||
|
c3e712d1bf | ||
|
3d4697cf63 | ||
|
0bfa8fdcce | ||
|
dda55616dd | ||
|
881cdf2a5e | ||
|
01a98ecdbb | ||
|
5a2868ac57 | ||
|
bee134bc42 | ||
|
f3c2cb80f1 | ||
|
a9e401084d | ||
|
369d195e9f | ||
|
5da8ead7c9 | ||
|
dba110bff2 | ||
|
285f60db06 | ||
|
be0075647a | ||
|
fe93089bb9 | ||
|
e026c67874 | ||
|
12e1ca9b09 | ||
|
93af10fcdb |
117 changed files with 10124 additions and 1054 deletions
|
@ -49,21 +49,23 @@ stages:
|
|||
- G_DEBUG=fatal_warnings cargo test --color=always --all
|
||||
|
||||
- |
|
||||
if [ -n "$NIGHTLY" ]; then
|
||||
if [ -n "$ALL_FEATURES" ]; then
|
||||
cargo build --color=always --all --all-features
|
||||
G_DEBUG=fatal_warnings cargo test --color=always --all --all-features
|
||||
fi
|
||||
|
||||
test 1.34:
|
||||
# 1.34 img
|
||||
test 1.36:
|
||||
# 1.36 img
|
||||
# https://hub.docker.com/_/rust/
|
||||
image: "rust:1.34-slim"
|
||||
image: "rust:1.36-slim"
|
||||
extends: '.cargo test'
|
||||
|
||||
test stable:
|
||||
# Stable img
|
||||
# https://hub.docker.com/_/rust/
|
||||
image: "rust:slim"
|
||||
variables:
|
||||
ALL_FEATURES: 'yes'
|
||||
extends: '.cargo test'
|
||||
|
||||
test nightly:
|
||||
|
@ -72,7 +74,7 @@ test nightly:
|
|||
image: "rustlang/rust:nightly-slim"
|
||||
allow_failure: true
|
||||
variables:
|
||||
NIGHTLY: 'yes'
|
||||
ALL_FEATURES: 'yes'
|
||||
extends: '.cargo test'
|
||||
|
||||
rustfmt:
|
||||
|
@ -85,7 +87,7 @@ rustfmt:
|
|||
|
||||
clippy:
|
||||
extends: '.tarball_setup'
|
||||
image: "rustlang/rust:nightly-slim"
|
||||
image: "rust:slim"
|
||||
stage: 'extras'
|
||||
allow_failure: true
|
||||
script:
|
||||
|
|
|
@ -91,7 +91,6 @@ conversion_type = "scalar"
|
|||
|
||||
[[object]]
|
||||
name = "Gst.Bin"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
trait_name = "GstBinExt"
|
||||
[[object.signal]]
|
||||
|
@ -319,7 +318,6 @@ ref_mode = "ref"
|
|||
|
||||
[[object]]
|
||||
name = "Gst.Pipeline"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object]]
|
||||
|
@ -360,7 +358,6 @@ status = "generate"
|
|||
|
||||
[[object]]
|
||||
name = "Gst.Element"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
name = "make_from_uri"
|
||||
|
@ -658,7 +655,6 @@ trait_name = "GstObjectExt"
|
|||
|
||||
[[object]]
|
||||
name = "Gst.Pad"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
name = "link_maybe_ghosting"
|
||||
|
@ -861,7 +857,6 @@ final_type = true
|
|||
|
||||
[[object]]
|
||||
name = "Gst.GhostPad"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
name = "set_target"
|
||||
|
|
|
@ -29,6 +29,11 @@ generate = [
|
|||
manual = [
|
||||
"GObject.Object",
|
||||
"Gst.Object",
|
||||
"Gst.Element",
|
||||
"Gst.Allocator",
|
||||
"Gst.AllocationParams",
|
||||
"Gst.TagList",
|
||||
"Gst.TagMergeMode",
|
||||
"GstAudio.AudioInfo",
|
||||
"GstAudio.AudioFormatInfo",
|
||||
]
|
||||
|
@ -38,6 +43,11 @@ name = "Gst.Caps"
|
|||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Buffer"
|
||||
status = "manual"
|
||||
ref_mode = "ref"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.ClockTime"
|
||||
status = "manual"
|
||||
|
@ -125,3 +135,64 @@ status = "generate"
|
|||
name = "process"
|
||||
# bool does not signal error
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstAudio.AudioDecoder"
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
name = "finish_frame"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "finish_subframe"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "negotiate"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "set_output_caps"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "set_output_format"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "get_allocator"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "proxy_getcaps"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
||||
[[object]]
|
||||
name = "GstAudio.AudioEncoder"
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
name = "finish_frame"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "negotiate"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "set_output_format"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "get_allocator"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "get_latency"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "proxy_getcaps"
|
||||
[object.function.return]
|
||||
nullable = false
|
||||
|
|
|
@ -77,7 +77,6 @@ concurrency = "none"
|
|||
|
||||
[[object]]
|
||||
name = "GstBase.BaseSink"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
|
@ -92,7 +91,6 @@ status = "generate"
|
|||
|
||||
[[object]]
|
||||
name = "GstBase.BaseSrc"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
|
@ -122,7 +120,6 @@ status = "generate"
|
|||
|
||||
[[object]]
|
||||
name = "GstBase.BaseTransform"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
|
@ -134,7 +131,6 @@ status = "generate"
|
|||
[[object]]
|
||||
name = "GstBase.Aggregator"
|
||||
status = "generate"
|
||||
subclassing = true
|
||||
version = "1.14"
|
||||
|
||||
[[object.function]]
|
||||
|
@ -154,7 +150,6 @@ version = "1.14"
|
|||
[[object]]
|
||||
name = "GstBase.AggregatorPad"
|
||||
status = "generate"
|
||||
subclassing = true
|
||||
version = "1.14"
|
||||
|
||||
[[object]]
|
||||
|
@ -207,7 +202,6 @@ ref_mode = "ref"
|
|||
|
||||
[[object]]
|
||||
name = "GstBase.BaseParse"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
name = "finish_frame"
|
||||
|
|
|
@ -39,6 +39,7 @@ generate = [
|
|||
"GstVideo.VideoCaptionType",
|
||||
"GstVideo.VideoBufferPool",
|
||||
"GstVideo.VideoPackFlags",
|
||||
"GstVideo.VideoBufferFlags",
|
||||
]
|
||||
|
||||
manual = [
|
||||
|
@ -49,6 +50,8 @@ manual = [
|
|||
"Gst.Buffer",
|
||||
"Gst.BufferPool",
|
||||
"Gst.BufferPoolAcquireParams",
|
||||
"Gst.Allocator",
|
||||
"Gst.AllocationParams",
|
||||
"Gst.ClockTimeDiff",
|
||||
"Gst.FlowReturn",
|
||||
"Gst.TagList",
|
||||
|
@ -86,7 +89,6 @@ status = "generate"
|
|||
|
||||
[[object]]
|
||||
name = "GstVideo.VideoDecoder"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
|
@ -149,9 +151,12 @@ status = "generate"
|
|||
name = "negotiate"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "get_allocator"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstVideo.VideoEncoder"
|
||||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
|
@ -197,3 +202,7 @@ status = "generate"
|
|||
[[object.function]]
|
||||
name = "negotiate"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "get_allocator"
|
||||
ignore = true
|
||||
|
|
|
@ -29,6 +29,12 @@ generate = [
|
|||
"GstWebRTC.WebRTCRTPTransceiverDirection",
|
||||
"GstWebRTC.WebRTCSignalingState",
|
||||
"GstWebRTC.WebRTCStatsType",
|
||||
"GstWebRTC.WebRTCBundlePolicy",
|
||||
"GstWebRTC.WebRTCDataChannelState",
|
||||
"GstWebRTC.WebRTCICETransportPolicy",
|
||||
"GstWebRTC.WebRTCPriorityType",
|
||||
"GstWebRTC.WebRTCSCTPTransportState",
|
||||
"GstWebRTC.WebRTCFECType",
|
||||
]
|
||||
|
||||
manual = [
|
||||
|
|
|
@ -532,6 +532,9 @@ buffers that the appsrc element will push to its source pad. Any
|
|||
previous caps that were set on appsrc will be replaced by the caps
|
||||
associated with the sample if not equal.
|
||||
|
||||
This function does not take ownership of the
|
||||
sample so the sample needs to be unreffed after calling this function.
|
||||
|
||||
When the block property is TRUE, this function can block until free
|
||||
space becomes available in the queue.
|
||||
## `sample`
|
||||
|
|
|
@ -278,7 +278,7 @@ Feature: `v1_14`
|
|||
<!-- impl AudioStreamAlign::fn new -->
|
||||
Allocate a new `AudioStreamAlign` with the given configuration. All
|
||||
processing happens according to sample rate `rate`, until
|
||||
`gst_audio_discont_wait_set_rate` is called with a new `rate`.
|
||||
`AudioStreamAlign::set_rate` is called with a new `rate`.
|
||||
A negative rate can be used for reverse playback.
|
||||
|
||||
`alignment_threshold` gives the tolerance in nanoseconds after which a
|
||||
|
@ -315,6 +315,33 @@ or `AudioStreamAlign::copy`.
|
|||
|
||||
Feature: `v1_14`
|
||||
|
||||
<!-- impl AudioStreamAlign::fn get_alignment_threshold -->
|
||||
Gets the currently configured alignment threshold.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The currently configured alignment threshold
|
||||
<!-- impl AudioStreamAlign::fn get_discont_wait -->
|
||||
Gets the currently configured discont wait.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The currently configured discont wait
|
||||
<!-- impl AudioStreamAlign::fn get_rate -->
|
||||
Gets the currently configured sample rate.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The currently configured sample rate
|
||||
<!-- impl AudioStreamAlign::fn get_samples_since_discont -->
|
||||
Returns the number of samples that were processed since the last
|
||||
discontinuity was detected.
|
||||
|
@ -376,6 +403,28 @@ output sample position of the start of the data
|
|||
# Returns
|
||||
|
||||
`true` if a discontinuity was detected, `false` otherwise.
|
||||
<!-- impl AudioStreamAlign::fn set_alignment_threshold -->
|
||||
Sets `alignment_treshold` as new alignment threshold for the following processing.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `alignment_threshold`
|
||||
a new alignment threshold
|
||||
<!-- impl AudioStreamAlign::fn set_discont_wait -->
|
||||
Sets `alignment_treshold` as new discont wait for the following processing.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `discont_wait`
|
||||
a new discont wait
|
||||
<!-- impl AudioStreamAlign::fn set_rate -->
|
||||
Sets `rate` as new sample rate for the following processing. If the sample
|
||||
rate differs this implicitely marks the next data as discontinuous.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `rate`
|
||||
a new sample rate
|
||||
<!-- struct StreamVolume -->
|
||||
This interface is implemented by elements that provide a stream volume. Examples for
|
||||
such elements are `volume` and `playbin`.
|
||||
|
|
|
@ -664,6 +664,38 @@ Feature: `v1_14`
|
|||
|
||||
## `caps`
|
||||
The `gst::Caps` to set on the src pad.
|
||||
<!-- trait AggregatorExt::fn simple_get_next_time -->
|
||||
This is a simple `Aggregator::get_next_time` implementation that
|
||||
just looks at the `gst::Segment` on the srcpad of the aggregator and bases
|
||||
the next time on the running time there.
|
||||
|
||||
This is the desired behaviour in most cases where you have a live source
|
||||
and you have a dead line based aggregator subclass.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The running time based on the position
|
||||
<!-- trait AggregatorExt::fn get_property_min-upstream-latency -->
|
||||
Force minimum upstream latency (in nanoseconds). When sources with a
|
||||
higher latency are expected to be plugged in dynamically after the
|
||||
aggregator has started playing, this allows overriding the minimum
|
||||
latency reported by the initial source(s). This is only taken into
|
||||
account when larger than the actually reported minimum latency.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait AggregatorExt::fn set_property_min-upstream-latency -->
|
||||
Force minimum upstream latency (in nanoseconds). When sources with a
|
||||
higher latency are expected to be plugged in dynamically after the
|
||||
aggregator has started playing, this allows overriding the minimum
|
||||
latency reported by the initial source(s). This is only taken into
|
||||
account when larger than the actually reported minimum latency.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- struct AggregatorPad -->
|
||||
Pads managed by a `GstAggregor` subclass.
|
||||
|
||||
|
@ -692,6 +724,9 @@ Feature: `v1_14`
|
|||
|
||||
TRUE if there was a buffer queued in `self`, or FALSE if not.
|
||||
<!-- trait AggregatorPadExt::fn has_buffer -->
|
||||
This checks if a pad has a buffer available that will be returned by
|
||||
a call to `AggregatorPadExt::peek_buffer` or
|
||||
`AggregatorPadExt::pop_buffer`.
|
||||
|
||||
Feature: `v1_14_1`
|
||||
|
||||
|
@ -727,6 +762,394 @@ Feature: `v1_14`
|
|||
|
||||
The buffer in `self` or NULL if no buffer was
|
||||
queued. You should unref the buffer after usage.
|
||||
<!-- trait AggregatorPadExt::fn get_property_emit-signals -->
|
||||
Enables the emission of signals such as `AggregatorPad::buffer-consumed`
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait AggregatorPadExt::fn set_property_emit-signals -->
|
||||
Enables the emission of signals such as `AggregatorPad::buffer-consumed`
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- struct BaseParse -->
|
||||
This base class is for parser elements that process data and splits it
|
||||
into separate audio/video/whatever frames.
|
||||
|
||||
It provides for:
|
||||
|
||||
* provides one sink pad and one source pad
|
||||
* handles state changes
|
||||
* can operate in pull mode or push mode
|
||||
* handles seeking in both modes
|
||||
* handles events (SEGMENT/EOS/FLUSH)
|
||||
* handles queries (POSITION/DURATION/SEEKING/FORMAT/CONVERT)
|
||||
* handles flushing
|
||||
|
||||
The purpose of this base class is to provide the basic functionality of
|
||||
a parser and share a lot of rather complex code.
|
||||
|
||||
# Description of the parsing mechanism:
|
||||
|
||||
## Set-up phase
|
||||
|
||||
* `BaseParse` calls `BaseParseClass.start`() to inform subclass
|
||||
that data processing is about to start now.
|
||||
|
||||
* `BaseParse` class calls `BaseParseClass.set_sink_caps`() to
|
||||
inform the subclass about incoming sinkpad caps. Subclass could
|
||||
already set the srcpad caps accordingly, but this might be delayed
|
||||
until calling `BaseParse::finish_frame` with a non-queued frame.
|
||||
|
||||
* At least at this point subclass needs to tell the `BaseParse` class
|
||||
how big data chunks it wants to receive (minimum frame size ). It can
|
||||
do this with `BaseParseExt::set_min_frame_size`.
|
||||
|
||||
* `BaseParse` class sets up appropriate data passing mode (pull/push)
|
||||
and starts to process the data.
|
||||
|
||||
## Parsing phase
|
||||
|
||||
* `BaseParse` gathers at least min_frame_size bytes of data either
|
||||
by pulling it from upstream or collecting buffers in an internal
|
||||
`Adapter`.
|
||||
|
||||
* A buffer of (at least) min_frame_size bytes is passed to subclass
|
||||
with `BaseParseClass.handle_frame`(). Subclass checks the contents
|
||||
and can optionally return `gst::FlowReturn::Ok` along with an amount of data
|
||||
to be skipped to find a valid frame (which will result in a
|
||||
subsequent DISCONT). If, otherwise, the buffer does not hold a
|
||||
complete frame, `BaseParseClass.handle_frame`() can merely return
|
||||
and will be called again when additional data is available. In push
|
||||
mode this amounts to an additional input buffer (thus minimal
|
||||
additional latency), in pull mode this amounts to some arbitrary
|
||||
reasonable buffer size increase.
|
||||
|
||||
Of course, `BaseParseExt::set_min_frame_size` could also be used if
|
||||
a very specific known amount of additional data is required. If,
|
||||
however, the buffer holds a complete valid frame, it can pass the
|
||||
size of this frame to `BaseParse::finish_frame`.
|
||||
|
||||
If acting as a converter, it can also merely indicate consumed input
|
||||
data while simultaneously providing custom output data. Note that
|
||||
baseclass performs some processing (such as tracking overall consumed
|
||||
data rate versus duration) for each finished frame, but other state
|
||||
is only updated upon each call to `BaseParseClass.handle_frame`()
|
||||
(such as tracking upstream input timestamp).
|
||||
|
||||
Subclass is also responsible for setting the buffer metadata
|
||||
(e.g. buffer timestamp and duration, or keyframe if applicable).
|
||||
(although the latter can also be done by `BaseParse` if it is
|
||||
appropriately configured, see below). Frame is provided with
|
||||
timestamp derived from upstream (as much as generally possible),
|
||||
duration obtained from configuration (see below), and offset
|
||||
if meaningful (in pull mode).
|
||||
|
||||
Note that `BaseParseClass.handle_frame`() might receive any small
|
||||
amount of input data when leftover data is being drained (e.g. at
|
||||
EOS).
|
||||
|
||||
* As part of finish frame processing, just prior to actually pushing
|
||||
the buffer in question, it is passed to
|
||||
`BaseParseClass.pre_push_frame`() which gives subclass yet one last
|
||||
chance to examine buffer metadata, or to send some custom (tag)
|
||||
events, or to perform custom (segment) filtering.
|
||||
|
||||
* During the parsing process `BaseParseClass` will handle both srcpad
|
||||
and sinkpad events. They will be passed to subclass if
|
||||
`BaseParseClass.event`() or `BaseParseClass.src_event`()
|
||||
implementations have been provided.
|
||||
|
||||
## Shutdown phase
|
||||
|
||||
* `BaseParse` class calls `BaseParseClass.stop`() to inform the
|
||||
subclass that data parsing will be stopped.
|
||||
|
||||
Subclass is responsible for providing pad template caps for source and
|
||||
sink pads. The pads need to be named "sink" and "src". It also needs to
|
||||
set the fixed caps on srcpad, when the format is ensured (e.g. when
|
||||
base class calls subclass' `BaseParseClass.set_sink_caps`() function).
|
||||
|
||||
This base class uses `gst::Format::Default` as a meaning of frames. So,
|
||||
subclass conversion routine needs to know that conversion from
|
||||
`gst::Format::Time` to `gst::Format::Default` must return the
|
||||
frame number that can be found from the given byte position.
|
||||
|
||||
`BaseParse` uses subclasses conversion methods also for seeking (or
|
||||
otherwise uses its own default one, see also below).
|
||||
|
||||
Subclass `start` and `stop` functions will be called to inform the beginning
|
||||
and end of data processing.
|
||||
|
||||
Things that subclass need to take care of:
|
||||
|
||||
* Provide pad templates
|
||||
* Fixate the source pad caps when appropriate
|
||||
* Inform base class how big data chunks should be retrieved. This is
|
||||
done with `BaseParseExt::set_min_frame_size` function.
|
||||
* Examine data chunks passed to subclass with
|
||||
`BaseParseClass.handle_frame`() and pass proper frame(s) to
|
||||
`BaseParse::finish_frame`, and setting src pad caps and timestamps
|
||||
on frame.
|
||||
* Provide conversion functions
|
||||
* Update the duration information with `BaseParse::set_duration`
|
||||
* Optionally passthrough using `BaseParseExt::set_passthrough`
|
||||
* Configure various baseparse parameters using
|
||||
`BaseParseExt::set_average_bitrate`, `BaseParseExt::set_syncable`
|
||||
and `BaseParse::set_frame_rate`.
|
||||
|
||||
* In particular, if subclass is unable to determine a duration, but
|
||||
parsing (or specs) yields a frames per seconds rate, then this can be
|
||||
provided to `BaseParse` to enable it to cater for buffer time
|
||||
metadata (which will be taken from upstream as much as
|
||||
possible). Internally keeping track of frame durations and respective
|
||||
sizes that have been pushed provides `BaseParse` with an estimated
|
||||
bitrate. A default `BaseParseClass.convert`() (used if not
|
||||
overridden) will then use these rates to perform obvious conversions.
|
||||
These rates are also used to update (estimated) duration at regular
|
||||
frame intervals.
|
||||
|
||||
# Implements
|
||||
|
||||
[`BaseParseExt`](trait.BaseParseExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait BaseParseExt -->
|
||||
Trait containing all `BaseParse` methods.
|
||||
|
||||
# Implementors
|
||||
|
||||
[`BaseParse`](struct.BaseParse.html)
|
||||
<!-- trait BaseParseExt::fn add_index_entry -->
|
||||
Adds an entry to the index associating `offset` to `ts`. It is recommended
|
||||
to only add keyframe entries. `force` allows to bypass checks, such as
|
||||
whether the stream is (upstream) seekable, another entry is already "close"
|
||||
to the new entry, etc.
|
||||
## `offset`
|
||||
offset of entry
|
||||
## `ts`
|
||||
timestamp associated with offset
|
||||
## `key`
|
||||
whether entry refers to keyframe
|
||||
## `force`
|
||||
add entry disregarding sanity checks
|
||||
|
||||
# Returns
|
||||
|
||||
`gboolean` indicating whether entry was added
|
||||
<!-- trait BaseParseExt::fn convert_default -->
|
||||
Default implementation of `BaseParseClass.convert`().
|
||||
## `src_format`
|
||||
`gst::Format` describing the source format.
|
||||
## `src_value`
|
||||
Source value to be converted.
|
||||
## `dest_format`
|
||||
`gst::Format` defining the converted format.
|
||||
## `dest_value`
|
||||
Pointer where the conversion result will be put.
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if conversion was successful.
|
||||
<!-- trait BaseParseExt::fn drain -->
|
||||
Drains the adapter until it is empty. It decreases the min_frame_size to
|
||||
match the current adapter size and calls chain method until the adapter
|
||||
is emptied or chain returns with error.
|
||||
|
||||
Feature: `v1_12`
|
||||
|
||||
<!-- trait BaseParseExt::fn finish_frame -->
|
||||
Collects parsed data and pushes this downstream.
|
||||
Source pad caps must be set when this is called.
|
||||
|
||||
If `frame`'s out_buffer is set, that will be used as subsequent frame data.
|
||||
Otherwise, `size` samples will be taken from the input and used for output,
|
||||
and the output's metadata (timestamps etc) will be taken as (optionally)
|
||||
set by the subclass on `frame`'s (input) buffer (which is otherwise
|
||||
ignored for any but the above purpose/information).
|
||||
|
||||
Note that the latter buffer is invalidated by this call, whereas the
|
||||
caller retains ownership of `frame`.
|
||||
## `frame`
|
||||
a `BaseParseFrame`
|
||||
## `size`
|
||||
consumed input data represented by frame
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::FlowReturn` that should be escalated to caller (of caller)
|
||||
<!-- trait BaseParseExt::fn merge_tags -->
|
||||
Sets the parser subclass's tags and how they should be merged with any
|
||||
upstream stream tags. This will override any tags previously-set
|
||||
with `BaseParseExt::merge_tags`.
|
||||
|
||||
Note that this is provided for convenience, and the subclass is
|
||||
not required to use this and can still do tag handling on its own.
|
||||
## `tags`
|
||||
a `gst::TagList` to merge, or NULL to unset
|
||||
previously-set tags
|
||||
## `mode`
|
||||
the `gst::TagMergeMode` to use, usually `gst::TagMergeMode::Replace`
|
||||
<!-- trait BaseParseExt::fn push_frame -->
|
||||
Pushes the frame's buffer downstream, sends any pending events and
|
||||
does some timestamp and segment handling. Takes ownership of
|
||||
frame's buffer, though caller retains ownership of `frame`.
|
||||
|
||||
This must be called with sinkpad STREAM_LOCK held.
|
||||
## `frame`
|
||||
a `BaseParseFrame`
|
||||
|
||||
# Returns
|
||||
|
||||
`gst::FlowReturn`
|
||||
<!-- trait BaseParseExt::fn set_average_bitrate -->
|
||||
Optionally sets the average bitrate detected in media (if non-zero),
|
||||
e.g. based on metadata, as it will be posted to the application.
|
||||
|
||||
By default, announced average bitrate is estimated. The average bitrate
|
||||
is used to estimate the total duration of the stream and to estimate
|
||||
a seek position, if there's no index and the format is syncable
|
||||
(see `BaseParseExt::set_syncable`).
|
||||
## `bitrate`
|
||||
average bitrate in bits/second
|
||||
<!-- trait BaseParseExt::fn set_duration -->
|
||||
Sets the duration of the currently playing media. Subclass can use this
|
||||
when it is able to determine duration and/or notices a change in the media
|
||||
duration. Alternatively, if `interval` is non-zero (default), then stream
|
||||
duration is determined based on estimated bitrate, and updated every `interval`
|
||||
frames.
|
||||
## `fmt`
|
||||
`gst::Format`.
|
||||
## `duration`
|
||||
duration value.
|
||||
## `interval`
|
||||
how often to update the duration estimate based on bitrate, or 0.
|
||||
<!-- trait BaseParseExt::fn set_frame_rate -->
|
||||
If frames per second is configured, parser can take care of buffer duration
|
||||
and timestamping. When performing segment clipping, or seeking to a specific
|
||||
location, a corresponding decoder might need an initial `lead_in` and a
|
||||
following `lead_out` number of frames to ensure the desired segment is
|
||||
entirely filled upon decoding.
|
||||
## `fps_num`
|
||||
frames per second (numerator).
|
||||
## `fps_den`
|
||||
frames per second (denominator).
|
||||
## `lead_in`
|
||||
frames needed before a segment for subsequent decode
|
||||
## `lead_out`
|
||||
frames needed after a segment
|
||||
<!-- trait BaseParseExt::fn set_has_timing_info -->
|
||||
Set if frames carry timing information which the subclass can (generally)
|
||||
parse and provide. In particular, intrinsic (rather than estimated) time
|
||||
can be obtained following a seek.
|
||||
## `has_timing`
|
||||
whether frames carry timing information
|
||||
<!-- trait BaseParseExt::fn set_infer_ts -->
|
||||
By default, the base class might try to infer PTS from DTS and vice
|
||||
versa. While this is generally correct for audio data, it may not
|
||||
be otherwise. Sub-classes implementing such formats should disable
|
||||
timestamp inferring.
|
||||
## `infer_ts`
|
||||
`true` if parser should infer DTS/PTS from each other
|
||||
<!-- trait BaseParseExt::fn set_latency -->
|
||||
Sets the minimum and maximum (which may likely be equal) latency introduced
|
||||
by the parsing process. If there is such a latency, which depends on the
|
||||
particular parsing of the format, it typically corresponds to 1 frame duration.
|
||||
## `min_latency`
|
||||
minimum parse latency
|
||||
## `max_latency`
|
||||
maximum parse latency
|
||||
<!-- trait BaseParseExt::fn set_min_frame_size -->
|
||||
Subclass can use this function to tell the base class that it needs to
|
||||
be given buffers of at least `min_size` bytes.
|
||||
## `min_size`
|
||||
Minimum size in bytes of the data that this base class should
|
||||
give to subclass.
|
||||
<!-- trait BaseParseExt::fn set_passthrough -->
|
||||
Set if the nature of the format or configuration does not allow (much)
|
||||
parsing, and the parser should operate in passthrough mode (which only
|
||||
applies when operating in push mode). That is, incoming buffers are
|
||||
pushed through unmodified, i.e. no `BaseParseClass.handle_frame`()
|
||||
will be invoked, but `BaseParseClass.pre_push_frame`() will still be
|
||||
invoked, so subclass can perform as much or as little is appropriate for
|
||||
passthrough semantics in `BaseParseClass.pre_push_frame`().
|
||||
## `passthrough`
|
||||
`true` if parser should run in passthrough mode
|
||||
<!-- trait BaseParseExt::fn set_pts_interpolation -->
|
||||
By default, the base class will guess PTS timestamps using a simple
|
||||
interpolation (previous timestamp + duration), which is incorrect for
|
||||
data streams with reordering, where PTS can go backward. Sub-classes
|
||||
implementing such formats should disable PTS interpolation.
|
||||
## `pts_interpolate`
|
||||
`true` if parser should interpolate PTS timestamps
|
||||
<!-- trait BaseParseExt::fn set_syncable -->
|
||||
Set if frame starts can be identified. This is set by default and
|
||||
determines whether seeking based on bitrate averages
|
||||
is possible for a format/stream.
|
||||
## `syncable`
|
||||
set if frame starts can be identified
|
||||
<!-- trait BaseParseExt::fn set_ts_at_offset -->
|
||||
This function should only be called from a `handle_frame` implementation.
|
||||
|
||||
`BaseParse` creates initial timestamps for frames by using the last
|
||||
timestamp seen in the stream before the frame starts. In certain
|
||||
cases, the correct timestamps will occur in the stream after the
|
||||
start of the frame, but before the start of the actual picture data.
|
||||
This function can be used to set the timestamps based on the offset
|
||||
into the frame data that the picture starts.
|
||||
## `offset`
|
||||
offset into current buffer
|
||||
<!-- trait BaseParseExt::fn get_property_disable-passthrough -->
|
||||
If set to `true`, baseparse will unconditionally force parsing of the
|
||||
incoming data. This can be required in the rare cases where the incoming
|
||||
side-data (caps, pts, dts, ...) is not trusted by the user and wants to
|
||||
force validation and parsing of the incoming data.
|
||||
If set to `false`, decision of whether to parse the data or not is up to
|
||||
the implementation (standard behaviour).
|
||||
<!-- trait BaseParseExt::fn set_property_disable-passthrough -->
|
||||
If set to `true`, baseparse will unconditionally force parsing of the
|
||||
incoming data. This can be required in the rare cases where the incoming
|
||||
side-data (caps, pts, dts, ...) is not trusted by the user and wants to
|
||||
force validation and parsing of the incoming data.
|
||||
If set to `false`, decision of whether to parse the data or not is up to
|
||||
the implementation (standard behaviour).
|
||||
<!-- struct BaseParseFrame -->
|
||||
Frame (context) data passed to each frame parsing virtual methods. In
|
||||
addition to providing the data to be checked for a valid frame or an already
|
||||
identified frame, it conveys additional metadata or control information
|
||||
from and to the subclass w.r.t. the particular frame in question (rather
|
||||
than global parameters). Some of these may apply to each parsing stage, others
|
||||
only to some a particular one. These parameters are effectively zeroed at start
|
||||
of each frame's processing, i.e. parsing virtual method invocation sequence.
|
||||
<!-- impl BaseParseFrame::fn new -->
|
||||
Allocates a new `BaseParseFrame`. This function is mainly for bindings,
|
||||
elements written in C should usually allocate the frame on the stack and
|
||||
then use `BaseParseFrame::init` to initialise it.
|
||||
## `buffer`
|
||||
a `gst::Buffer`
|
||||
## `flags`
|
||||
the flags
|
||||
## `overhead`
|
||||
number of bytes in this frame which should be counted as
|
||||
metadata overhead, ie. not used to calculate the average bitrate.
|
||||
Set to -1 to mark the entire frame as metadata. If in doubt, set to 0.
|
||||
|
||||
# Returns
|
||||
|
||||
a newly-allocated `BaseParseFrame`. Free with
|
||||
`BaseParseFrame::free` when no longer needed.
|
||||
<!-- impl BaseParseFrame::fn copy -->
|
||||
Copies a `BaseParseFrame`.
|
||||
|
||||
# Returns
|
||||
|
||||
A copy of `self`
|
||||
<!-- impl BaseParseFrame::fn free -->
|
||||
Frees the provided `self`.
|
||||
<!-- impl BaseParseFrame::fn init -->
|
||||
Sets a `BaseParseFrame` to initial state. Currently this means
|
||||
all public fields are zero-ed and a private flag is set to make
|
||||
sure `BaseParseFrame::free` only frees the contents but not
|
||||
the actual frame. Use this function to initialise a `BaseParseFrame`
|
||||
allocated on the stack.
|
||||
<!-- 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
|
||||
|
@ -918,6 +1341,17 @@ more details.
|
|||
The maximum time in nanoseconds that a buffer can be late
|
||||
before it is dropped and not rendered. A value of -1 means an
|
||||
unlimited time.
|
||||
<!-- trait BaseSinkExt::fn get_processing_deadline -->
|
||||
Get the processing deadline of `self`. see
|
||||
`BaseSinkExt::set_processing_deadline` for more information about
|
||||
the processing deadline.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the processing deadline
|
||||
<!-- trait BaseSinkExt::fn get_render_delay -->
|
||||
Get the render delay of `self`. see `BaseSinkExt::set_render_delay` for more
|
||||
information about the render delay.
|
||||
|
@ -1025,6 +1459,17 @@ buffer timestamp and the current clock time. A value of -1 means
|
|||
an unlimited time.
|
||||
## `max_lateness`
|
||||
the new max lateness value.
|
||||
<!-- trait BaseSinkExt::fn set_processing_deadline -->
|
||||
Maximum amount of time (in nanoseconds) that the pipeline can take
|
||||
for processing the buffer. This is added to the latency of live
|
||||
pipelines.
|
||||
|
||||
This function is usually called by subclasses.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `processing_deadline`
|
||||
the new processing deadline in nanoseconds.
|
||||
<!-- trait BaseSinkExt::fn set_qos_enabled -->
|
||||
Configures `self` to send Quality-of-Service events upstream.
|
||||
## `enabled`
|
||||
|
@ -1166,6 +1611,20 @@ rendering of the buffers when it would exceed to max-bitrate.
|
|||
Control the maximum amount of bits that will be rendered per second.
|
||||
Setting this property to a value bigger than 0 will make the sink delay
|
||||
rendering of the buffers when it would exceed to max-bitrate.
|
||||
<!-- trait BaseSinkExt::fn get_property_processing-deadline -->
|
||||
Maximum amount of time (in nanoseconds) that the pipeline can take
|
||||
for processing the buffer. This is added to the latency of live
|
||||
pipelines.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait BaseSinkExt::fn set_property_processing-deadline -->
|
||||
Maximum amount of time (in nanoseconds) that the pipeline can take
|
||||
for processing the buffer. This is added to the latency of live
|
||||
pipelines.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait BaseSinkExt::fn get_property_render-delay -->
|
||||
The additional delay between synchronisation and actual rendering of the
|
||||
media. This property will add additional latency to the device in order to
|
||||
|
@ -1401,6 +1860,12 @@ If `automatic_eos` is `true`, `self` will automatically go EOS if a buffer
|
|||
after the total size is returned. By default this is `true` but sources
|
||||
that can't return an authoritative size and only know that they're EOS
|
||||
when trying to read more should set this to `false`.
|
||||
|
||||
When `self` operates in `gst::Format::Time`, `BaseSrc` will send an EOS
|
||||
when a buffer outside of the currently configured segment is pushed if
|
||||
`automatic_eos` is `true`. Since 1.16, if `automatic_eos` is `false` an
|
||||
EOS will be pushed only when the `BaseSrc.create` implementation
|
||||
returns `gst::FlowReturn::Eos`.
|
||||
## `automatic_eos`
|
||||
automatic eos
|
||||
<!-- trait BaseSrcExt::fn set_blocksize -->
|
||||
|
@ -1730,8 +2195,8 @@ running_time.
|
|||
<!-- trait BaseTransformExt::fn update_src_caps -->
|
||||
Updates the srcpad caps and send the caps downstream. This function
|
||||
can be used by subclasses when they have already negotiated their caps
|
||||
but found a change in them (or computed new informations). This way,
|
||||
they can notify downstream about that change without loosing any
|
||||
but found a change in them (or computed new information). This way,
|
||||
they can notify downstream about that change without losing any
|
||||
buffer.
|
||||
## `updated_caps`
|
||||
An updated version of the srcpad caps to be pushed
|
||||
|
@ -1771,7 +2236,7 @@ These rules are:
|
|||
* `gst::FlowReturn::Ok`: otherwise
|
||||
|
||||
`gst::FlowReturn::Error` or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are
|
||||
returned immediatelly from the `FlowCombiner::update_flow` function.
|
||||
returned immediately from the `FlowCombiner::update_flow` function.
|
||||
<!-- impl FlowCombiner::fn new -->
|
||||
Creates a new `FlowCombiner`, use `FlowCombiner::free` to free it.
|
||||
|
||||
|
|
|
@ -876,7 +876,7 @@ a `guint` describing how many seconds to wait for `waits` to be true
|
|||
# Returns
|
||||
|
||||
a `gboolean` `true` if the waits have been registered, `false` if not.
|
||||
(Could be that it timed out waiting or that more waits then waits was found)
|
||||
(Could be that it timed out waiting or that more waits than waits was found)
|
||||
<!-- impl Harness::fn new -->
|
||||
Creates a new harness. Works like `Harness::new_with_padnames`, except it
|
||||
assumes the `gst::Element` sinkpad is named "sink" and srcpad is named "src"
|
||||
|
@ -1266,6 +1266,27 @@ which is earlier or equal to the time of the clock as given by
|
|||
MT safe.
|
||||
## `new_time`
|
||||
a `gst::ClockTime` later than that returned by `gst::ClockExt::get_time`
|
||||
<!-- impl TestClock::fn timed_wait_for_multiple_pending_ids -->
|
||||
Blocks until at least `count` clock notifications have been requested from
|
||||
`self`, or the timeout expires.
|
||||
|
||||
MT safe.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `count`
|
||||
the number of pending clock notifications to wait for
|
||||
## `timeout_ms`
|
||||
the timeout in milliseconds
|
||||
## `pending_list`
|
||||
Address
|
||||
of a `glib::List` pointer variable to store the list of pending `GstClockIDs`
|
||||
that expired, or `None`
|
||||
|
||||
# Returns
|
||||
|
||||
a `gboolean` `true` if the waits have been registered, `false` if not.
|
||||
(Could be that it timed out waiting or that more waits than waits was found)
|
||||
<!-- 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
|
||||
|
|
|
@ -105,6 +105,14 @@ The Identifier or `None`
|
|||
|
||||
A reference to the wanted `Asset` or `None`
|
||||
<!-- impl Asset::fn request_async -->
|
||||
The `callback` will be called from a running `glib::MainLoop` which is iterating a `glib::MainContext`.
|
||||
Note that, users should ensure the `glib::MainContext`, since this method will notify
|
||||
`callback` from the thread which was associated with a thread default
|
||||
`glib::MainContext` at calling `ges_init`.
|
||||
For example, if a user wants non-default `glib::MainContext` to be associated
|
||||
with `callback`, `ges_init` must be called after g_main_context_push_thread_default ()
|
||||
with custom `glib::MainContext`.
|
||||
|
||||
Request a new `Asset` asyncronously, `callback` will be called when the materail is
|
||||
ready to be used or if an error occured.
|
||||
|
||||
|
@ -1163,7 +1171,7 @@ Informs you that a `Asset` could not be created. In case of
|
|||
missing GStreamer plugins, the error will be set to `GST_CORE_ERROR`
|
||||
`gst::CoreError::MissingPlugin`
|
||||
## `error`
|
||||
The `glib::Error` defining the error that accured, might be `None`
|
||||
The `glib::Error` defining the error that occured, might be `None`
|
||||
## `id`
|
||||
The `id` of the asset that failed loading
|
||||
## `extractable_type`
|
||||
|
@ -1515,6 +1523,22 @@ The `TrackElement` for which to choose the tracks it should land into
|
|||
# Returns
|
||||
|
||||
a `glib::PtrArray` of `Track`-s where that object should be added
|
||||
<!-- trait TimelineExt::fn connect_snapping_ended -->
|
||||
Will be emitted when the 2 `TrackElement` ended to snap
|
||||
## `obj1`
|
||||
the first `TrackElement` that was snapping.
|
||||
## `obj2`
|
||||
the second `TrackElement` that was snapping.
|
||||
## `position`
|
||||
the position where the two objects finally snapping.
|
||||
<!-- trait TimelineExt::fn connect_snapping_started -->
|
||||
Will be emitted when the 2 `TrackElement` first snapped
|
||||
## `obj1`
|
||||
the first `TrackElement` that was snapping.
|
||||
## `obj2`
|
||||
the second `TrackElement` that was snapping.
|
||||
## `position`
|
||||
the position where the two objects finally snapping.
|
||||
<!-- trait TimelineExt::fn connect_track_added -->
|
||||
Will be emitted after the track was added to the timeline.
|
||||
## `track`
|
||||
|
@ -1606,6 +1630,13 @@ The `duration` of `self`
|
|||
# Returns
|
||||
|
||||
The `inpoint` of `self`
|
||||
<!-- trait TimelineElementExt::fn get_layer_priority -->
|
||||
|
||||
# Returns
|
||||
|
||||
The priority of the first layer the element is in (note that only
|
||||
groups can span over several layers). `GES_TIMELINE_ELEMENT_NO_LAYER_PRIORITY`
|
||||
means that the element is not in a layer.
|
||||
<!-- trait TimelineElementExt::fn get_max_duration -->
|
||||
|
||||
# Returns
|
||||
|
@ -1787,15 +1818,27 @@ Note that if the timeline snap-distance property of the timeline containing
|
|||
`self` is set, `self` will properly snap to its neighboors.
|
||||
## `duration`
|
||||
the duration in `gst::ClockTime`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `duration` could be set.
|
||||
<!-- trait TimelineElementExt::fn set_inpoint -->
|
||||
Set the in-point, that is the moment at which the `self` will start
|
||||
outputting data from its contents.
|
||||
## `inpoint`
|
||||
the in-point in `gst::ClockTime`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `inpoint` could be set.
|
||||
<!-- trait TimelineElementExt::fn set_max_duration -->
|
||||
Set the maximun duration of the object
|
||||
## `maxduration`
|
||||
the maximum duration in `gst::ClockTime`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `maxduration` could be set.
|
||||
<!-- trait TimelineElementExt::fn set_name -->
|
||||
Sets the name of object, or gives `self` a guaranteed unique name (if name is NULL).
|
||||
This function makes a copy of the provided name, so the caller retains ownership
|
||||
|
@ -1822,6 +1865,10 @@ To set `Effect` priorities `ClipExt::set_top_effect_index` should
|
|||
be used.
|
||||
## `priority`
|
||||
the priority
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `priority` could be set.
|
||||
<!-- trait TimelineElementExt::fn set_start -->
|
||||
Set the position of the object in its containing layer.
|
||||
|
||||
|
@ -1829,6 +1876,10 @@ Note that if the snapping-distance property of the timeline containing
|
|||
`self` is set, `self` will properly snap to the edges around `start`.
|
||||
## `start`
|
||||
the position in `gst::ClockTime`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `start` could be set.
|
||||
<!-- trait TimelineElementExt::fn set_timeline -->
|
||||
Sets the timeline of `self` to `timeline`.
|
||||
## `timeline`
|
||||
|
@ -2358,7 +2409,9 @@ the `gst::ControlSource` to set on the binding.
|
|||
## `property_name`
|
||||
The name of the property to control.
|
||||
## `binding_type`
|
||||
The type of binding to create. Only "direct" is available for now.
|
||||
The type of binding to create. Currently the following values are valid:
|
||||
- "direct": See `gst_direct_control_binding_new`
|
||||
- "direct-absolute": See `gst_direct_control_binding_new_absolute`
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -2446,7 +2499,7 @@ The location of the file/resource to use.
|
|||
The `UriClipAsset` is a special `Asset` that lets you handle
|
||||
the media file to use inside the GStreamer Editing Services. It has APIs that
|
||||
let you get information about the medias. Also, the tags found in the media file are
|
||||
set as Metadatas of the Asser.
|
||||
set as Metadata of the Asset.
|
||||
|
||||
# Implements
|
||||
|
||||
|
@ -2457,6 +2510,14 @@ Trait containing all `UriClipAsset` methods.
|
|||
# Implementors
|
||||
|
||||
[`UriClipAsset`](struct.UriClipAsset.html)
|
||||
<!-- impl UriClipAsset::fn finish -->
|
||||
Finalize the request of an async `UriClipAsset`
|
||||
## `res`
|
||||
The `gio::AsyncResult` from which to get the newly created `UriClipAsset`
|
||||
|
||||
# Returns
|
||||
|
||||
The `UriClipAsset` previously requested
|
||||
<!-- impl UriClipAsset::fn new -->
|
||||
Creates a `UriClipAsset` for `uri`
|
||||
|
||||
|
@ -2470,7 +2531,7 @@ filesource_asset_loaded_cb (GESAsset * source, GAsyncResult * res, gpointer user
|
|||
GError *error = NULL;
|
||||
GESUriClipAsset *filesource_asset;
|
||||
|
||||
filesource_asset = GES_URI_CLIP_ASSET (ges_asset_request_finish (res, &error));
|
||||
filesource_asset = ges_uri_clip_asset_finish (res, &error);
|
||||
if (filesource_asset) {
|
||||
g_print ("The file: %s is usable as a FileSource, it is%s an image and lasts %" GST_TIME_FORMAT,
|
||||
ges_asset_get_id (GES_ASSET (filesource_asset))
|
||||
|
@ -2504,8 +2565,8 @@ You can also use multi file uris for `MultiFileSource`.
|
|||
|
||||
# Returns
|
||||
|
||||
A reference to the requested asset or
|
||||
`None` if an error happened
|
||||
A reference to the requested asset or `None` if
|
||||
an error happened
|
||||
<!-- trait UriClipAssetExt::fn get_duration -->
|
||||
Gets duration of the file represented by `self`
|
||||
|
||||
|
|
|
@ -5,15 +5,27 @@ context. It also provided some wrappers around `gst_base::BaseTransform`'s
|
|||
`start`, `stop` and `set_caps` virtual methods that ensure an OpenGL context
|
||||
is available and current in the calling thread.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
# Implements
|
||||
|
||||
[`GLBaseFilterExt`](trait.GLBaseFilterExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait GLBaseFilterExt -->
|
||||
Trait containing all `GLBaseFilter` methods.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
# Implementors
|
||||
|
||||
[`GLBaseFilter`](struct.GLBaseFilter.html)
|
||||
<!-- trait GLBaseFilterExt::fn find_gl_context -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
Whether an OpenGL context could be retrieved or created successfully
|
||||
<!-- struct GLBuffer -->
|
||||
GstGLBuffer is a `gst::Memory` subclass providing support for the mapping of
|
||||
GL buffers.
|
||||
|
@ -44,7 +56,7 @@ a `GLContext`
|
|||
|
||||
a new `GLColorConvert` object
|
||||
<!-- impl GLColorConvert::fn fixate_caps -->
|
||||
Provides an implementation of `gst_base::BaseTransformClass::fixate_caps`()
|
||||
Provides an implementation of `gst_base::BaseTransformClass.fixate_caps`()
|
||||
## `context`
|
||||
a `GLContext` to use for transforming `caps`
|
||||
## `direction`
|
||||
|
@ -58,7 +70,7 @@ the `gst::Caps` to fixate
|
|||
|
||||
the fixated `gst::Caps`
|
||||
<!-- impl GLColorConvert::fn transform_caps -->
|
||||
Provides an implementation of `gst_base::BaseTransformClass::transform_caps`()
|
||||
Provides an implementation of `gst_base::BaseTransformClass.transform_caps`()
|
||||
## `context`
|
||||
a `GLContext` to use for transforming `caps`
|
||||
## `direction`
|
||||
|
@ -72,7 +84,7 @@ a set of filter `gst::Caps`
|
|||
|
||||
the converted `gst::Caps`
|
||||
<!-- impl GLColorConvert::fn decide_allocation -->
|
||||
Provides an implementation of `GstBaseTransfromClass::decide_allocation`()
|
||||
Provides an implementation of `gst_base::BaseTransformClass.decide_allocation`()
|
||||
## `query`
|
||||
a completed ALLOCATION `gst::Query`
|
||||
|
||||
|
@ -299,7 +311,7 @@ Gets the OpenGL platform that used by `self`.
|
|||
The platform specific backing OpenGL context
|
||||
<!-- trait GLContextExt::fn get_gl_platform_version -->
|
||||
Get the version of the OpenGL platform (GLX, EGL, etc) used. Only valid
|
||||
after a call to `gst_gl_context_create_context`.
|
||||
after a call to `GLContextExt::create`.
|
||||
## `major`
|
||||
return for the major version
|
||||
## `minor`
|
||||
|
@ -377,6 +389,30 @@ a `GLSLProfile`
|
|||
# Returns
|
||||
|
||||
Whether `self` supports the combination of `version` with `profile`
|
||||
<!-- trait GLContextExt::fn supports_precision -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `version`
|
||||
a `GLSLVersion`
|
||||
## `profile`
|
||||
a `GLSLProfile`
|
||||
|
||||
# Returns
|
||||
|
||||
whether `self` supports the 'precision' specifier in GLSL shaders
|
||||
<!-- trait GLContextExt::fn supports_precision_highp -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `version`
|
||||
a `GLSLVersion`
|
||||
## `profile`
|
||||
a `GLSLProfile`
|
||||
|
||||
# Returns
|
||||
|
||||
whether `self` supports the 'precision highp' specifier in GLSL shaders
|
||||
<!-- trait GLContextExt::fn swap_buffers -->
|
||||
Swap the front and back buffers on the window attached to `self`.
|
||||
This will display the frame on the next refresh cycle.
|
||||
|
@ -432,7 +468,7 @@ Trait containing all `GLDisplay` methods.
|
|||
|
||||
# Implementors
|
||||
|
||||
[`GLDisplayEGL`](struct.GLDisplayEGL.html), [`GLDisplay`](struct.GLDisplay.html)
|
||||
[`GLDisplayEGL`](struct.GLDisplayEGL.html), [`GLDisplayWayland`](struct.GLDisplayWayland.html), [`GLDisplayX11`](struct.GLDisplayX11.html), [`GLDisplay`](struct.GLDisplay.html)
|
||||
<!-- impl GLDisplay::fn new -->
|
||||
|
||||
# Returns
|
||||
|
@ -551,6 +587,54 @@ pointer to a display (or 0)
|
|||
# Returns
|
||||
|
||||
A `EGLDisplay` or `EGL_NO_DISPLAY`
|
||||
<!-- struct GLDisplayWayland -->
|
||||
the contents of a `GLDisplayWayland` are private and should only be accessed
|
||||
through the provided API
|
||||
|
||||
# Implements
|
||||
|
||||
[`GLDisplayExt`](trait.GLDisplayExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- impl GLDisplayWayland::fn new -->
|
||||
Create a new `GLDisplayWayland` from the wayland display name. See `wl_display_connect`
|
||||
for details on what is a valid name.
|
||||
## `name`
|
||||
a display name
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLDisplayWayland` or `None`
|
||||
<!-- impl GLDisplayWayland::fn new_with_display -->
|
||||
Creates a new display connection from a wl_display Display.
|
||||
## `display`
|
||||
an existing, wayland display
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLDisplayWayland`
|
||||
<!-- struct GLDisplayX11 -->
|
||||
the contents of a `GLDisplayX11` are private and should only be accessed
|
||||
through the provided API
|
||||
|
||||
# Implements
|
||||
|
||||
[`GLDisplayExt`](trait.GLDisplayExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- impl GLDisplayX11::fn new -->
|
||||
Create a new `GLDisplayX11` from the x11 display name. See XOpenDisplay()
|
||||
for details on what is a valid name.
|
||||
## `name`
|
||||
a display name
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLDisplayX11` or `None`
|
||||
<!-- impl GLDisplayX11::fn new_with_display -->
|
||||
Creates a new display connection from a X11 Display.
|
||||
## `display`
|
||||
an existing, x11 display
|
||||
|
||||
# Returns
|
||||
|
||||
a new `GLDisplayX11`
|
||||
<!-- enum GLFormat -->
|
||||
<!-- enum GLFormat::variant Luminance -->
|
||||
Single component replicated across R, G, and B textures
|
||||
|
@ -575,12 +659,18 @@ Three 8-bit components stored in the R, G, and B
|
|||
<!-- enum GLFormat::variant Rgb565 -->
|
||||
Three components of bit depth 5, 6 and 5 stored in the R, G,
|
||||
and B texture components respectively.
|
||||
<!-- enum GLFormat::variant Rgb16 -->
|
||||
Three 16-bit components stored in the R, G, and B
|
||||
texture components
|
||||
<!-- enum GLFormat::variant Rgba -->
|
||||
Four components stored in the R, G, B, and A texture
|
||||
components respectively.
|
||||
<!-- enum GLFormat::variant Rgba8 -->
|
||||
Four 8-bit components stored in the R, G, B, and A texture
|
||||
components respectively.
|
||||
<!-- enum GLFormat::variant Rgba16 -->
|
||||
Four 16-bit components stored in the R, G, B, and A texture
|
||||
components respectively.
|
||||
<!-- enum GLFormat::variant DepthComponent16 -->
|
||||
A single 16-bit component for depth information.
|
||||
<!-- enum GLFormat::variant Depth24Stencil8 -->
|
||||
|
@ -895,6 +985,58 @@ a `glib::Error`
|
|||
# Returns
|
||||
|
||||
a new `shader` with the specified stages.
|
||||
<!-- impl GLShader::fn string_fragment_external_oes_get_default -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `version`
|
||||
a `GLSLVersion`
|
||||
## `profile`
|
||||
a `GLSLProfile`
|
||||
|
||||
# Returns
|
||||
|
||||
a passthrough shader string for copying an input external-oes
|
||||
texture to the output
|
||||
<!-- impl GLShader::fn string_fragment_get_default -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `version`
|
||||
a `GLSLVersion`
|
||||
## `profile`
|
||||
a `GLSLProfile`
|
||||
|
||||
# Returns
|
||||
|
||||
a passthrough shader string for copying an input texture to
|
||||
the output
|
||||
<!-- impl GLShader::fn string_get_highest_precision -->
|
||||
Generates a shader string that defines the precision of float types in
|
||||
GLSL shaders. This is particularly needed for fragment shaders in a
|
||||
GLSL ES context where there is no default precision specified.
|
||||
|
||||
Practically, this will return the string 'precision mediump float'
|
||||
or 'precision highp float' depending on if high precision floats are
|
||||
determined to be supported.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `context`
|
||||
a `GLContext`
|
||||
## `version`
|
||||
a `GLSLVersion`
|
||||
## `profile`
|
||||
a `GLSLProfile`
|
||||
|
||||
# Returns
|
||||
|
||||
a shader string defining the precision of float types based on
|
||||
`context`, `version` and `profile`
|
||||
<!-- impl GLShader::fn attach -->
|
||||
Attaches `stage` to `self`. `stage` must have been successfully compiled
|
||||
with `GLSLStage::compile`.
|
||||
|
@ -1221,6 +1363,12 @@ Mark's `self` as being used for the next GL draw command.
|
|||
Note: must be called in the GL thread and `self` must have been linked.
|
||||
<!-- enum GLStereoDownmix -->
|
||||
Output anaglyph type to generate when downmixing to mono
|
||||
<!-- enum GLStereoDownmix::variant GreenMagentaDubois -->
|
||||
Dubois optimised Green-Magenta anaglyph
|
||||
<!-- enum GLStereoDownmix::variant RedCyanDubois -->
|
||||
Dubois optimised Red-Cyan anaglyph
|
||||
<!-- enum GLStereoDownmix::variant AmberBlueDubois -->
|
||||
Dubois optimised Amber-Blue anaglyph
|
||||
<!-- enum GLTextureTarget -->
|
||||
<!-- enum GLTextureTarget::variant None -->
|
||||
no texture target
|
||||
|
@ -1298,7 +1446,7 @@ Convert stereoscopic/multiview video using fragment shaders.
|
|||
|
||||
a new `GLViewConvert`
|
||||
<!-- impl GLViewConvert::fn fixate_caps -->
|
||||
Provides an implementation of `gst_base::BaseTransformClass::fixate_caps`()
|
||||
Provides an implementation of `gst_base::BaseTransformClass.fixate_caps`()
|
||||
## `direction`
|
||||
a `gst::PadDirection`
|
||||
## `caps`
|
||||
|
@ -1350,7 +1498,7 @@ a `gst::Buffer`
|
|||
|
||||
a `gst::FlowReturn`
|
||||
<!-- impl GLViewConvert::fn transform_caps -->
|
||||
Provides an implementation of `gst_base::BaseTransformClass::transform_caps`()
|
||||
Provides an implementation of `gst_base::BaseTransformClass.transform_caps`()
|
||||
## `direction`
|
||||
a `gst::PadDirection`
|
||||
## `caps`
|
||||
|
@ -1381,6 +1529,15 @@ a `GLDisplay`
|
|||
# Returns
|
||||
|
||||
a new `GLWindow` using `display`'s connection
|
||||
<!-- trait GLWindowExt::fn controls_viewport -->
|
||||
Checks if `self` controls the GL viewport.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `self` controls the GL viewport, otherwise `false`
|
||||
<!-- trait GLWindowExt::fn draw -->
|
||||
Redraw the window contents. Implementations should invoke the draw callback.
|
||||
<!-- trait GLWindowExt::fn get_context -->
|
||||
|
@ -1411,8 +1568,16 @@ for them. This method allows you to disable events handling completely
|
|||
from the `self`.
|
||||
## `handle_events`
|
||||
a `gboolean` indicating if events should be handled or not.
|
||||
<!-- trait GLWindowExt::fn queue_resize -->
|
||||
Queue resizing of `self`.
|
||||
<!-- trait GLWindowExt::fn quit -->
|
||||
Quit the runloop's execution.
|
||||
<!-- trait GLWindowExt::fn resize -->
|
||||
Resize `self` to the given `width` and `height`.
|
||||
## `width`
|
||||
new width
|
||||
## `height`
|
||||
new height
|
||||
<!-- trait GLWindowExt::fn run -->
|
||||
Start the execution of the runloop.
|
||||
<!-- trait GLWindowExt::fn send_message -->
|
||||
|
|
|
@ -522,13 +522,7 @@ Encoding profiles for containers. Keeps track of a list of `EncodingProfile`
|
|||
|
||||
# Implements
|
||||
|
||||
[`EncodingContainerProfileExt`](trait.EncodingContainerProfileExt.html), [`EncodingProfileExt`](trait.EncodingProfileExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait EncodingContainerProfileExt -->
|
||||
Trait containing all `EncodingContainerProfile` methods.
|
||||
|
||||
# Implementors
|
||||
|
||||
[`EncodingContainerProfile`](struct.EncodingContainerProfile.html)
|
||||
[`EncodingProfileExt`](trait.EncodingProfileExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- impl EncodingContainerProfile::fn new -->
|
||||
Creates a new `EncodingContainerProfile`.
|
||||
## `name`
|
||||
|
@ -544,7 +538,7 @@ The preset to use for this profile.
|
|||
# Returns
|
||||
|
||||
The newly created `EncodingContainerProfile`.
|
||||
<!-- trait EncodingContainerProfileExt::fn add_profile -->
|
||||
<!-- impl EncodingContainerProfile::fn add_profile -->
|
||||
Add a `EncodingProfile` to the list of profiles handled by `self`.
|
||||
|
||||
No copy of `profile` will be made, if you wish to use it elsewhere after this
|
||||
|
@ -555,7 +549,7 @@ the `EncodingProfile` to add.
|
|||
# Returns
|
||||
|
||||
`true` if the `stream` was properly added, else `false`.
|
||||
<!-- trait EncodingContainerProfileExt::fn contains_profile -->
|
||||
<!-- impl EncodingContainerProfile::fn contains_profile -->
|
||||
Checks if `self` contains a `EncodingProfile` identical to
|
||||
`profile`.
|
||||
## `profile`
|
||||
|
@ -565,7 +559,7 @@ a `EncodingProfile`
|
|||
|
||||
`true` if `self` contains a `EncodingProfile` identical
|
||||
to `profile`, else `false`.
|
||||
<!-- trait EncodingContainerProfileExt::fn get_profiles -->
|
||||
<!-- impl EncodingContainerProfile::fn get_profiles -->
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -610,11 +604,12 @@ The new `EncodingProfile` or `None`.
|
|||
<!-- trait EncodingProfileExt::fn copy -->
|
||||
Makes a deep copy of `self`
|
||||
|
||||
Feature: `v1_12`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The copy of `self`
|
||||
|
||||
Since 1.12
|
||||
<!-- trait EncodingProfileExt::fn get_allow_dynamic_output -->
|
||||
Get whether the format that has been negotiated in at some point can be renegotiated
|
||||
later during the encoding.
|
||||
|
@ -699,8 +694,6 @@ Set `description` as the given description for the `self`. A copy of
|
|||
the description to set on the profile
|
||||
<!-- trait EncodingProfileExt::fn set_enabled -->
|
||||
Set whether the profile should be used or not.
|
||||
|
||||
Since 1.6
|
||||
## `enabled`
|
||||
`false` to disable `profile`, `true` to enable it
|
||||
<!-- trait EncodingProfileExt::fn set_format -->
|
||||
|
|
|
@ -28,8 +28,6 @@ a `Player` configuration
|
|||
# Returns
|
||||
|
||||
current position update interval in milliseconds
|
||||
|
||||
Since 1.10
|
||||
<!-- impl Player::fn config_get_seek_accurate -->
|
||||
## `config`
|
||||
a `Player` configuration
|
||||
|
@ -37,8 +35,6 @@ a `Player` configuration
|
|||
# Returns
|
||||
|
||||
`true` if accurate seeking is enabled
|
||||
|
||||
Since 1.12
|
||||
<!-- impl Player::fn config_get_user_agent -->
|
||||
Return the user agent which has been configured using
|
||||
`Player::config_set_user_agent` if any.
|
||||
|
@ -48,11 +44,9 @@ a `Player` configuration
|
|||
# Returns
|
||||
|
||||
the configured agent, or `None`
|
||||
Since 1.10
|
||||
<!-- impl Player::fn config_set_position_update_interval -->
|
||||
set interval in milliseconds between two position-updated signals.
|
||||
pass 0 to stop updating the position.
|
||||
Since 1.10
|
||||
## `config`
|
||||
a `Player` configuration
|
||||
## `interval`
|
||||
|
@ -75,8 +69,6 @@ accurate seek or not
|
|||
Set the user agent to pass to the server if `player` needs to connect
|
||||
to a server during playback. This is typically used when playing HTTP
|
||||
or RTSP streams.
|
||||
|
||||
Since 1.10
|
||||
## `config`
|
||||
a `Player` configuration
|
||||
## `agent`
|
||||
|
@ -123,8 +115,6 @@ Retrieve the current value of audio-video-offset property
|
|||
# Returns
|
||||
|
||||
The current value of audio-video-offset in nanoseconds
|
||||
|
||||
Since 1.10
|
||||
<!-- impl Player::fn get_color_balance -->
|
||||
Retrieve the current value of the indicated `type_`.
|
||||
## `type_`
|
||||
|
@ -143,8 +133,6 @@ or it must be freed after usage.
|
|||
|
||||
a copy of the current configuration of `self`. Use
|
||||
`gst::Structure::free` after usage or `Player::set_config`.
|
||||
|
||||
Since 1.10
|
||||
<!-- impl Player::fn get_current_audio_track -->
|
||||
A Function to get current audio `PlayerAudioInfo` instance.
|
||||
|
||||
|
@ -230,6 +218,15 @@ current subtitle URI
|
|||
|
||||
URI of the current external subtitle.
|
||||
`g_free` after usage.
|
||||
<!-- impl Player::fn get_subtitle_video_offset -->
|
||||
Retrieve the current value of subtitle-video-offset property
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
The current value of subtitle-video-offset in nanoseconds
|
||||
<!-- impl Player::fn get_uri -->
|
||||
Gets the URI of the currently-playing stream.
|
||||
|
||||
|
@ -252,8 +249,6 @@ Additional configuration
|
|||
# Returns
|
||||
|
||||
Current video snapshot sample or `None` on failure
|
||||
|
||||
Since 1.12
|
||||
<!-- impl Player::fn get_volume -->
|
||||
Returns the current volume level, as a percentage between 0 and 1.
|
||||
|
||||
|
@ -291,8 +286,6 @@ Enable or disable the current audio track.
|
|||
TRUE or FALSE
|
||||
<!-- impl Player::fn set_audio_video_offset -->
|
||||
Sets audio-video-offset property by value of `offset`
|
||||
|
||||
Since 1.10
|
||||
## `offset`
|
||||
`gint64` in nanoseconds
|
||||
<!-- impl Player::fn set_color_balance -->
|
||||
|
@ -318,7 +311,6 @@ a `gst::Structure`
|
|||
# Returns
|
||||
|
||||
`true` when the configuration could be set.
|
||||
Since 1.10
|
||||
<!-- impl Player::fn set_multiview_flags -->
|
||||
Sets the current value of the indicated mode `type_` to the passed
|
||||
value.
|
||||
|
@ -356,6 +348,13 @@ gst_player_set_subtitle_track_enabled(`self`, TRUE) so the subtitles are actuall
|
|||
rendered.
|
||||
## `uri`
|
||||
subtitle URI
|
||||
<!-- impl Player::fn set_subtitle_video_offset -->
|
||||
Sets subtitle-video-offset property by value of `offset`
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `offset`
|
||||
`gint64` in nanoseconds
|
||||
<!-- impl Player::fn set_uri -->
|
||||
Sets the next URI to play.
|
||||
## `uri`
|
||||
|
@ -672,12 +671,6 @@ Window handle to use or `None`
|
|||
Window handle to use or `None`
|
||||
## `video_sink`
|
||||
the custom video_sink element to be set for the video renderer
|
||||
|
||||
# Returns
|
||||
|
||||
|
||||
|
||||
Since 1.12
|
||||
<!-- impl PlayerVideoOverlayVideoRenderer::fn expose -->
|
||||
Tell an overlay that it has been exposed. This will redraw the current frame
|
||||
in the drawable even if the pipeline is PAUSED.
|
||||
|
|
|
@ -177,6 +177,14 @@ users.
|
|||
|
||||
the `RTSPToken` of `self`. `gst_rtsp_token_unref` after
|
||||
usage.
|
||||
<!-- trait RTSPAuthExt::fn get_realm -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the `realm` of `self`
|
||||
<!-- trait RTSPAuthExt::fn get_supported_methods -->
|
||||
Gets the supported authentication methods of `self`.
|
||||
|
||||
|
@ -206,6 +214,24 @@ Get the `gio::TlsDatabase` used for verifying client certificate.
|
|||
|
||||
the `gio::TlsDatabase` of `self`. `gobject::ObjectExt::unref` after
|
||||
usage.
|
||||
<!-- trait RTSPAuthExt::fn parse_htdigest -->
|
||||
Parse the contents of the file at `path` and enable the privileges
|
||||
listed in `token` for the users it describes.
|
||||
|
||||
The format of the file is expected to match the format described by
|
||||
<https://en.wikipedia.org/wiki/Digest_access_authentication`The_.htdigest_file`>,
|
||||
as output by the `htdigest` command.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `path`
|
||||
Path to the htdigest file
|
||||
## `token`
|
||||
authorisation token
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the file was successfully parsed, `false` otherwise.
|
||||
<!-- trait RTSPAuthExt::fn remove_basic -->
|
||||
Removes `basic` authentication token.
|
||||
## `basic`
|
||||
|
@ -222,6 +248,11 @@ Set the default `RTSPToken` to `token` in `self`. The default token will
|
|||
be used for unauthenticated users.
|
||||
## `token`
|
||||
a `RTSPToken`
|
||||
<!-- trait RTSPAuthExt::fn set_realm -->
|
||||
Set the `realm` of `self`
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait RTSPAuthExt::fn set_supported_methods -->
|
||||
Sets the supported authentication `methods` for `self`.
|
||||
|
||||
|
@ -244,8 +275,6 @@ a `gio::TlsCertificate`
|
|||
Sets the certificate database that is used to verify peer certificates.
|
||||
If set to `None` (the default), then peer certificate validation will always
|
||||
set the `gio::TlsCertificateFlags::UnknownCa` error.
|
||||
|
||||
Since 1.6
|
||||
## `database`
|
||||
a `gio::TlsDatabase`
|
||||
<!-- trait RTSPAuthExt::fn connect_accept_certificate -->
|
||||
|
@ -397,12 +426,34 @@ sent to the client. `user_data` is passed to `func` and `notify` is called when
|
|||
|
||||
By default, the client will send the messages on the `gst_rtsp::RTSPConnection` that
|
||||
was configured with `RTSPClient::attach` was called.
|
||||
|
||||
It is only allowed to set either a `send_func` or a `send_messages_func`
|
||||
but not both at the same time.
|
||||
## `func`
|
||||
a `GstRTSPClientSendFunc`
|
||||
## `user_data`
|
||||
user data passed to `func`
|
||||
## `notify`
|
||||
called when `user_data` is no longer in use
|
||||
<!-- trait RTSPClientExt::fn set_send_messages_func -->
|
||||
Set `func` as the callback that will be called when new messages needs to be
|
||||
sent to the client. `user_data` is passed to `func` and `notify` is called when
|
||||
`user_data` is no longer in use.
|
||||
|
||||
By default, the client will send the messages on the `gst_rtsp::RTSPConnection` that
|
||||
was configured with `RTSPClient::attach` was called.
|
||||
|
||||
It is only allowed to set either a `send_func` or a `send_messages_func`
|
||||
but not both at the same time.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `func`
|
||||
a `GstRTSPClientSendMessagesFunc`
|
||||
## `user_data`
|
||||
user data passed to `func`
|
||||
## `notify`
|
||||
called when `user_data` is no longer in use
|
||||
<!-- trait RTSPClientExt::fn set_session_pool -->
|
||||
Set `pool` as the sessionpool for `self` which it will use to find
|
||||
or allocate sessions. the sessionpool is usually inherited from the server
|
||||
|
@ -587,6 +638,14 @@ current thread that is handling the request for a client.
|
|||
# Returns
|
||||
|
||||
a `RTSPContext`
|
||||
<!-- enum RTSPFilterResult -->
|
||||
Possible return values for `RTSPSessionPoolExt::filter`.
|
||||
<!-- enum RTSPFilterResult::variant Remove -->
|
||||
Remove session
|
||||
<!-- enum RTSPFilterResult::variant Keep -->
|
||||
Keep session in the pool
|
||||
<!-- enum RTSPFilterResult::variant Ref -->
|
||||
Ref session in the result list
|
||||
<!-- struct RTSPMedia -->
|
||||
A class that contains the GStreamer element along with a list of
|
||||
`RTSPStream` objects that can produce data.
|
||||
|
@ -627,6 +686,9 @@ element of `self`, and create `GstRTSPStreams` for them.
|
|||
<!-- trait RTSPMediaExt::fn complete_pipeline -->
|
||||
Add a receiver and sender parts to the pipeline based on the transport from
|
||||
SETUP.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `transports`
|
||||
a list of `gst_rtsp::RTSPTransport`
|
||||
|
||||
|
@ -684,6 +746,14 @@ Get the clock that is used by the pipeline in `self`.
|
|||
# Returns
|
||||
|
||||
the `gst::Clock` used by `self`. unref after usage.
|
||||
<!-- trait RTSPMediaExt::fn get_do_retransmission -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
Whether retransmission requests will be sent
|
||||
<!-- trait RTSPMediaExt::fn get_element -->
|
||||
Get the element that was used when constructing `self`.
|
||||
|
||||
|
@ -696,6 +766,15 @@ Get the latency that is used for receiving media.
|
|||
# Returns
|
||||
|
||||
latency in milliseconds
|
||||
<!-- trait RTSPMediaExt::fn get_max_mcast_ttl -->
|
||||
Get the the maximum time-to-live value of outgoing multicast packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the maximum time-to-live value of outgoing multicast packets.
|
||||
<!-- trait RTSPMediaExt::fn get_multicast_iface -->
|
||||
Get the multicast interface used for `self`.
|
||||
|
||||
|
@ -791,6 +870,15 @@ a `gst_sdp::SDPMessage`
|
|||
# Returns
|
||||
|
||||
TRUE on success.
|
||||
<!-- trait RTSPMediaExt::fn is_bind_mcast_address -->
|
||||
Check if multicast sockets are configured to be bound to multicast addresses.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if multicast sockets are configured to be bound to multicast addresses.
|
||||
<!-- trait RTSPMediaExt::fn is_eos_shutdown -->
|
||||
Check if the pipeline for `self` will send an EOS down the pipeline before
|
||||
unpreparing.
|
||||
|
@ -857,7 +945,11 @@ a `gst_rtsp::RTSPTimeRange`
|
|||
`true` on success.
|
||||
<!-- trait RTSPMediaExt::fn seek_full -->
|
||||
Seek the pipeline of `self` to `range`. `self` must be prepared with
|
||||
`RTSPMediaExt::prepare`.
|
||||
`RTSPMediaExt::prepare`. In order to perform the seek operation,
|
||||
the pipeline must contain all needed transport parts (transport sinks).
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `range`
|
||||
a `gst_rtsp::RTSPTimeRange`
|
||||
## `flags`
|
||||
|
@ -866,10 +958,30 @@ The minimal set of `gst::SeekFlags` to use
|
|||
# Returns
|
||||
|
||||
`true` on success.
|
||||
<!-- trait RTSPMediaExt::fn seekable -->
|
||||
Check if the pipeline for `self` seek and up to what point in time,
|
||||
it can seek.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
-1 if the stream is not seekable, 0 if seekable only to the beginning
|
||||
and > 0 to indicate the longest duration between any two random access points.
|
||||
`G_MAXINT64` means any value is possible.
|
||||
<!-- trait RTSPMediaExt::fn set_address_pool -->
|
||||
configure `pool` to be used as the address pool of `self`.
|
||||
## `pool`
|
||||
a `RTSPAddressPool`
|
||||
<!-- trait RTSPMediaExt::fn set_bind_mcast_address -->
|
||||
Decide whether the multicast socket should be bound to a multicast address or
|
||||
INADDR_ANY.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `bind_mcast_addr`
|
||||
the new value
|
||||
<!-- trait RTSPMediaExt::fn set_buffer_size -->
|
||||
Set the kernel UDP buffer size.
|
||||
## `size`
|
||||
|
@ -878,6 +990,11 @@ the new value
|
|||
Configure the clock used for the media.
|
||||
## `clock`
|
||||
`gst::Clock` to be used
|
||||
<!-- trait RTSPMediaExt::fn set_do_retransmission -->
|
||||
Set whether retransmission requests will be sent
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait RTSPMediaExt::fn set_eos_shutdown -->
|
||||
Set or unset if an EOS event will be sent to the pipeline for `self` before
|
||||
it is unprepared.
|
||||
|
@ -887,6 +1004,17 @@ the new value
|
|||
Configure the latency used for receiving media.
|
||||
## `latency`
|
||||
latency in milliseconds
|
||||
<!-- trait RTSPMediaExt::fn set_max_mcast_ttl -->
|
||||
Set the maximum time-to-live value of outgoing multicast packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `ttl`
|
||||
the new multicast ttl value
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the requested ttl has been set successfully.
|
||||
<!-- trait RTSPMediaExt::fn set_multicast_iface -->
|
||||
configure `multicast_iface` to be used for `self`.
|
||||
## `multicast_iface`
|
||||
|
@ -1083,6 +1211,14 @@ of all medias created from this factory.
|
|||
# Returns
|
||||
|
||||
The GstClock
|
||||
<!-- trait RTSPMediaFactoryExt::fn get_do_retransmission -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
Whether retransmission requests will be sent for receiving media
|
||||
<!-- trait RTSPMediaFactoryExt::fn get_latency -->
|
||||
Get the latency that is used for receiving media
|
||||
|
||||
|
@ -1097,6 +1233,15 @@ default prepare vmethod.
|
|||
|
||||
the configured launch description. `g_free` after
|
||||
usage.
|
||||
<!-- trait RTSPMediaFactoryExt::fn get_max_mcast_ttl -->
|
||||
Get the the maximum time-to-live value of outgoing multicast packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the maximum time-to-live value of outgoing multicast packets.
|
||||
<!-- trait RTSPMediaFactoryExt::fn get_media_gtype -->
|
||||
Return the GType of the GstRTSPMedia subclass this
|
||||
factory will create.
|
||||
|
@ -1150,6 +1295,15 @@ methods.
|
|||
# Returns
|
||||
|
||||
The transport mode.
|
||||
<!-- trait RTSPMediaFactoryExt::fn is_bind_mcast_address -->
|
||||
Check if multicast sockets are configured to be bound to multicast addresses.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if multicast sockets are configured to be bound to multicast addresses.
|
||||
<!-- trait RTSPMediaFactoryExt::fn is_eos_shutdown -->
|
||||
Get if media created from this factory will have an EOS event sent to the
|
||||
pipeline before shutdown.
|
||||
|
@ -1167,6 +1321,14 @@ Get if media created from this factory can be shared between clients.
|
|||
configure `pool` to be used as the address pool of `self`.
|
||||
## `pool`
|
||||
a `RTSPAddressPool`
|
||||
<!-- trait RTSPMediaFactoryExt::fn set_bind_mcast_address -->
|
||||
Decide whether the multicast socket should be bound to a multicast address or
|
||||
INADDR_ANY.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `bind_mcast_addr`
|
||||
the new value
|
||||
<!-- trait RTSPMediaFactoryExt::fn set_buffer_size -->
|
||||
Set the kernel UDP buffer size.
|
||||
## `size`
|
||||
|
@ -1176,6 +1338,12 @@ Configures a specific clock to be used by the pipelines
|
|||
of all medias created from this factory.
|
||||
## `clock`
|
||||
the clock to be used by the media factory
|
||||
<!-- trait RTSPMediaFactoryExt::fn set_do_retransmission -->
|
||||
Set whether retransmission requests will be sent for
|
||||
receiving media
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait RTSPMediaFactoryExt::fn set_eos_shutdown -->
|
||||
Configure if media created from this factory will have an EOS sent to the
|
||||
pipeline before shutdown.
|
||||
|
@ -1197,6 +1365,17 @@ The description should return a pipeline with payloaders named pay0, pay1,
|
|||
etc.. Each of the payloaders will result in a stream.
|
||||
## `launch`
|
||||
the launch description
|
||||
<!-- trait RTSPMediaFactoryExt::fn set_max_mcast_ttl -->
|
||||
Set the maximum time-to-live value of outgoing multicast packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `ttl`
|
||||
the new multicast ttl value
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the requested ttl has been set successfully.
|
||||
<!-- trait RTSPMediaFactoryExt::fn set_media_gtype -->
|
||||
Configure the GType of the GstRTSPMedia subclass to
|
||||
create (by default, overridden construct vmethods
|
||||
|
@ -1787,6 +1966,9 @@ valid until the session of `self` is unreffed.
|
|||
<!-- trait RTSPSessionMediaExt::fn get_transports -->
|
||||
Get a list of all available `RTSPStreamTransport` in this session.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
a
|
||||
|
@ -1952,6 +2134,25 @@ a `gst::Pad`
|
|||
# Returns
|
||||
|
||||
a new `RTSPStream`
|
||||
<!-- trait RTSPStreamExt::fn add_multicast_client_address -->
|
||||
Add multicast client address to stream. At this point, the sockets that
|
||||
will stream RTP and RTCP data to `destination` are supposed to be
|
||||
allocated.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `destination`
|
||||
a multicast address to add
|
||||
## `rtp_port`
|
||||
RTP port
|
||||
## `rtcp_port`
|
||||
RTCP port
|
||||
## `family`
|
||||
socket family
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `destination` can be addedd and handled by `self`.
|
||||
<!-- trait RTSPStreamExt::fn add_transport -->
|
||||
Add the transport in `trans` to `self`. The media of `self` will
|
||||
then also be send to the values configured in `trans`.
|
||||
|
@ -1980,6 +2181,9 @@ Whether to use client settings or not
|
|||
<!-- trait RTSPStreamExt::fn complete_stream -->
|
||||
Add a receiver and sender part to the pipeline based on the transport from
|
||||
SETUP.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `transport`
|
||||
a `gst_rtsp::RTSPTransport`
|
||||
|
||||
|
@ -2030,6 +2234,15 @@ Get the previous joined bin with `RTSPStreamExt::join_bin` or NULL.
|
|||
# Returns
|
||||
|
||||
the joined bin or NULL.
|
||||
<!-- trait RTSPStreamExt::fn get_max_mcast_ttl -->
|
||||
Get the the maximum time-to-live value of outgoing multicast packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the maximum time-to-live value of outgoing multicast packets.
|
||||
<!-- trait RTSPStreamExt::fn get_mtu -->
|
||||
Get the configured MTU in the payloader of `self`.
|
||||
|
||||
|
@ -2048,6 +2261,15 @@ the `gio::SocketFamily`
|
|||
the `RTSPAddress` of `self`
|
||||
or `None` when no address could be allocated. `RTSPAddress::free`
|
||||
after usage.
|
||||
<!-- trait RTSPStreamExt::fn get_multicast_client_addresses -->
|
||||
Get all multicast client addresses that RTP data will be sent to
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
A comma separated list of host:port pairs with destinations
|
||||
<!-- trait RTSPStreamExt::fn get_multicast_iface -->
|
||||
Get the multicast interface used for `self`.
|
||||
|
||||
|
@ -2093,6 +2315,9 @@ Get the amount of time to store retransmission data.
|
|||
the amount of time to store retransmission data.
|
||||
<!-- trait RTSPStreamExt::fn get_rtcp_multicast_socket -->
|
||||
Get the multicast RTCP socket from `self` for a `family`.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
## `family`
|
||||
the socket family
|
||||
|
||||
|
@ -2119,6 +2344,7 @@ the socket family
|
|||
# Returns
|
||||
|
||||
the multicast RTP socket or `None` if no
|
||||
|
||||
socket could be allocated for `family`. Unref after usage
|
||||
<!-- trait RTSPStreamExt::fn get_rtp_socket -->
|
||||
Get the RTP socket from `self` for a `family`.
|
||||
|
@ -2182,6 +2408,30 @@ Get the SSRC used by the RTP session of this stream. This function can only
|
|||
be called when `self` has been joined.
|
||||
## `ssrc`
|
||||
result ssrc
|
||||
<!-- trait RTSPStreamExt::fn get_ulpfec_percentage -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the amount of redundancy applied when creating ULPFEC
|
||||
protection packets.
|
||||
<!-- trait RTSPStreamExt::fn get_ulpfec_pt -->
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
the payload type used for ULPFEC protection packets
|
||||
<!-- trait RTSPStreamExt::fn handle_keymgmt -->
|
||||
Parse and handle a KeyMgmt header.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `keymgmt`
|
||||
a keymgmt header
|
||||
<!-- trait RTSPStreamExt::fn has_control -->
|
||||
Check if `self` has the control string `control`.
|
||||
## `control`
|
||||
|
@ -2190,6 +2440,15 @@ a control string
|
|||
# Returns
|
||||
|
||||
`true` is `self` has `control` as the control string
|
||||
<!-- trait RTSPStreamExt::fn is_bind_mcast_address -->
|
||||
Check if multicast sockets are configured to be bound to multicast addresses.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if multicast sockets are configured to be bound to multicast addresses.
|
||||
<!-- trait RTSPStreamExt::fn is_blocking -->
|
||||
Check if `self` is blocking on a `gst::Buffer`.
|
||||
|
||||
|
@ -2207,18 +2466,27 @@ Checks whether the stream is complete, contains the receiver and the sender
|
|||
parts. As the stream contains sink(s) element(s), it's possible to perform
|
||||
seek operations on it.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the stream contains at least one sink element.
|
||||
<!-- trait RTSPStreamExt::fn is_receiver -->
|
||||
Checks whether the stream is a receiver.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the stream is a receiver and `false` otherwise.
|
||||
<!-- trait RTSPStreamExt::fn is_sender -->
|
||||
Checks whether the stream is a sender.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the stream is a sender and `false` otherwise.
|
||||
|
@ -2308,11 +2576,40 @@ a `RTSPStreamTransport`
|
|||
# Returns
|
||||
|
||||
`true` if `trans` was removed
|
||||
<!-- trait RTSPStreamExt::fn request_aux_receiver -->
|
||||
Creating a rtxreceive bin
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `sessid`
|
||||
the session id
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::Element`.
|
||||
<!-- trait RTSPStreamExt::fn request_aux_sender -->
|
||||
Creating a rtxsend bin
|
||||
## `sessid`
|
||||
the session id
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::Element`.
|
||||
<!-- trait RTSPStreamExt::fn request_ulpfec_decoder -->
|
||||
Creating a rtpulpfecdec element
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::Element`.
|
||||
<!-- trait RTSPStreamExt::fn request_ulpfec_encoder -->
|
||||
Creating a rtpulpfecenc element
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
a `gst::Element`.
|
||||
|
@ -2332,10 +2629,14 @@ a TTL
|
|||
# Returns
|
||||
|
||||
the `RTSPAddress` of `self` or `None` when
|
||||
the address could be reserved. `RTSPAddress::free` after usage.
|
||||
the address could not be reserved. `RTSPAddress::free` after
|
||||
usage.
|
||||
<!-- trait RTSPStreamExt::fn seekable -->
|
||||
Checks whether the individual `self` is seekable.
|
||||
|
||||
Feature: `v1_14`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if `self` is seekable, else `false`.
|
||||
|
@ -2343,6 +2644,14 @@ Checks whether the individual `self` is seekable.
|
|||
configure `pool` to be used as the address pool of `self`.
|
||||
## `pool`
|
||||
a `RTSPAddressPool`
|
||||
<!-- trait RTSPStreamExt::fn set_bind_mcast_address -->
|
||||
Decide whether the multicast socket should be bound to a multicast address or
|
||||
INADDR_ANY.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `bind_mcast_addr`
|
||||
the new value
|
||||
<!-- trait RTSPStreamExt::fn set_blocked -->
|
||||
Blocks or unblocks the dataflow on `self`.
|
||||
## `blocked`
|
||||
|
@ -2373,6 +2682,17 @@ a control string
|
|||
Configure the dscp qos of the outgoing sockets to `dscp_qos`.
|
||||
## `dscp_qos`
|
||||
a new dscp qos value (0-63, or -1 to disable)
|
||||
<!-- trait RTSPStreamExt::fn set_max_mcast_ttl -->
|
||||
Set the maximum time-to-live value of outgoing multicast packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `ttl`
|
||||
the new multicast ttl value
|
||||
|
||||
# Returns
|
||||
|
||||
`true` if the requested ttl has been set successfully.
|
||||
<!-- trait RTSPStreamExt::fn set_mtu -->
|
||||
Configure the mtu in the payloader of `self` to `mtu`.
|
||||
## `mtu`
|
||||
|
@ -2407,6 +2727,17 @@ a `guint`
|
|||
Set the amount of time to store retransmission packets.
|
||||
## `time`
|
||||
a `gst::ClockTime`
|
||||
<!-- trait RTSPStreamExt::fn set_ulpfec_percentage -->
|
||||
Sets the amount of redundancy to apply when creating ULPFEC
|
||||
protection packets.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait RTSPStreamExt::fn set_ulpfec_pt -->
|
||||
Set the payload type to be used for ULPFEC protection packets
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait RTSPStreamExt::fn transport_filter -->
|
||||
Call `func` for each transport managed by `self`. The result value of `func`
|
||||
determines what happens to the transport. `func` will be called with `self`
|
||||
|
@ -2445,6 +2776,17 @@ a `gst::Caps` with crypto info
|
|||
# Returns
|
||||
|
||||
`true` if `crypto` could be updated
|
||||
<!-- trait RTSPStreamExt::fn verify_mcast_ttl -->
|
||||
Check if the requested multicast ttl value is allowed.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `ttl`
|
||||
a requested multicast ttl
|
||||
|
||||
# Returns
|
||||
|
||||
TRUE if the requested ttl value is allowed.
|
||||
<!-- struct RTSPStreamTransport -->
|
||||
A Transport description for a stream
|
||||
|
||||
|
@ -2506,6 +2848,11 @@ Check if `self` is timed out.
|
|||
`true` if `self` timed out.
|
||||
<!-- trait RTSPStreamTransportExt::fn keep_alive -->
|
||||
Signal the installed keep_alive callback for `self`.
|
||||
<!-- trait RTSPStreamTransportExt::fn message_sent -->
|
||||
Signal the installed message_sent callback for `self`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- trait RTSPStreamTransportExt::fn recv_data -->
|
||||
Receive `buffer` on `channel` `self`.
|
||||
## `channel`
|
||||
|
@ -2524,6 +2871,17 @@ a `gst::Buffer`
|
|||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- trait RTSPStreamTransportExt::fn send_rtcp_list -->
|
||||
Send `buffer_list` to the installed RTCP callback for `self`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `buffer_list`
|
||||
a `gst::Buffer`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- trait RTSPStreamTransportExt::fn send_rtp -->
|
||||
Send `buffer` to the installed RTP callback for `self`.
|
||||
|
@ -2532,6 +2890,17 @@ a `gst::Buffer`
|
|||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- trait RTSPStreamTransportExt::fn send_rtp_list -->
|
||||
Send `buffer_list` to the installed RTP callback for `self`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `buffer_list`
|
||||
a `gst::BufferList`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- trait RTSPStreamTransportExt::fn set_active -->
|
||||
Activate or deactivate datatransfer configured in `self`.
|
||||
|
@ -2561,6 +2930,28 @@ a callback called when the receiver is active
|
|||
user data passed to callback
|
||||
## `notify`
|
||||
called with the user_data when no longer needed.
|
||||
<!-- trait RTSPStreamTransportExt::fn set_list_callbacks -->
|
||||
Install callbacks that will be called when data for a stream should be sent
|
||||
to a client. This is usually used when sending RTP/RTCP over TCP.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `send_rtp_list`
|
||||
a callback called when RTP should be sent
|
||||
## `send_rtcp_list`
|
||||
a callback called when RTCP should be sent
|
||||
## `user_data`
|
||||
user data passed to callbacks
|
||||
## `notify`
|
||||
called with the user_data when no longer needed.
|
||||
<!-- trait RTSPStreamTransportExt::fn set_message_sent -->
|
||||
Install a callback that will be called when a message has been sent on `self`.
|
||||
## `message_sent`
|
||||
a callback called when a message has been sent
|
||||
## `user_data`
|
||||
user data passed to callback
|
||||
## `notify`
|
||||
called with the user_data when no longer needed
|
||||
<!-- trait RTSPStreamTransportExt::fn set_timed_out -->
|
||||
Set the timed out state of `self` to `timedout`
|
||||
## `timedout`
|
||||
|
|
|
@ -8,6 +8,7 @@ basic authentication
|
|||
<!-- enum RTSPAuthMethod::variant Digest -->
|
||||
digest authentication
|
||||
<!-- struct RTSPAuthParam -->
|
||||
RTSP Authentication parameter
|
||||
<!-- enum RTSPFamily -->
|
||||
The possible network families.
|
||||
<!-- enum RTSPFamily::variant None -->
|
||||
|
|
|
@ -1,565 +1 @@
|
|||
<!-- file * -->
|
||||
<!-- enum MIKEYCacheType -->
|
||||
The different cache types
|
||||
<!-- enum MIKEYCacheType::variant None -->
|
||||
The envelope key MUST NOT be cached
|
||||
<!-- enum MIKEYCacheType::variant Always -->
|
||||
The envelope key MUST be cached
|
||||
<!-- enum MIKEYCacheType::variant ForCsb -->
|
||||
The envelope key MUST be cached, but only
|
||||
to be used for the specific CSB.
|
||||
<!-- enum MIKEYEncAlg -->
|
||||
The encryption algorithm used to encrypt the Encr data field
|
||||
<!-- enum MIKEYEncAlg::variant Null -->
|
||||
no encryption
|
||||
<!-- enum MIKEYEncAlg::variant AesCm128 -->
|
||||
AES-CM using a 128-bit key
|
||||
<!-- enum MIKEYEncAlg::variant AesKw128 -->
|
||||
AES Key Wrap using a 128-bit key
|
||||
<!-- enum MIKEYKVType -->
|
||||
The key validity type
|
||||
<!-- enum MIKEYKVType::variant Null -->
|
||||
No specific usage rule
|
||||
<!-- enum MIKEYKVType::variant Spi -->
|
||||
The key is associated with the SPI/MKI
|
||||
<!-- enum MIKEYKVType::variant Interval -->
|
||||
The key has a start and expiration time
|
||||
<!-- enum MIKEYKeyDataType -->
|
||||
The type of key.
|
||||
<!-- enum MIKEYKeyDataType::variant Tgk -->
|
||||
a TEK Generation Key
|
||||
<!-- enum MIKEYKeyDataType::variant Tek -->
|
||||
Traffic-Encrypting Key
|
||||
<!-- enum MIKEYMacAlg -->
|
||||
Specifies the authentication algorithm used
|
||||
<!-- enum MIKEYMacAlg::variant Null -->
|
||||
no authentication
|
||||
<!-- enum MIKEYMacAlg::variant HmacSha1160 -->
|
||||
HMAC-SHA-1-160
|
||||
<!-- enum MIKEYMapType -->
|
||||
Specifies the method of uniquely mapping Crypto Sessions to the security
|
||||
protocol sessions.
|
||||
<!-- struct MIKEYMessage -->
|
||||
Structure holding the information of the MIKEY message
|
||||
<!-- impl MIKEYMessage::fn new -->
|
||||
Make a new MIKEY message.
|
||||
|
||||
# Returns
|
||||
|
||||
a new `MIKEYMessage` on success
|
||||
<!-- impl MIKEYMessage::fn new_from_bytes -->
|
||||
Make a new `MIKEYMessage` from `bytes`.
|
||||
## `bytes`
|
||||
a `glib::Bytes`
|
||||
## `info`
|
||||
a `MIKEYDecryptInfo`
|
||||
|
||||
# Returns
|
||||
|
||||
a new `MIKEYMessage`
|
||||
<!-- impl MIKEYMessage::fn new_from_caps -->
|
||||
Makes mikey message including:
|
||||
- Security Policy Payload
|
||||
- Key Data Transport Payload
|
||||
- Key Data Sub-Payload
|
||||
## `caps`
|
||||
a `gst::Caps`, including SRTP parameters (srtp/srtcp cipher, authorization, key data)
|
||||
|
||||
# Returns
|
||||
|
||||
a `MIKEYMessage`,
|
||||
or `None` if there is no srtp information in the caps.
|
||||
<!-- impl MIKEYMessage::fn new_from_data -->
|
||||
Parse `size` bytes from `data` into a `MIKEYMessage`. `info` contains the
|
||||
parameters to decrypt and verify the data.
|
||||
## `data`
|
||||
bytes to read
|
||||
## `size`
|
||||
length of `data`
|
||||
## `info`
|
||||
`MIKEYDecryptInfo`
|
||||
|
||||
# Returns
|
||||
|
||||
a `MIKEYMessage` on success or `None` when parsing failed and
|
||||
`error` will be set.
|
||||
<!-- impl MIKEYMessage::fn add_cs_srtp -->
|
||||
Add a Crypto policy for SRTP to `self`.
|
||||
## `policy`
|
||||
The security policy applied for the stream with `ssrc`
|
||||
## `ssrc`
|
||||
the SSRC that must be used for the stream
|
||||
## `roc`
|
||||
current rollover counter
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn add_payload -->
|
||||
Add a new payload to `self`.
|
||||
## `payload`
|
||||
a `MIKEYPayload`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn add_pke -->
|
||||
Add a new PKE payload to `self` with the given parameters.
|
||||
## `C`
|
||||
envelope key cache indicator
|
||||
## `data_len`
|
||||
the length of `data`
|
||||
## `data`
|
||||
the encrypted envelope key
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn add_rand -->
|
||||
Add a new RAND payload to `self` with the given parameters.
|
||||
## `len`
|
||||
the length of `rand`
|
||||
## `rand`
|
||||
random data
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn add_rand_len -->
|
||||
Add a new RAND payload to `self` with `len` random bytes.
|
||||
## `len`
|
||||
length
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn add_t -->
|
||||
Add a new T payload to `self` with the given parameters.
|
||||
## `type_`
|
||||
specifies the timestamp type used
|
||||
## `ts_value`
|
||||
The timestamp value of the specified `type_`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn add_t_now_ntp_utc -->
|
||||
Add a new T payload to `self` that contains the current time
|
||||
in NTP-UTC format.
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn base64_encode -->
|
||||
|
||||
# Returns
|
||||
|
||||
a `gchar`, base64-encoded data
|
||||
<!-- impl MIKEYMessage::fn find_payload -->
|
||||
Find the `nth` occurence of the payload with `type_` in `self`.
|
||||
## `type_`
|
||||
a `MIKEYPayloadType`
|
||||
## `nth`
|
||||
payload to find
|
||||
|
||||
# Returns
|
||||
|
||||
the `nth` `MIKEYPayload` of `type_`.
|
||||
<!-- impl MIKEYMessage::fn get_cs_srtp -->
|
||||
Get the policy information of `self` at `idx`.
|
||||
## `idx`
|
||||
an index
|
||||
|
||||
# Returns
|
||||
|
||||
a `MIKEYMapSRTP`
|
||||
<!-- impl MIKEYMessage::fn get_n_cs -->
|
||||
Get the number of crypto sessions in `self`.
|
||||
|
||||
# Returns
|
||||
|
||||
the number of crypto sessions
|
||||
<!-- impl MIKEYMessage::fn get_n_payloads -->
|
||||
Get the number of payloads in `self`.
|
||||
|
||||
# Returns
|
||||
|
||||
the number of payloads in `self`
|
||||
<!-- impl MIKEYMessage::fn get_payload -->
|
||||
Get the `MIKEYPayload` at `idx` in `self`
|
||||
## `idx`
|
||||
an index
|
||||
|
||||
# Returns
|
||||
|
||||
the `MIKEYPayload` at `idx`. The payload
|
||||
remains valid for as long as it is part of `self`.
|
||||
<!-- impl MIKEYMessage::fn insert_cs_srtp -->
|
||||
Insert a Crypto Session map for SRTP in `self` at `idx`
|
||||
|
||||
When `idx` is -1, the policy will be appended.
|
||||
## `idx`
|
||||
the index to insert at
|
||||
## `map`
|
||||
the map info
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn insert_payload -->
|
||||
Insert the `payload` at index `idx` in `self`. If `idx` is -1, the payload
|
||||
will be appended to `self`.
|
||||
## `idx`
|
||||
an index
|
||||
## `payload`
|
||||
a `MIKEYPayload`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn remove_cs_srtp -->
|
||||
Remove the SRTP policy at `idx`.
|
||||
## `idx`
|
||||
the index to remove
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn remove_payload -->
|
||||
Remove the payload in `self` at `idx`
|
||||
## `idx`
|
||||
an index
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn replace_cs_srtp -->
|
||||
Replace a Crypto Session map for SRTP in `self` at `idx` with `map`.
|
||||
## `idx`
|
||||
the index to insert at
|
||||
## `map`
|
||||
the map info
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn replace_payload -->
|
||||
Replace the payload at `idx` in `self` with `payload`.
|
||||
## `idx`
|
||||
an index
|
||||
## `payload`
|
||||
a `MIKEYPayload`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn set_info -->
|
||||
Set the information in `self`.
|
||||
## `version`
|
||||
a version
|
||||
## `type_`
|
||||
a `MIKEYType`
|
||||
## `V`
|
||||
verify flag
|
||||
## `prf_func`
|
||||
the `MIKEYPRFFunc` function to use
|
||||
## `CSB_id`
|
||||
the Crypto Session Bundle id
|
||||
## `map_type`
|
||||
the `GstMIKEYCSIDMapType`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYMessage::fn to_bytes -->
|
||||
Convert `self` to a `glib::Bytes`.
|
||||
## `info`
|
||||
a `MIKEYEncryptInfo`
|
||||
|
||||
# Returns
|
||||
|
||||
a new `glib::Bytes` for `self`.
|
||||
<!-- impl MIKEYMessage::fn to_caps -->
|
||||
|
||||
Feature: `v1_8_1`
|
||||
|
||||
## `caps`
|
||||
a `gst::Caps` to be filled with SRTP parameters (srtp/srtcp cipher, authorization, key data)
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- enum MIKEYPRFFunc -->
|
||||
The PRF function that has been/will be used for key derivation
|
||||
<!-- enum MIKEYPRFFunc::variant MikeyPrfMikey1 -->
|
||||
MIKEY-1 PRF function
|
||||
<!-- struct MIKEYPayload -->
|
||||
Hold the common fields for all payloads
|
||||
<!-- impl MIKEYPayload::fn new -->
|
||||
Make a new `MIKEYPayload` with `type_`.
|
||||
## `type_`
|
||||
a `MIKEYPayloadType`
|
||||
|
||||
# Returns
|
||||
|
||||
a new `MIKEYPayload` or `None` on failure.
|
||||
<!-- impl MIKEYPayload::fn kemac_add_sub -->
|
||||
Add a new sub payload to `self`.
|
||||
## `newpay`
|
||||
a `MIKEYPayload` to add
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success.
|
||||
<!-- impl MIKEYPayload::fn kemac_get_n_sub -->
|
||||
Get the number of sub payloads of `self`. `self` should be of type
|
||||
`MIKEYPayloadType::Kemac`.
|
||||
|
||||
# Returns
|
||||
|
||||
the number of sub payloads in `self`
|
||||
<!-- impl MIKEYPayload::fn kemac_get_sub -->
|
||||
Get the sub payload of `self` at `idx`. `self` should be of type
|
||||
`MIKEYPayloadType::Kemac`.
|
||||
## `idx`
|
||||
an index
|
||||
|
||||
# Returns
|
||||
|
||||
the `MIKEYPayload` at `idx`.
|
||||
<!-- impl MIKEYPayload::fn kemac_remove_sub -->
|
||||
Remove the sub payload at `idx` in `self`.
|
||||
## `idx`
|
||||
the index to remove
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success.
|
||||
<!-- impl MIKEYPayload::fn kemac_set -->
|
||||
Set the KEMAC parameters. `self` should point to a `MIKEYPayloadType::Kemac`
|
||||
payload.
|
||||
## `enc_alg`
|
||||
the `MIKEYEncAlg`
|
||||
## `mac_alg`
|
||||
a `MIKEYMacAlg`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn key_data_set_interval -->
|
||||
Set the key validity period in the `MIKEYPayloadType::KeyData` `self`.
|
||||
## `vf_len`
|
||||
the length of `vf_data`
|
||||
## `vf_data`
|
||||
the Valid From data
|
||||
## `vt_len`
|
||||
the length of `vt_data`
|
||||
## `vt_data`
|
||||
the Valid To data
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn key_data_set_key -->
|
||||
Set `key_len` bytes of `key_data` of type `key_type` as the key for the
|
||||
`MIKEYPayloadType::KeyData` `self`.
|
||||
## `key_type`
|
||||
a `MIKEYKeyDataType`
|
||||
## `key_len`
|
||||
the length of `key_data`
|
||||
## `key_data`
|
||||
the key of type `key_type`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn key_data_set_salt -->
|
||||
Set the salt key data. If `salt_len` is 0 and `salt_data` is `None`, the
|
||||
salt data will be removed.
|
||||
## `salt_len`
|
||||
the length of `salt_data`
|
||||
## `salt_data`
|
||||
the salt
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn key_data_set_spi -->
|
||||
Set the SPI/MKI validity in the `MIKEYPayloadType::KeyData` `self`.
|
||||
## `spi_len`
|
||||
the length of `spi_data`
|
||||
## `spi_data`
|
||||
the SPI/MKI data
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn pke_set -->
|
||||
Set the PKE values in `self`. `self` must be of type
|
||||
`MIKEYPayloadType::Pke`.
|
||||
## `C`
|
||||
envelope key cache indicator
|
||||
## `data_len`
|
||||
the length of `data`
|
||||
## `data`
|
||||
the encrypted envelope key
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn rand_set -->
|
||||
Set the random values in a `MIKEYPayloadType::Rand` `self`.
|
||||
## `len`
|
||||
the length of `rand`
|
||||
## `rand`
|
||||
random values
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn sp_add_param -->
|
||||
Add a new parameter to the `MIKEYPayloadType::Sp` `self` with `type_`, `len`
|
||||
and `val`.
|
||||
## `type_`
|
||||
a type
|
||||
## `len`
|
||||
a length
|
||||
## `val`
|
||||
`len` bytes of data
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn sp_get_n_params -->
|
||||
Get the number of security policy parameters in a `MIKEYPayloadType::Sp`
|
||||
`self`.
|
||||
|
||||
# Returns
|
||||
|
||||
the number of parameters in `self`
|
||||
<!-- impl MIKEYPayload::fn sp_get_param -->
|
||||
Get the Security Policy parameter in a `MIKEYPayloadType::Sp` `self`
|
||||
at `idx`.
|
||||
## `idx`
|
||||
an index
|
||||
|
||||
# Returns
|
||||
|
||||
the `MIKEYPayloadSPParam` at `idx` in `self`
|
||||
<!-- impl MIKEYPayload::fn sp_remove_param -->
|
||||
Remove the Security Policy parameters from a `MIKEYPayloadType::Sp`
|
||||
`self` at `idx`.
|
||||
## `idx`
|
||||
an index
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn sp_set -->
|
||||
Set the Security Policy parameters for `self`.
|
||||
## `policy`
|
||||
the policy number
|
||||
## `proto`
|
||||
a `MIKEYSecProto`
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- impl MIKEYPayload::fn t_set -->
|
||||
Set the timestamp in a `MIKEYPayloadType::T` `self`.
|
||||
## `type_`
|
||||
the `MIKEYTSType`
|
||||
## `ts_value`
|
||||
the timestamp value
|
||||
|
||||
# Returns
|
||||
|
||||
`true` on success
|
||||
<!-- enum MIKEYPayloadType -->
|
||||
Different MIKEY Payload types.
|
||||
<!-- enum MIKEYPayloadType::variant Last -->
|
||||
Last payload
|
||||
<!-- enum MIKEYPayloadType::variant Kemac -->
|
||||
Key data transport payload
|
||||
<!-- enum MIKEYPayloadType::variant Pke -->
|
||||
Envelope data payload
|
||||
<!-- enum MIKEYPayloadType::variant Dh -->
|
||||
DH data payload
|
||||
<!-- enum MIKEYPayloadType::variant Sign -->
|
||||
Signature payload
|
||||
<!-- enum MIKEYPayloadType::variant T -->
|
||||
Timestamp payload
|
||||
<!-- enum MIKEYPayloadType::variant Id -->
|
||||
ID payload
|
||||
<!-- enum MIKEYPayloadType::variant Cert -->
|
||||
Certificate Payload
|
||||
<!-- enum MIKEYPayloadType::variant Chash -->
|
||||
Cert hash payload
|
||||
<!-- enum MIKEYPayloadType::variant V -->
|
||||
Verfication message payload
|
||||
<!-- enum MIKEYPayloadType::variant Sp -->
|
||||
Security Policy payload
|
||||
<!-- enum MIKEYPayloadType::variant Rand -->
|
||||
RAND payload
|
||||
<!-- enum MIKEYPayloadType::variant Err -->
|
||||
Error payload
|
||||
<!-- enum MIKEYPayloadType::variant KeyData -->
|
||||
Key data sub-payload
|
||||
<!-- enum MIKEYPayloadType::variant GenExt -->
|
||||
General Extension Payload
|
||||
<!-- enum MIKEYSecProto -->
|
||||
Specifies the security protocol
|
||||
<!-- enum MIKEYSecSRTP -->
|
||||
This policy specifies the parameters for SRTP and SRTCP
|
||||
<!-- enum MIKEYSecSRTP::variant EncAlg -->
|
||||
Encryption algorithm
|
||||
<!-- enum MIKEYSecSRTP::variant EncKeyLen -->
|
||||
Session Encr. key length
|
||||
<!-- enum MIKEYSecSRTP::variant AuthAlg -->
|
||||
Authentication algorithm
|
||||
<!-- enum MIKEYSecSRTP::variant AuthKeyLen -->
|
||||
Session Auth. key length
|
||||
<!-- enum MIKEYSecSRTP::variant SaltKeyLen -->
|
||||
Session Salt key length
|
||||
<!-- enum MIKEYSecSRTP::variant Prf -->
|
||||
SRTP Pseudo Random Function
|
||||
<!-- enum MIKEYSecSRTP::variant KeyDerivRate -->
|
||||
Key derivation rate
|
||||
<!-- enum MIKEYSecSRTP::variant SrtpEnc -->
|
||||
SRTP encryption off/on, 0 if off, 1 if on
|
||||
<!-- enum MIKEYSecSRTP::variant SrtcpEnc -->
|
||||
SRTCP encryption off/on, 0 if off, 1 if on
|
||||
<!-- enum MIKEYSecSRTP::variant FecOrder -->
|
||||
sender's FEC order
|
||||
<!-- enum MIKEYSecSRTP::variant SrtpAuth -->
|
||||
SRTP authentication off/on, 0 if off, 1 if on
|
||||
<!-- enum MIKEYSecSRTP::variant AuthTagLen -->
|
||||
Authentication tag length
|
||||
<!-- enum MIKEYSecSRTP::variant SrtpPrefixLen -->
|
||||
SRTP prefix length
|
||||
<!-- enum MIKEYTSType -->
|
||||
Specifies the timestamp type.
|
||||
<!-- enum MIKEYTSType::variant NtpUtc -->
|
||||
an NTP time in UTC timezone
|
||||
<!-- enum MIKEYTSType::variant Ntp -->
|
||||
an NTP time
|
||||
<!-- enum MIKEYTSType::variant Counter -->
|
||||
a counter
|
||||
<!-- enum MIKEYType -->
|
||||
Different MIKEY data types.
|
||||
<!-- enum MIKEYType::variant Invalid -->
|
||||
Invalid type
|
||||
<!-- enum MIKEYType::variant PskInit -->
|
||||
Initiator's pre-shared key message
|
||||
<!-- enum MIKEYType::variant PskVerify -->
|
||||
Verification message of a Pre-shared key message
|
||||
<!-- enum MIKEYType::variant PkInit -->
|
||||
Initiator's public-key transport message
|
||||
<!-- enum MIKEYType::variant PkVerify -->
|
||||
Verification message of a public-key message
|
||||
<!-- enum MIKEYType::variant DhInit -->
|
||||
Initiator's DH exchange message
|
||||
<!-- enum MIKEYType::variant DhResp -->
|
||||
Responder's DH exchange message
|
||||
<!-- enum MIKEYType::variant Error -->
|
||||
Error message
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,74 @@
|
|||
<!-- file * -->
|
||||
<!-- struct Allocator -->
|
||||
Memory is usually created by allocators with a `AllocatorExt::alloc`
|
||||
method call. When `None` is used as the allocator, the default allocator will
|
||||
be used.
|
||||
|
||||
New allocators can be registered with `Allocator::register`.
|
||||
Allocators are identified by name and can be retrieved with
|
||||
`Allocator::find`. `AllocatorExt::set_default` can be used to change the
|
||||
default allocator.
|
||||
|
||||
New memory can be created with `Memory::new_wrapped` that wraps the memory
|
||||
allocated elsewhere.
|
||||
|
||||
# Implements
|
||||
|
||||
[`AllocatorExt`](trait.AllocatorExt.html), [`GstObjectExt`](trait.GstObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
|
||||
<!-- trait AllocatorExt -->
|
||||
Trait containing all `Allocator` methods.
|
||||
|
||||
# Implementors
|
||||
|
||||
[`Allocator`](struct.Allocator.html)
|
||||
<!-- impl Allocator::fn find -->
|
||||
Find a previously registered allocator with `name`. When `name` is `None`, the
|
||||
default allocator will be returned.
|
||||
## `name`
|
||||
the name of the allocator
|
||||
|
||||
# Returns
|
||||
|
||||
a `Allocator` or `None` when
|
||||
the allocator with `name` was not registered. Use `GstObjectExt::unref`
|
||||
to release the allocator after usage.
|
||||
<!-- impl Allocator::fn register -->
|
||||
Registers the memory `allocator` with `name`. This function takes ownership of
|
||||
`allocator`.
|
||||
## `name`
|
||||
the name of the allocator
|
||||
## `allocator`
|
||||
`Allocator`
|
||||
<!-- trait AllocatorExt::fn alloc -->
|
||||
Use `self` to allocate a new memory block with memory that is at least
|
||||
`size` big.
|
||||
|
||||
The optional `params` can specify the prefix and padding for the memory. If
|
||||
`None` is passed, no flags, no extra prefix/padding and a default alignment is
|
||||
used.
|
||||
|
||||
The prefix/padding will be filled with 0 if flags contains
|
||||
`MemoryFlags::ZeroPrefixed` and `MemoryFlags::ZeroPadded` respectively.
|
||||
|
||||
When `self` is `None`, the default allocator will be used.
|
||||
|
||||
The alignment in `params` is given as a bitmask so that `align` + 1 equals
|
||||
the amount of bytes to align to. For example, to align to 8 bytes,
|
||||
use an alignment of 7.
|
||||
## `size`
|
||||
size of the visible memory area
|
||||
## `params`
|
||||
optional parameters
|
||||
|
||||
# Returns
|
||||
|
||||
a new `Memory`.
|
||||
<!-- trait AllocatorExt::fn free -->
|
||||
Free `memory` that was previously allocated with `AllocatorExt::alloc`.
|
||||
## `memory`
|
||||
the memory to free
|
||||
<!-- trait AllocatorExt::fn set_default -->
|
||||
Set the default allocator. This function takes ownership of `self`.
|
||||
<!-- struct Bin -->
|
||||
`Bin` is an element that can contain other `Element`, allowing them to be
|
||||
managed as a group.
|
||||
|
@ -487,7 +557,7 @@ to hold a reference to another buffer that is only released when the child
|
|||
Typically, `ParentBufferMeta` is used when the child buffer is directly
|
||||
using the `Memory` of the parent buffer, and wants to prevent the parent
|
||||
buffer from being returned to a buffer pool until the `Memory` is available
|
||||
for re-use. (Since 1.6)
|
||||
for re-use. (Since: 1.6)
|
||||
<!-- impl Buffer::fn new -->
|
||||
Creates a newly allocated buffer without any data.
|
||||
|
||||
|
@ -531,6 +601,20 @@ allocated size of `data`
|
|||
# Returns
|
||||
|
||||
a new `Buffer`
|
||||
<!-- impl Buffer::fn new_wrapped_bytes -->
|
||||
Creates a new `Buffer` that wraps the given `bytes`. The data inside
|
||||
`bytes` cannot be `None` and the resulting buffer will be marked as read only.
|
||||
|
||||
MT safe.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `bytes`
|
||||
a `glib::Bytes` to wrap
|
||||
|
||||
# Returns
|
||||
|
||||
a new `Buffer` wrapping `bytes`
|
||||
<!-- impl Buffer::fn new_wrapped_full -->
|
||||
Allocate a new buffer that wraps the given memory. `data` must point to
|
||||
`maxsize` of memory, the wrapped buffer will have the region from `offset` and
|
||||
|
@ -2111,9 +2195,25 @@ a `Caps` to intersect
|
|||
# Returns
|
||||
|
||||
`true` if intersection would be not empty
|
||||
<!-- impl Caps::fn copy -->
|
||||
Creates a new `Caps` as a copy of the old `self`. The new caps will have a
|
||||
refcount of 1, owned by the caller. The structures are copied as well.
|
||||
|
||||
Note that this function is the semantic equivalent of a `gst_caps_ref`
|
||||
followed by a `gst_caps_make_writable`. If you only want to hold on to a
|
||||
reference to the data, you should use `gst_caps_ref`.
|
||||
|
||||
When you are finished with the caps, call `gst_caps_unref` on it.
|
||||
|
||||
# Returns
|
||||
|
||||
the new `Caps`
|
||||
<!-- impl Caps::fn copy_nth -->
|
||||
Creates a new `Caps` and appends a copy of the nth structure
|
||||
contained in `self`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `nth`
|
||||
the nth structure to copy
|
||||
|
||||
|
@ -2373,6 +2473,13 @@ Index of the structure to remove
|
|||
Sets the `CapsFeatures` `features` for the structure at `index`.
|
||||
## `index`
|
||||
the index of the structure
|
||||
## `features`
|
||||
the `CapsFeatures` to set
|
||||
<!-- impl Caps::fn set_features_simple -->
|
||||
Sets the `CapsFeatures` `features` for all the structures of `self`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `features`
|
||||
the `CapsFeatures` to set
|
||||
<!-- impl Caps::fn set_simple -->
|
||||
|
@ -2722,6 +2829,20 @@ A `ClockID` to compare with
|
|||
|
||||
negative value if a < b; zero if a = b; positive value if a > b
|
||||
|
||||
MT safe.
|
||||
<!-- impl Clock::fn id_get_clock -->
|
||||
This function returns the underlying clock.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `id`
|
||||
a `ClockID`
|
||||
|
||||
# Returns
|
||||
|
||||
a `Clock` or `None` when the
|
||||
underlying clock has been freed. Unref after usage.
|
||||
|
||||
MT safe.
|
||||
<!-- impl Clock::fn id_get_time -->
|
||||
Get the time of the clock ID
|
||||
|
@ -2759,6 +2880,24 @@ async notifications, you need to create a new `ClockID`.
|
|||
MT safe.
|
||||
## `id`
|
||||
The id to unschedule
|
||||
<!-- impl Clock::fn id_uses_clock -->
|
||||
This function returns whether `id` uses `clock` as the underlying clock.
|
||||
`clock` can be NULL, in which case the return value indicates whether
|
||||
the underlying clock has been freed. If this is the case, the `id` is
|
||||
no longer usable and should be freed.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `id`
|
||||
a `ClockID` to check
|
||||
## `clock`
|
||||
a `Clock` to compare against
|
||||
|
||||
# Returns
|
||||
|
||||
whether the clock `id` uses the same underlying `Clock` `clock`.
|
||||
|
||||
MT safe.
|
||||
<!-- impl Clock::fn id_wait -->
|
||||
Perform a blocking wait on `id`.
|
||||
`id` should have been created with `ClockExt::new_single_shot_id`
|
||||
|
@ -3186,7 +3325,7 @@ time since Epoch
|
|||
monotonic time since some unspecified starting
|
||||
point
|
||||
<!-- enum ClockType::variant Other -->
|
||||
some other time source is used (Since 1.0.5)
|
||||
some other time source is used (Since: 1.0.5)
|
||||
<!-- struct Context -->
|
||||
`Context` is a container object used to store contexts like a device
|
||||
context, a display server connection and similar concepts that should
|
||||
|
@ -3501,7 +3640,7 @@ the day of the gregorian month
|
|||
the newly created `DateTime`
|
||||
<!-- impl DateTime::fn get_day -->
|
||||
Returns the day of the month of this `DateTime`.
|
||||
Call gst_date_time_has_day before, to avoid warnings.
|
||||
Call `DateTime::has_day` before, to avoid warnings.
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -3509,7 +3648,7 @@ The day of this `DateTime`
|
|||
<!-- impl DateTime::fn get_hour -->
|
||||
Retrieves the hour of the day represented by `self` in the gregorian
|
||||
calendar. The return is in the range of 0 to 23.
|
||||
Call gst_date_time_has_haur before, to avoid warnings.
|
||||
Call `DateTime::has_time` before, to avoid warnings.
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -3524,14 +3663,14 @@ the microsecond of the second
|
|||
<!-- impl DateTime::fn get_minute -->
|
||||
Retrieves the minute of the hour represented by `self` in the gregorian
|
||||
calendar.
|
||||
Call gst_date_time_has_minute before, to avoid warnings.
|
||||
Call `DateTime::has_time` before, to avoid warnings.
|
||||
|
||||
# Returns
|
||||
|
||||
the minute of the hour
|
||||
<!-- impl DateTime::fn get_month -->
|
||||
Returns the month of this `DateTime`. January is 1, February is 2, etc..
|
||||
Call gst_date_time_has_month before, to avoid warnings.
|
||||
Call `DateTime::has_month` before, to avoid warnings.
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -3539,7 +3678,7 @@ The month of this `DateTime`
|
|||
<!-- impl DateTime::fn get_second -->
|
||||
Retrieves the second of the minute represented by `self` in the gregorian
|
||||
calendar.
|
||||
Call gst_date_time_has_second before, to avoid warnings.
|
||||
Call `DateTime::has_time` before, to avoid warnings.
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -3555,7 +3694,7 @@ If `self` represents UTC time, then the offset is zero.
|
|||
the offset from UTC in hours
|
||||
<!-- impl DateTime::fn get_year -->
|
||||
Returns the year of this `DateTime`
|
||||
Call gst_date_time_has_year before, to avoid warnings.
|
||||
Call `DateTime::has_year` before, to avoid warnings.
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -3911,7 +4050,7 @@ will be emitted on the bus when the list of devices changes.
|
|||
Stops monitoring the devices.
|
||||
<!-- struct DeviceProvider -->
|
||||
A `DeviceProvider` subclass is provided by a plugin that handles devices
|
||||
if there is a way to programatically list connected devices. It can also
|
||||
if there is a way to programmatically list connected devices. It can also
|
||||
optionally provide updates to the list of connected devices.
|
||||
|
||||
Each `DeviceProvider` subclass is a singleton, a plugin should
|
||||
|
@ -3955,6 +4094,19 @@ This is for use by subclasses.
|
|||
will be removed (see `Object::ref_sink`).
|
||||
## `device`
|
||||
a `Device` that has been added
|
||||
<!-- trait DeviceProviderExt::fn device_changed -->
|
||||
This function is used when `changed_device` was modified into its new form
|
||||
`device`. This will post a `DEVICE_CHANGED` message on the bus to let
|
||||
the application know that the device was modified. `Device` is immutable
|
||||
for MT. safety purposes so this is an "atomic" way of letting the application
|
||||
know when a device was modified.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `device`
|
||||
the new version of `changed_device`
|
||||
## `changed_device`
|
||||
the old version of the device that has been udpated
|
||||
<!-- trait DeviceProviderExt::fn device_remove -->
|
||||
Posts a message on the provider's `Bus` to inform applications that
|
||||
a device has been removed.
|
||||
|
@ -4250,9 +4402,8 @@ MT safe.
|
|||
Adds a pad (link point) to `self`. `pad`'s parent will be set to `self`;
|
||||
see `GstObjectExt::set_parent` for refcounting information.
|
||||
|
||||
Pads are not automatically activated so elements should perform the needed
|
||||
steps to activate the pad in case this pad is added in the PAUSED or PLAYING
|
||||
state. See `PadExt::set_active` for more information about activating pads.
|
||||
Pads are automatically activated when added in the PAUSED or PLAYING
|
||||
state.
|
||||
|
||||
The pad and the element should be unlocked when calling this function.
|
||||
|
||||
|
@ -4503,7 +4654,7 @@ Retrieves the factory that was used to create this element.
|
|||
# Returns
|
||||
|
||||
the `ElementFactory` used for creating this
|
||||
element. no refcounting is needed.
|
||||
element or `None` if element has not been registered (static element). no refcounting is needed.
|
||||
<!-- trait ElementExt::fn get_metadata -->
|
||||
Get metadata with `key` in `klass`.
|
||||
|
||||
|
@ -5113,6 +5264,10 @@ the `Context` to set.
|
|||
Locks the state of an element, so state changes of the parent don't affect
|
||||
this element anymore.
|
||||
|
||||
Note that this is racy if the state lock of the parent bin is not taken.
|
||||
The parent bin might've just checked the flag in another thread and as the
|
||||
next step proceed to change the child element's state.
|
||||
|
||||
MT safe.
|
||||
## `locked_state`
|
||||
`true` to lock the element's state
|
||||
|
@ -6106,6 +6261,12 @@ result location for the start position expressed in `format`
|
|||
result location for the `SeekType` of the stop position
|
||||
## `stop`
|
||||
result location for the stop position expressed in `format`
|
||||
<!-- impl Event::fn parse_seek_trickmode_interval -->
|
||||
Retrieve the trickmode interval that may have been set on a
|
||||
seek event with `Event::set_seek_trickmode_interval`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- impl Event::fn parse_segment -->
|
||||
Parses a segment `self` and stores the result in the given `segment` location.
|
||||
`segment` remains valid only until the `self` is freed. Don't modify the segment
|
||||
|
@ -6148,7 +6309,7 @@ Parse a stream-start `self` and extract the `Stream` from it.
|
|||
Feature: `v1_10`
|
||||
|
||||
## `stream`
|
||||
adress of variable to store the stream
|
||||
address of variable to store the stream
|
||||
<!-- impl Event::fn parse_stream_collection -->
|
||||
Retrieve new `StreamCollection` from STREAM_COLLECTION event `self`.
|
||||
|
||||
|
@ -6208,6 +6369,13 @@ Set the running time offset of a event. See
|
|||
MT safe.
|
||||
## `offset`
|
||||
A the new running time offset
|
||||
<!-- impl Event::fn set_seek_trickmode_interval -->
|
||||
Sets a trickmode interval on a (writable) seek event. Elements
|
||||
that support TRICKMODE_KEY_UNITS seeks SHOULD use this as the minimal
|
||||
interval between each frame they may output.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
<!-- impl Event::fn set_seqnum -->
|
||||
Set the sequence number of a event.
|
||||
|
||||
|
@ -6268,7 +6436,7 @@ A new media segment follows in the dataflow. The
|
|||
converting buffer timestamps to running-time and
|
||||
stream-time.
|
||||
<!-- enum EventType::variant StreamCollection -->
|
||||
A new `StreamCollection` is available (Since 1.10)
|
||||
A new `StreamCollection` is available (Since: 1.10)
|
||||
<!-- enum EventType::variant Tag -->
|
||||
A new set of metadata tags has been found in the stream.
|
||||
<!-- enum EventType::variant Buffersize -->
|
||||
|
@ -6281,7 +6449,7 @@ An event that sinks turn into a message. Used to
|
|||
<!-- enum EventType::variant StreamGroupDone -->
|
||||
Indicates that there is no more data for
|
||||
the stream group ID in the message. Sent before EOS
|
||||
in some instances and should be handled mostly the same. (Since 1.10)
|
||||
in some instances and should be handled mostly the same. (Since: 1.10)
|
||||
<!-- enum EventType::variant Eos -->
|
||||
End-Of-Stream. No more data is to be expected to follow
|
||||
without either a STREAM_START event, or a FLUSH_STOP and a SEGMENT
|
||||
|
@ -6318,7 +6486,7 @@ A request for upstream renegotiating caps and reconfiguring.
|
|||
A request for a new playback position based on TOC
|
||||
entry's UID.
|
||||
<!-- enum EventType::variant SelectStreams -->
|
||||
A request to select one or more streams (Since 1.10)
|
||||
A request to select one or more streams (Since: 1.10)
|
||||
<!-- enum EventType::variant CustomUpstream -->
|
||||
Upstream custom event
|
||||
<!-- enum EventType::variant CustomDownstream -->
|
||||
|
@ -6693,6 +6861,22 @@ The new `Device`
|
|||
|
||||
# Returns
|
||||
|
||||
a newly allocated `Message`
|
||||
<!-- impl Message::fn new_device_changed -->
|
||||
Creates a new device-changed message. The device-changed message is produced
|
||||
by `DeviceProvider` or a `DeviceMonitor`. They announce that a device
|
||||
properties has changed and `device` represent the new modified version of `changed_device`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `src`
|
||||
The `Object` that created the message
|
||||
## `device`
|
||||
The newly created device representing `replaced_device`
|
||||
with its new configuration.
|
||||
|
||||
# Returns
|
||||
|
||||
a newly allocated `Message`
|
||||
<!-- impl Message::fn new_device_removed -->
|
||||
Creates a new device-removed message. The device-removed message is produced
|
||||
|
@ -6779,7 +6963,7 @@ The GError for this message.
|
|||
## `debug`
|
||||
A debugging string.
|
||||
## `details`
|
||||
(allow-none): A GstStructure with details
|
||||
A GstStructure with details
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -6824,7 +7008,7 @@ The GError for this message.
|
|||
## `debug`
|
||||
A debugging string.
|
||||
## `details`
|
||||
(allow-none): A GstStructure with details
|
||||
A GstStructure with details
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -7258,7 +7442,7 @@ The GError for this message.
|
|||
## `debug`
|
||||
A debugging string.
|
||||
## `details`
|
||||
(allow-none): A GstStructure with details
|
||||
A GstStructure with details
|
||||
|
||||
# Returns
|
||||
|
||||
|
@ -7388,6 +7572,20 @@ of monitored devices.
|
|||
## `device`
|
||||
A location where to store a
|
||||
pointer to the new `Device`, or `None`
|
||||
<!-- impl Message::fn parse_device_changed -->
|
||||
Parses a device-changed message. The device-changed message is produced by
|
||||
`DeviceProvider` or a `DeviceMonitor`. It announces the
|
||||
disappearance of monitored devices. * It announce that a device properties has
|
||||
changed and `device` represents the new modified version of `changed_device`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `device`
|
||||
A location where to store a
|
||||
pointer to the updated version of the `Device`, or `None`
|
||||
## `changed_device`
|
||||
A location where to store a
|
||||
pointer to the old version of the `Device`, or `None`
|
||||
<!-- impl Message::fn parse_device_removed -->
|
||||
Parses a device-removed message. The device-removed message is produced by
|
||||
`DeviceProvider` or a `DeviceMonitor`. It announces the
|
||||
|
@ -7931,7 +8129,7 @@ Trait containing all `Object` methods.
|
|||
|
||||
# Implementors
|
||||
|
||||
[`BufferPool`](struct.BufferPool.html), [`Bus`](struct.Bus.html), [`Clock`](struct.Clock.html), [`DeviceMonitor`](struct.DeviceMonitor.html), [`DeviceProvider`](struct.DeviceProvider.html), [`Device`](struct.Device.html), [`Element`](struct.Element.html), [`Object`](struct.Object.html), [`PadTemplate`](struct.PadTemplate.html), [`Pad`](struct.Pad.html), [`PluginFeature`](struct.PluginFeature.html), [`Plugin`](struct.Plugin.html), [`Registry`](struct.Registry.html), [`StreamCollection`](struct.StreamCollection.html), [`Stream`](struct.Stream.html)
|
||||
[`Allocator`](struct.Allocator.html), [`BufferPool`](struct.BufferPool.html), [`Bus`](struct.Bus.html), [`Clock`](struct.Clock.html), [`DeviceMonitor`](struct.DeviceMonitor.html), [`DeviceProvider`](struct.DeviceProvider.html), [`Device`](struct.Device.html), [`Element`](struct.Element.html), [`Object`](struct.Object.html), [`PadTemplate`](struct.PadTemplate.html), [`Pad`](struct.Pad.html), [`PluginFeature`](struct.PluginFeature.html), [`Plugin`](struct.Plugin.html), [`Registry`](struct.Registry.html), [`StreamCollection`](struct.StreamCollection.html), [`Stream`](struct.Stream.html)
|
||||
<!-- impl Object::fn check_uniqueness -->
|
||||
Checks to see if there is any object named `name` in `list`. This function
|
||||
does not do any locking of any kind. You might want to protect the
|
||||
|
@ -8012,7 +8210,7 @@ the `ControlBinding` that should be used
|
|||
has been setup for a non suitable property, `true` otherwise.
|
||||
<!-- trait GstObjectExt::fn default_error -->
|
||||
A default error function that uses `g_printerr` to display the error message
|
||||
and the optional debug sting..
|
||||
and the optional debug string..
|
||||
|
||||
The default handler will simply print the error string using g_print.
|
||||
## `error`
|
||||
|
@ -8032,7 +8230,7 @@ the `ControlBinding` for
|
|||
<!-- trait GstObjectExt::fn get_control_rate -->
|
||||
Obtain the control-rate for this `self`. Audio processing `Element`
|
||||
objects will use this rate to sub-divide their processing loop and call
|
||||
`GstObjectExt::sync_values` inbetween. The length of the processing segment
|
||||
`GstObjectExt::sync_values` in between. The length of the processing segment
|
||||
should be up to `control`-rate nanoseconds.
|
||||
|
||||
If the `self` is not under property control, this will return
|
||||
|
@ -8221,7 +8419,7 @@ or not.
|
|||
<!-- trait GstObjectExt::fn set_control_rate -->
|
||||
Change the control-rate for this `self`. Audio processing `Element`
|
||||
objects will use this rate to sub-divide their processing loop and call
|
||||
`GstObjectExt::sync_values` inbetween. The length of the processing segment
|
||||
`GstObjectExt::sync_values` in between. The length of the processing segment
|
||||
should be up to `control`-rate nanoseconds.
|
||||
|
||||
The control-rate should not change if the element is in `State::Paused` or
|
||||
|
@ -9430,6 +9628,10 @@ notify called when `query` will not be used anymore.
|
|||
<!-- trait PadExt::fn set_unlink_function_full -->
|
||||
Sets the given unlink function for the pad. It will be called
|
||||
when the pad is unlinked.
|
||||
|
||||
Note that the pad's lock is already held when the unlink
|
||||
function is called, so most pad functions cannot be called
|
||||
from within the callback.
|
||||
## `unlink`
|
||||
the `GstPadUnlinkFunction` to set.
|
||||
## `user_data`
|
||||
|
@ -10417,7 +10619,7 @@ a list of presets individual presets are read and overlaid in 1) system,
|
|||
2) application and 3) user order. Whenever an earlier entry is newer, the
|
||||
later entries will be updated. Since 1.8 you can also provide extra paths
|
||||
where to find presets through the GST_PRESET_PATH environment variable.
|
||||
Presets found in those paths will be concidered as "app presets".
|
||||
Presets found in those paths will be considered as "app presets".
|
||||
|
||||
# Implements
|
||||
|
||||
|
@ -10822,6 +11024,17 @@ the negotiated caps
|
|||
## `need_pool`
|
||||
return a pool
|
||||
|
||||
# Returns
|
||||
|
||||
a new `Query`
|
||||
<!-- impl Query::fn new_bitrate -->
|
||||
Constructs a new query object for querying the bitrate.
|
||||
|
||||
Free-function: `gst_query_unref`
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
|
||||
# Returns
|
||||
|
||||
a new `Query`
|
||||
|
@ -11138,6 +11351,13 @@ Pool details can be retrieved using `Query::get_n_allocation_pools` and
|
|||
The `Caps`
|
||||
## `need_pool`
|
||||
Whether a `BufferPool` is needed
|
||||
<!-- impl Query::fn parse_bitrate -->
|
||||
Get the results of a bitrate query. See also `Query::set_bitrate`.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `nominal_bitrate`
|
||||
The resulting bitrate in bits per second
|
||||
<!-- impl Query::fn parse_buffering_percent -->
|
||||
Get the percentage of buffered data. This is a value between 0 and 100.
|
||||
The `busy` indicator is `true` when the buffering is in progress.
|
||||
|
@ -11374,6 +11594,15 @@ position in the allocation pool array to remove
|
|||
Set `result` as the result for the `self`.
|
||||
## `result`
|
||||
the result to set
|
||||
<!-- impl Query::fn set_bitrate -->
|
||||
Set the results of a bitrate query. The nominal bitrate is the average
|
||||
bitrate expected over the length of the stream as advertised in file
|
||||
headers (or similar).
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `nominal_bitrate`
|
||||
the nominal bitrate in bits per second
|
||||
<!-- impl Query::fn set_buffering_percent -->
|
||||
Set the percentage of buffered data. This is a value between 0 and 100.
|
||||
The `busy` indicator is `true` when the buffering is in progress.
|
||||
|
@ -11875,7 +12104,7 @@ used when the resource has no space left.
|
|||
<!-- enum ResourceError::variant NotAuthorized -->
|
||||
used when the resource can't be opened
|
||||
due to missing authorization.
|
||||
(Since 1.2.4)
|
||||
(Since: 1.2.4)
|
||||
<!-- enum ResourceError::variant NumErrors -->
|
||||
the number of resource error types.
|
||||
<!-- struct Sample -->
|
||||
|
@ -11939,10 +12168,39 @@ Get the segment associated with `self`
|
|||
|
||||
the segment of `self`.
|
||||
The segment remains valid as long as `self` is valid.
|
||||
<!-- impl Sample::fn set_buffer -->
|
||||
Set the buffer associated with `self`. `self` must be writable.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `buffer`
|
||||
A `Buffer`
|
||||
<!-- impl Sample::fn set_buffer_list -->
|
||||
Set the buffer list associated with `self`
|
||||
Set the buffer list associated with `self`. `self` must be writable.
|
||||
## `buffer_list`
|
||||
a `BufferList`
|
||||
<!-- impl Sample::fn set_caps -->
|
||||
Set the caps associated with `self`. `self` must be writable.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `caps`
|
||||
A `Caps`
|
||||
<!-- impl Sample::fn set_info -->
|
||||
Set the info structure associated with `self`. `self` must be writable,
|
||||
and `info` must not have a parent set already.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `info`
|
||||
A `Structure`
|
||||
<!-- impl Sample::fn set_segment -->
|
||||
Set the segment associated with `self`. `self` must be writable.
|
||||
|
||||
Feature: `v1_16`
|
||||
|
||||
## `segment`
|
||||
A `Segment`
|
||||
<!-- enum SeekType -->
|
||||
The different types of seek events. When constructing a seek event with
|
||||
`Event::new_seek` or when doing gst_segment_do_seek ().
|
||||
|
@ -12259,7 +12517,7 @@ segment. Compared to `Segment::to_running_time` this function can return
|
|||
negative running-time.
|
||||
|
||||
This function is typically used by elements that need to synchronize buffers
|
||||
against the clock or eachother.
|
||||
against the clock or each other.
|
||||
|
||||
`position` can be any value and the result of this function for values outside
|
||||
of the segment is extrapolated.
|
||||
|
@ -12305,7 +12563,7 @@ segment. Compared to `Segment::to_stream_time` this function can return
|
|||
negative stream-time.
|
||||
|
||||
This function is typically used by elements that need to synchronize buffers
|
||||
against the clock or eachother.
|
||||
against the clock or each other.
|
||||
|
||||
`position` can be any value and the result of this function for values outside
|
||||
of the segment is extrapolated.
|
||||
|
@ -12406,17 +12664,17 @@ state change from READY to NULL.
|
|||
* Elements close devices
|
||||
* Elements reset any internal state.
|
||||
<!-- enum StateChange::variant NullToNull -->
|
||||
state change from NULL to NULL. (Since 1.14)
|
||||
state change from NULL to NULL. (Since: 1.14)
|
||||
<!-- enum StateChange::variant ReadyToReady -->
|
||||
state change from READY to READY,
|
||||
This might happen when going to PAUSED asynchronously failed, in that case
|
||||
elements should make sure they are in a proper, coherent READY state. (Since 1.14)
|
||||
elements should make sure they are in a proper, coherent READY state. (Since: 1.14)
|
||||
<!-- enum StateChange::variant PausedToPaused -->
|
||||
state change from PAUSED to PAUSED.
|
||||
This might happen when elements were in PLAYING state and 'lost state',
|
||||
they should make sure to go back to real 'PAUSED' state (prerolling for example). (Since 1.14)
|
||||
they should make sure to go back to real 'PAUSED' state (prerolling for example). (Since: 1.14)
|
||||
<!-- enum StateChange::variant PlayingToPlaying -->
|
||||
state change from PLAYING to PLAYING. (Since 1.14)
|
||||
state change from PLAYING to PLAYING. (Since: 1.14)
|
||||
<!-- enum StateChangeReturn -->
|
||||
The possible return values from a state change function such as
|
||||
`Element::set_state`. Only `StateChangeReturn::Failure` is a real failure.
|
||||
|
@ -12982,9 +13240,9 @@ the name of the first field to read
|
|||
than the type specified), otherwise `true`.
|
||||
<!-- impl Structure::fn get_array -->
|
||||
This is useful in language bindings where unknown `gobject::Value` types are not
|
||||
supported. This function will convert the `GST_TYPE_ARRAY` and
|
||||
`GST_TYPE_LIST` into a newly allocated `gobject::ValueArray` and return it through
|
||||
`array`. Be aware that this is slower then getting the `gobject::Value` directly.
|
||||
supported. This function will convert the `GST_TYPE_ARRAY` into a newly
|
||||
allocated `gobject::ValueArray` and return it through `array`. Be aware that this is
|
||||
slower then getting the `gobject::Value` directly.
|
||||
## `fieldname`
|
||||
the name of a field
|
||||
## `array`
|
||||
|
@ -12993,8 +13251,8 @@ a pointer to a `gobject::ValueArray`
|
|||
# Returns
|
||||
|
||||
`true` if the value could be set correctly. If there was no field
|
||||
with `fieldname` or the existing field did not contain an int, this function
|
||||
returns `false`.
|
||||
with `fieldname` or the existing field did not contain a `GST_TYPE_ARRAY`,
|
||||
this function returns `false`.
|
||||
<!-- impl Structure::fn get_boolean -->
|
||||
Sets the boolean pointed to by `value` corresponding to the value of the
|
||||
given field. Caller is responsible for making sure the field exists
|
||||
|
@ -13162,9 +13420,12 @@ with `fieldname` or the existing field did not contain a `gint64`, this function
|
|||
returns `false`.
|
||||
<!-- impl Structure::fn get_list -->
|
||||
This is useful in language bindings where unknown `gobject::Value` types are not
|
||||
supported. This function will convert the `GST_TYPE_ARRAY` and
|
||||
`GST_TYPE_LIST` into a newly allocated GValueArray and return it through
|
||||
`array`. Be aware that this is slower then getting the `gobject::Value` directly.
|
||||
supported. This function will convert the `GST_TYPE_LIST` into a newly
|
||||
allocated GValueArray and return it through `array`. Be aware that this is
|
||||
slower then getting the `gobject::Value` directly.
|
||||
|
||||
Feature: `v1_12`
|
||||
|
||||
## `fieldname`
|
||||
the name of a field
|
||||
## `array`
|
||||
|
@ -13173,10 +13434,8 @@ a pointer to a `gobject::ValueArray`
|
|||
# Returns
|
||||
|
||||
`true` if the value could be set correctly. If there was no field
|
||||
with `fieldname` or the existing field did not contain an int, this function
|
||||
returns `false`.
|
||||
|
||||
Since 1.12
|
||||
with `fieldname` or the existing field did not contain a `GST_TYPE_LIST`, this
|
||||
function returns `false`.
|
||||
<!-- impl Structure::fn get_name -->
|
||||
Get the name of `self` as a string.
|
||||
|
||||
|
@ -13455,18 +13714,20 @@ supported. This function will convert a `array` to `GST_TYPE_ARRAY` and set
|
|||
the field specified by `fieldname`. Be aware that this is slower then using
|
||||
`GST_TYPE_ARRAY` in a `gobject::Value` directly.
|
||||
|
||||
Since 1.12
|
||||
Feature: `v1_12`
|
||||
|
||||
## `fieldname`
|
||||
the name of a field
|
||||
## `array`
|
||||
a pointer to a `gobject::ValueArray`
|
||||
<!-- impl Structure::fn set_list -->
|
||||
This is useful in language bindings where unknown GValue types are not
|
||||
supported. This function will convert a `array` to `GST_TYPE_ARRAY` and set
|
||||
supported. This function will convert a `array` to `GST_TYPE_LIST` and set
|
||||
the field specified by `fieldname`. Be aware that this is slower then using
|
||||
`GST_TYPE_ARRAY` in a `gobject::Value` directly.
|
||||
`GST_TYPE_LIST` in a `gobject::Value` directly.
|
||||
|
||||
Feature: `v1_12`
|
||||
|
||||
Since 1.12
|
||||
## `fieldname`
|
||||
the name of a field
|
||||
## `array`
|
||||
|
@ -14263,6 +14524,13 @@ keep existing tags
|
|||
keep all existing tags
|
||||
<!-- enum TagMergeMode::variant Count -->
|
||||
the number of merge modes
|
||||
<!-- enum TagScope -->
|
||||
GstTagScope specifies if a taglist applies to the complete
|
||||
medium or only to one single stream.
|
||||
<!-- enum TagScope::variant Stream -->
|
||||
tags specific to this single stream
|
||||
<!-- enum TagScope::variant Global -->
|
||||
global tags for the complete medium
|
||||
<!-- struct TagSetter -->
|
||||
Element interface that allows setting of media metadata.
|
||||
|
||||
|
@ -14685,7 +14953,7 @@ unreffed before setting a new one.
|
|||
## `toc`
|
||||
a `Toc` to set.
|
||||
<!-- struct TypeFindFactory -->
|
||||
These functions allow querying informations about registered typefind
|
||||
These functions allow querying information about registered typefind
|
||||
functions. How to create and register these functions is described in
|
||||
the section <link linkend="gstreamer-Writing-typefind-functions">
|
||||
"Writing typefind functions"`</link>`.
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
[package]
|
||||
name = "examples"
|
||||
version = "0.14.0"
|
||||
version = "0.14.4"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
|
||||
[dependencies]
|
||||
glib = { git = "https://github.com/gtk-rs/glib", features = ["subclassing"] }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-gl = { path = "../gstreamer-gl", optional = true }
|
||||
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-editing-services = { path = "../gstreamer-editing-services", optional = true }
|
||||
gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true }
|
||||
gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true }
|
||||
gstreamer-rtsp-server-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"], optional = true }
|
||||
gtk = { git = "https://github.com/gtk-rs/gtk", optional = true }
|
||||
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true }
|
||||
gio = { git = "https://github.com/gtk-rs/gio", optional = true }
|
||||
glib = { version = "0.8", features = ["subclassing"] }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-gl = { version = "0.14", path = "../gstreamer-gl", optional = true }
|
||||
gstreamer-app = { version = "0.14", path = "../gstreamer-app" }
|
||||
gstreamer-audio = { version = "0.14", path = "../gstreamer-audio" }
|
||||
gstreamer-video = { version = "0.14", path = "../gstreamer-video" }
|
||||
gstreamer-pbutils = { version = "0.14", path = "../gstreamer-pbutils" }
|
||||
gstreamer-player = { version = "0.14", path = "../gstreamer-player", optional = true }
|
||||
gstreamer-editing-services = { version = "0.14", path = "../gstreamer-editing-services", optional = true }
|
||||
gstreamer-rtsp = { version = "0.14", path = "../gstreamer-rtsp", optional = true }
|
||||
gstreamer-rtsp-server = { version = "0.14", path = "../gstreamer-rtsp-server", optional = true }
|
||||
gstreamer-rtsp-server-sys = { version = "0.8", features = ["v1_8"], optional = true }
|
||||
gtk = { version = "0.7", optional = true }
|
||||
gdk = { version = "0.11", optional = true }
|
||||
gio = { version = "0.7", optional = true }
|
||||
futures-preview = { version = "0.3.0-alpha", optional = true }
|
||||
byte-slice-cast = "0.3"
|
||||
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.7", features=["use_glib"], optional = true }
|
||||
pango = { version = "0.7", optional = true }
|
||||
pangocairo = { version = "0.8", optional = true }
|
||||
glutin = { version = "0.21", optional = true }
|
||||
winit = { version = "0.19", optional = true }
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ fn example_main() {
|
|||
// We use an AbortHandle for having a Future that runs forever
|
||||
// until we call handle.abort() to quit our event loop
|
||||
let (quit_handle, quit_registration) = future::AbortHandle::new_pair();
|
||||
let quit_future = future::Abortable::new(future::empty::<()>(), quit_registration).map(|_| ());
|
||||
let quit_future =
|
||||
future::Abortable::new(future::pending::<()>(), quit_registration).map(|_| ());
|
||||
|
||||
// BusStream implements the Stream trait. Stream::for_each is calling a closure for each item
|
||||
// and returns a Future that resolves when the stream is done
|
||||
|
|
|
@ -43,6 +43,75 @@ use std::cell::RefCell;
|
|||
|
||||
use std::process;
|
||||
|
||||
#[cfg(all(target_os = "linux", feature = "gtkvideooverlay-x11"))]
|
||||
fn create_video_sink() -> gst::Element {
|
||||
// When we are on linux with the Xorg display server, we use the
|
||||
// X11 protocol's XV extension, which allows to overlay regions
|
||||
// with video streams. For this, we use the xvimagesink element.
|
||||
gst::ElementFactory::make("xvimagesink", None).unwrap()
|
||||
}
|
||||
#[cfg(all(target_os = "linux", feature = "gtkvideooverlay-x11"))]
|
||||
fn set_window_handle(video_overlay: &gst_video::VideoOverlay, gdk_window: &gdk::Window) {
|
||||
let display_type_name = gdk_window.get_display().get_type().name();
|
||||
|
||||
// Check if we're using X11 or ...
|
||||
if display_type_name == "GdkX11Display" {
|
||||
extern "C" {
|
||||
pub fn gdk_x11_window_get_xid(window: *mut glib::object::GObject) -> *mut c_void;
|
||||
}
|
||||
|
||||
// This is unsafe because the "window handle" we pass here is basically like a raw pointer.
|
||||
// If a wrong value were to be passed here (and you can pass any integer), then the window
|
||||
// system will most likely cause the application to crash.
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
// Here we ask gdk what native window handle we got assigned for
|
||||
// our video region from the window system, and then we will
|
||||
// pass this unique identifier to the overlay provided by our
|
||||
// sink - so the sink can then arrange the overlay.
|
||||
let xid = gdk_x11_window_get_xid(gdk_window.as_ptr() as *mut _);
|
||||
video_overlay.set_window_handle(xid as usize);
|
||||
}
|
||||
} else {
|
||||
println!("Add support for display type '{}'", display_type_name);
|
||||
process::exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "macos", feature = "gtkvideooverlay-quartz"))]
|
||||
fn create_video_sink() -> gst::Element {
|
||||
// On Mac, this is done by overlaying a window region with an
|
||||
// OpenGL-texture, using the glimagesink element.
|
||||
gst::ElementFactory::make("glimagesink", None).unwrap()
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "macos", feature = "gtkvideooverlay-quartz"))]
|
||||
fn set_window_handle(video_overlay: &gst_video::VideoOverlay, gdk_window: &gdk::Window) {
|
||||
let display_type_name = gdk_window.get_display().get_type().name();
|
||||
|
||||
if display_type_name == "GdkQuartzDisplay" {
|
||||
extern "C" {
|
||||
pub fn gdk_quartz_window_get_nsview(window: *mut glib::object::GObject) -> *mut c_void;
|
||||
}
|
||||
|
||||
// This is unsafe because the "window handle" we pass here is basically like a raw pointer.
|
||||
// If a wrong value were to be passed here (and you can pass any integer), then the window
|
||||
// system will most likely cause the application to crash.
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
// Here we ask gdk what native window handle we got assigned for
|
||||
// our video region from the windowing system, and then we will
|
||||
// pass this unique identifier to the overlay provided by our
|
||||
// sink - so the sink can then arrange the overlay.
|
||||
let window = gdk_quartz_window_get_nsview(gdk_window.as_ptr() as *mut _);
|
||||
video_overlay.set_window_handle(window as usize);
|
||||
}
|
||||
} else {
|
||||
println!("Unsupported display type '{}", display_type_name);
|
||||
process::exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
fn create_ui(app: >k::Application) {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let src = gst::ElementFactory::make("videotestsrc", None).unwrap();
|
||||
|
@ -50,18 +119,7 @@ fn create_ui(app: >k::Application) {
|
|||
// Since using the window system to overlay our gui window is making
|
||||
// direct contact with the windowing system, this is highly platform-
|
||||
// specific. This example supports Linux and Mac (using X11 and Quartz).
|
||||
let sink = if cfg!(feature = "gtkvideooverlay-x11") {
|
||||
// When we are on linux with the Xorg display server, we use the
|
||||
// X11 protocol's XV extension, which allows to overlay regions
|
||||
// with video streams. For this, we use the xvimagesink element.
|
||||
gst::ElementFactory::make("xvimagesink", None).unwrap()
|
||||
} else if cfg!(feature = "gtkvideooverlay-quartz") {
|
||||
// On Mac, this is done by overlaying a window region with an
|
||||
// OpenGL-texture, using the glimagesink element.
|
||||
gst::ElementFactory::make("glimagesink", None).unwrap()
|
||||
} else {
|
||||
unreachable!()
|
||||
};
|
||||
let sink = create_video_sink();
|
||||
|
||||
pipeline.add_many(&[&src, &sink]).unwrap();
|
||||
src.link(&sink).unwrap();
|
||||
|
@ -114,58 +172,7 @@ fn create_ui(app: >k::Application) {
|
|||
process::exit(-1);
|
||||
}
|
||||
|
||||
let display_type_name = gdk_window.get_display().get_type().name();
|
||||
|
||||
if cfg!(feature = "gtkvideooverlay-x11") {
|
||||
// Check if we're using X11 or ...
|
||||
if display_type_name == "GdkX11Display" {
|
||||
extern "C" {
|
||||
pub fn gdk_x11_window_get_xid(
|
||||
window: *mut glib::object::GObject,
|
||||
) -> *mut c_void;
|
||||
}
|
||||
|
||||
// This is unsafe because the "window handle" we pass here is basically like a raw pointer.
|
||||
// If a wrong value were to be passed here (and you can pass any integer), then the window
|
||||
// system will most likely cause the application to crash.
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
// Here we ask gdk what native window handle we got assigned for
|
||||
// our video region from the window system, and then we will
|
||||
// pass this unique identifier to the overlay provided by our
|
||||
// sink - so the sink can then arrange the overlay.
|
||||
let xid = gdk_x11_window_get_xid(gdk_window.as_ptr() as *mut _);
|
||||
video_overlay.set_window_handle(xid as usize);
|
||||
}
|
||||
} else {
|
||||
println!("Add support for display type '{}'", display_type_name);
|
||||
process::exit(-1);
|
||||
}
|
||||
} else if cfg!(feature = "gtkvideooverlay-quartz") {
|
||||
if display_type_name == "GdkQuartzDisplay" {
|
||||
extern "C" {
|
||||
pub fn gdk_quartz_window_get_nsview(
|
||||
window: *mut glib::object::GObject,
|
||||
) -> *mut c_void;
|
||||
}
|
||||
|
||||
// This is unsafe because the "window handle" we pass here is basically like a raw pointer.
|
||||
// If a wrong value were to be passed here (and you can pass any integer), then the window
|
||||
// system will most likely cause the application to crash.
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
// Here we ask gdk what native window handle we got assigned for
|
||||
// our video region from the windowing system, and then we will
|
||||
// pass this unique identifier to the overlay provided by our
|
||||
// sink - so the sink can then arrange the overlay.
|
||||
let window = gdk_quartz_window_get_nsview(gdk_window.as_ptr() as *mut _);
|
||||
video_overlay.set_window_handle(window as usize);
|
||||
}
|
||||
} else {
|
||||
println!("Unsupported display type '{}", display_type_name);
|
||||
process::exit(-1);
|
||||
}
|
||||
}
|
||||
set_window_handle(&video_overlay, &gdk_window);
|
||||
});
|
||||
|
||||
vbox.pack_start(&video_window, true, true, 0);
|
||||
|
|
2
gir
2
gir
|
@ -1 +1 @@
|
|||
Subproject commit e586ff8cc061a716f28ad3e37f5db8a0cf06fbf5
|
||||
Subproject commit 20feecf4fe8b4f3524715a0d4111f8c279666324
|
|
@ -10836,7 +10836,7 @@ aggregated by #GstDeviceMonitor objects.</doc>
|
|||
version="1.4">
|
||||
<doc xml:space="preserve">Creates the element with all of the required parameters set to use
|
||||
this device.</doc>
|
||||
<return-value transfer-ownership="full" nullable="1">
|
||||
<return-value transfer-ownership="none" nullable="1">
|
||||
<doc xml:space="preserve">a new #GstElement configured to use
|
||||
this device</doc>
|
||||
<type name="Element" c:type="GstElement*"/>
|
||||
|
|
|
@ -16,6 +16,7 @@ and/or use gtk-doc annotations. -->
|
|||
c:identifier-prefixes="Gst"
|
||||
c:symbol-prefixes="gst">
|
||||
<enumeration name="WebRTCBundlePolicy"
|
||||
version="1.16"
|
||||
glib:type-name="GstWebRTCBundlePolicy"
|
||||
glib:get-type="gst_webrtc_bundle_policy_get_type"
|
||||
c:type="GstWebRTCBundlePolicy">
|
||||
|
@ -215,6 +216,7 @@ GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED: connected</doc>
|
|||
</member>
|
||||
</enumeration>
|
||||
<enumeration name="WebRTCDataChannelState"
|
||||
version="1.16"
|
||||
glib:type-name="GstWebRTCDataChannelState"
|
||||
glib:get-type="gst_webrtc_data_channel_state_get_type"
|
||||
c:type="GstWebRTCDataChannelState">
|
||||
|
@ -251,6 +253,7 @@ See <ulink url="http://w3c.github.io/webrtc-pc/#dom-rtcdatachannelstate">h
|
|||
</member>
|
||||
</enumeration>
|
||||
<enumeration name="WebRTCFECType"
|
||||
version="1.14.1"
|
||||
glib:type-name="GstWebRTCFECType"
|
||||
glib:get-type="gst_webrtc_fec_type_get_type"
|
||||
c:type="GstWebRTCFECType">
|
||||
|
@ -533,6 +536,7 @@ GST_WEBRTC_ICE_ROLE_CONTROLLING: controlling</doc>
|
|||
</field>
|
||||
</record>
|
||||
<enumeration name="WebRTCICETransportPolicy"
|
||||
version="1.16"
|
||||
glib:type-name="GstWebRTCICETransportPolicy"
|
||||
glib:get-type="gst_webrtc_ice_transport_policy_get_type"
|
||||
c:type="GstWebRTCICETransportPolicy">
|
||||
|
@ -594,6 +598,7 @@ See <ulink url="http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectionstate"&g
|
|||
</member>
|
||||
</enumeration>
|
||||
<enumeration name="WebRTCPriorityType"
|
||||
version="1.16"
|
||||
glib:type-name="GstWebRTCPriorityType"
|
||||
glib:get-type="gst_webrtc_priority_type_get_type"
|
||||
c:type="GstWebRTCPriorityType">
|
||||
|
@ -866,6 +871,7 @@ See <ulink url="http://w3c.github.io/webrtc-pc/#dom-rtcprioritytype">http:
|
|||
</member>
|
||||
</enumeration>
|
||||
<enumeration name="WebRTCSCTPTransportState"
|
||||
version="1.16"
|
||||
glib:type-name="GstWebRTCSCTPTransportState"
|
||||
glib:get-type="gst_webrtc_sctp_transport_state_get_type"
|
||||
c:type="GstWebRTCSCTPTransportState">
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-app"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer App library"
|
||||
|
@ -15,13 +15,14 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-app-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-base = { path = "../gstreamer-base" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-app-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-base = { version = "0.14", path = "../gstreamer-base" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -67,7 +67,7 @@ pub struct AppSinkCallbacksBuilder {
|
|||
}
|
||||
|
||||
impl AppSinkCallbacksBuilder {
|
||||
pub fn eos<F: Fn(&AppSink) + Send + 'static>(self, eos: F) -> Self {
|
||||
pub fn eos<F: FnMut(&AppSink) + Send + 'static>(self, eos: F) -> Self {
|
||||
Self {
|
||||
eos: Some(RefCell::new(Box::new(eos))),
|
||||
..self
|
||||
|
@ -75,7 +75,7 @@ impl AppSinkCallbacksBuilder {
|
|||
}
|
||||
|
||||
pub fn new_preroll<
|
||||
F: Fn(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
||||
F: FnMut(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
||||
>(
|
||||
self,
|
||||
new_preroll: F,
|
||||
|
@ -87,7 +87,7 @@ impl AppSinkCallbacksBuilder {
|
|||
}
|
||||
|
||||
pub fn new_sample<
|
||||
F: Fn(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
||||
F: FnMut(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
||||
>(
|
||||
self,
|
||||
new_sample: F,
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-audio"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Audio library"
|
||||
|
@ -13,13 +13,16 @@ keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
|
|||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-audio-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-audio-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-base = { version = "0.14", path = "../gstreamer-base" }
|
||||
array-init = "0.0"
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
|
@ -35,3 +38,4 @@ v1_16 = ["gstreamer-sys/v1_16", "gstreamer-audio-sys/v1_16", "v1_14"]
|
|||
embed-lgpl-docs = ["rustdoc-stripper"]
|
||||
purge-lgpl-docs = ["rustdoc-stripper"]
|
||||
dox = ["gstreamer-audio-sys/dox", "glib/dox", "gstreamer/dox"]
|
||||
subclassing = ["gstreamer/subclassing"]
|
||||
|
|
253
gstreamer-audio/src/audio_decoder.rs
Normal file
253
gstreamer-audio/src/audio_decoder.rs
Normal file
|
@ -0,0 +1,253 @@
|
|||
// Copyright (C) 2019 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 glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_audio_sys;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use AudioDecoder;
|
||||
use AudioInfo;
|
||||
|
||||
extern "C" {
|
||||
fn _gst_audio_decoder_error(
|
||||
dec: *mut gst_audio_sys::GstAudioDecoder,
|
||||
weight: i32,
|
||||
domain: glib_sys::GQuark,
|
||||
code: i32,
|
||||
txt: *mut libc::c_char,
|
||||
debug: *mut libc::c_char,
|
||||
file: *const libc::c_char,
|
||||
function: *const libc::c_char,
|
||||
line: i32,
|
||||
) -> gst_sys::GstFlowReturn;
|
||||
}
|
||||
|
||||
pub trait AudioDecoderExtManual: 'static {
|
||||
fn finish_frame(
|
||||
&self,
|
||||
buffer: Option<gst::Buffer>,
|
||||
frames: i32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn finish_subframe(
|
||||
&self,
|
||||
buffer: Option<gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn negotiate(&self) -> Result<(), gst::FlowError>;
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn set_output_caps(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>;
|
||||
|
||||
fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError>;
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn error<T: gst::MessageErrorDomain>(
|
||||
&self,
|
||||
weight: i32,
|
||||
code: T,
|
||||
message: Option<&str>,
|
||||
debug: Option<&str>,
|
||||
file: &str,
|
||||
function: &str,
|
||||
line: u32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
}
|
||||
|
||||
impl<O: IsA<AudioDecoder>> AudioDecoderExtManual for O {
|
||||
fn finish_frame(
|
||||
&self,
|
||||
buffer: Option<gst::Buffer>,
|
||||
frames: i32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_finish_frame(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.map(|b| b.into_ptr()).unwrap_or(ptr::null_mut()),
|
||||
frames,
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn finish_subframe(
|
||||
&self,
|
||||
buffer: Option<gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_finish_subframe(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.map(|b| b.into_ptr()).unwrap_or(ptr::null_mut()),
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
fn negotiate(&self) -> Result<(), gst::FlowError> {
|
||||
unsafe {
|
||||
let ret = from_glib(gst_audio_sys::gst_audio_decoder_negotiate(
|
||||
self.as_ref().to_glib_none().0,
|
||||
));
|
||||
if ret {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
fn set_output_caps(&self, caps: &gst::Caps) -> Result<(), gst::FlowError> {
|
||||
unsafe {
|
||||
let ret = from_glib(gst_audio_sys::gst_audio_decoder_set_output_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
));
|
||||
if ret {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError> {
|
||||
unsafe {
|
||||
let ret = from_glib(gst_audio_sys::gst_audio_decoder_set_output_format(
|
||||
self.as_ref().to_glib_none().0,
|
||||
info.to_glib_none().0,
|
||||
));
|
||||
if ret {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
|
||||
unsafe {
|
||||
let mut allocator = ptr::null_mut();
|
||||
let mut params = mem::zeroed();
|
||||
gst_audio_sys::gst_audio_decoder_get_allocator(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut allocator,
|
||||
&mut params,
|
||||
);
|
||||
(from_glib_full(allocator), params.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn error<T: gst::MessageErrorDomain>(
|
||||
&self,
|
||||
weight: i32,
|
||||
code: T,
|
||||
message: Option<&str>,
|
||||
debug: Option<&str>,
|
||||
file: &str,
|
||||
function: &str,
|
||||
line: u32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(_gst_audio_decoder_error(
|
||||
self.as_ref().to_glib_none().0,
|
||||
weight,
|
||||
T::domain().to_glib(),
|
||||
code.code(),
|
||||
message.to_glib_full(),
|
||||
debug.to_glib_full(),
|
||||
file.to_glib_none().0,
|
||||
function.to_glib_none().0,
|
||||
line as i32,
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! gst_audio_decoder_error(
|
||||
($obj:expr, $weight:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
|
||||
use $crate::AudioDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some($msg),
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, ($msg:expr)) => { {
|
||||
use $crate::AudioDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some($msg),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, [$debug:expr]) => { {
|
||||
use $crate::AudioDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
None,
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
|
||||
use $crate::AudioDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some(&format!($($msg)*)),
|
||||
Some(&format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, ($($msg:tt)*)) => { {
|
||||
use $crate::AudioDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some(&format!($($msg)*)),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, [$($debug:tt)*]) => { {
|
||||
use $crate::AudioDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
None,
|
||||
Some(&format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
);
|
101
gstreamer-audio/src/audio_encoder.rs
Normal file
101
gstreamer-audio/src/audio_encoder.rs
Normal file
|
@ -0,0 +1,101 @@
|
|||
// Copyright (C) 2019 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 glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_audio_sys;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use AudioEncoder;
|
||||
|
||||
pub trait AudioEncoderExtManual: 'static {
|
||||
fn finish_frame(
|
||||
&self,
|
||||
buffer: Option<gst::Buffer>,
|
||||
frames: i32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn negotiate(&self) -> Result<(), gst::FlowError>;
|
||||
|
||||
fn set_output_format(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>;
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
|
||||
|
||||
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime);
|
||||
}
|
||||
|
||||
impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O {
|
||||
fn finish_frame(
|
||||
&self,
|
||||
buffer: Option<gst::Buffer>,
|
||||
frames: i32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_finish_frame(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.map(|b| b.into_ptr()).unwrap_or(ptr::null_mut()),
|
||||
frames,
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
|
||||
fn negotiate(&self) -> Result<(), gst::FlowError> {
|
||||
unsafe {
|
||||
let ret = from_glib(gst_audio_sys::gst_audio_encoder_negotiate(
|
||||
self.as_ref().to_glib_none().0,
|
||||
));
|
||||
if ret {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn set_output_format(&self, caps: &gst::Caps) -> Result<(), gst::FlowError> {
|
||||
unsafe {
|
||||
let ret = from_glib(gst_audio_sys::gst_audio_encoder_set_output_format(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
));
|
||||
if ret {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
|
||||
unsafe {
|
||||
let mut allocator = ptr::null_mut();
|
||||
let mut params = mem::zeroed();
|
||||
gst_audio_sys::gst_audio_encoder_get_allocator(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut allocator,
|
||||
&mut params,
|
||||
);
|
||||
(from_glib_full(allocator), params.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) {
|
||||
unsafe {
|
||||
let mut min = mem::uninitialized();
|
||||
let mut max = mem::uninitialized();
|
||||
gst_audio_sys::gst_audio_encoder_get_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut min,
|
||||
&mut max,
|
||||
);
|
||||
(from_glib(min), from_glib(max))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -220,7 +220,16 @@ impl Eq for AudioFormatInfo {}
|
|||
|
||||
impl fmt::Debug for AudioFormatInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
f.write_str(self.name())
|
||||
f.debug_struct("AudioFormatInfo")
|
||||
.field("format", &self.format())
|
||||
.field("name", &self.name())
|
||||
.field("description", &self.description())
|
||||
.field("flags", &self.flags())
|
||||
.field("endianness", &self.endianness())
|
||||
.field("width", &self.width())
|
||||
.field("depth", &self.depth())
|
||||
.field("silence", &self.silence())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ pub struct AudioInfo(gst_audio_sys::GstAudioInfo, [::AudioChannelPosition; 64]);
|
|||
impl fmt::Debug for AudioInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
f.debug_struct("AudioInfo")
|
||||
.field("format-info", &self.format_info())
|
||||
.field("rate", &self.rate())
|
||||
.field("channels", &self.channels())
|
||||
.field("positions", &self.positions())
|
||||
|
|
395
gstreamer-audio/src/auto/audio_decoder.rs
Normal file
395
gstreamer-audio/src/auto/audio_decoder.rs
Normal file
|
@ -0,0 +1,395 @@
|
|||
// 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 glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gst;
|
||||
use gst_audio_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use AudioInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct AudioDecoder(Object<gst_audio_sys::GstAudioDecoder, gst_audio_sys::GstAudioDecoderClass, AudioDecoderClass>) @extends gst::Element, gst::Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_audio_sys::gst_audio_decoder_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for AudioDecoder {}
|
||||
unsafe impl Sync for AudioDecoder {}
|
||||
|
||||
pub const NONE_AUDIO_DECODER: Option<&AudioDecoder> = None;
|
||||
|
||||
pub trait AudioDecoderExt: 'static {
|
||||
fn allocate_output_buffer(&self, size: usize) -> Option<gst::Buffer>;
|
||||
|
||||
fn get_audio_info(&self) -> Option<AudioInfo>;
|
||||
|
||||
fn get_delay(&self) -> i32;
|
||||
|
||||
fn get_drainable(&self) -> bool;
|
||||
|
||||
fn get_estimate_rate(&self) -> i32;
|
||||
|
||||
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime);
|
||||
|
||||
fn get_max_errors(&self) -> i32;
|
||||
|
||||
fn get_min_latency(&self) -> gst::ClockTime;
|
||||
|
||||
fn get_needs_format(&self) -> bool;
|
||||
|
||||
fn get_parse_state(&self) -> (bool, bool);
|
||||
|
||||
fn get_plc(&self) -> bool;
|
||||
|
||||
fn get_plc_aware(&self) -> i32;
|
||||
|
||||
fn get_tolerance(&self) -> gst::ClockTime;
|
||||
|
||||
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode);
|
||||
|
||||
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps;
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>);
|
||||
|
||||
fn set_drainable(&self, enabled: bool);
|
||||
|
||||
fn set_estimate_rate(&self, enabled: bool);
|
||||
|
||||
fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime);
|
||||
|
||||
fn set_max_errors(&self, num: i32);
|
||||
|
||||
fn set_min_latency(&self, num: gst::ClockTime);
|
||||
|
||||
fn set_needs_format(&self, enabled: bool);
|
||||
|
||||
fn set_plc(&self, enabled: bool);
|
||||
|
||||
fn set_plc_aware(&self, plc: bool);
|
||||
|
||||
fn set_tolerance(&self, tolerance: gst::ClockTime);
|
||||
|
||||
fn set_use_default_pad_acceptcaps(&self, use_: bool);
|
||||
|
||||
fn connect_property_min_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_plc_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<AudioDecoder>> AudioDecoderExt for O {
|
||||
fn allocate_output_buffer(&self, size: usize) -> Option<gst::Buffer> {
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_decoder_allocate_output_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
size,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_audio_info(&self) -> Option<AudioInfo> {
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_decoder_get_audio_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_delay(&self) -> i32 {
|
||||
unsafe { gst_audio_sys::gst_audio_decoder_get_delay(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_drainable(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_get_drainable(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_estimate_rate(&self) -> i32 {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_get_estimate_rate(self.as_ref().to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) {
|
||||
unsafe {
|
||||
let mut min = mem::uninitialized();
|
||||
let mut max = mem::uninitialized();
|
||||
gst_audio_sys::gst_audio_decoder_get_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut min,
|
||||
&mut max,
|
||||
);
|
||||
(from_glib(min), from_glib(max))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_max_errors(&self) -> i32 {
|
||||
unsafe { gst_audio_sys::gst_audio_decoder_get_max_errors(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_min_latency(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_get_min_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_needs_format(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_get_needs_format(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_parse_state(&self) -> (bool, bool) {
|
||||
unsafe {
|
||||
let mut sync = mem::uninitialized();
|
||||
let mut eos = mem::uninitialized();
|
||||
gst_audio_sys::gst_audio_decoder_get_parse_state(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut sync,
|
||||
&mut eos,
|
||||
);
|
||||
(from_glib(sync), from_glib(eos))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_plc(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_get_plc(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_plc_aware(&self) -> i32 {
|
||||
unsafe { gst_audio_sys::gst_audio_decoder_get_plc_aware(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_tolerance(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_decoder_get_tolerance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_merge_tags(
|
||||
self.as_ref().to_glib_none().0,
|
||||
tags.to_glib_none().0,
|
||||
mode.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_decoder_proxy_getcaps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
filter.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_allocation_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
allocation_caps.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_drainable(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_drainable(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_estimate_rate(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_estimate_rate(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
min.to_glib(),
|
||||
max.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_max_errors(&self, num: i32) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_max_errors(self.as_ref().to_glib_none().0, num);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_min_latency(&self, num: gst::ClockTime) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_min_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
num.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_needs_format(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_needs_format(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_plc(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_plc(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_plc_aware(&self, plc: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_plc_aware(
|
||||
self.as_ref().to_glib_none().0,
|
||||
plc.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_tolerance(&self, tolerance: gst::ClockTime) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_tolerance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
tolerance.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_use_default_pad_acceptcaps(&self, use_: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_decoder_set_use_default_pad_acceptcaps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
use_.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_min_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_min_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_audio_sys::GstAudioDecoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioDecoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioDecoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::min-latency\0".as_ptr() as *const _,
|
||||
Some(transmute(notify_min_latency_trampoline::<Self, F> as usize)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_plc_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_plc_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_audio_sys::GstAudioDecoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioDecoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioDecoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::plc\0".as_ptr() as *const _,
|
||||
Some(transmute(notify_plc_trampoline::<Self, F> as usize)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_tolerance_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_audio_sys::GstAudioDecoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioDecoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioDecoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::tolerance\0".as_ptr() as *const _,
|
||||
Some(transmute(notify_tolerance_trampoline::<Self, F> as usize)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
432
gstreamer-audio/src/auto/audio_encoder.rs
Normal file
432
gstreamer-audio/src/auto/audio_encoder.rs
Normal file
|
@ -0,0 +1,432 @@
|
|||
// 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 glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gst;
|
||||
use gst_audio_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use AudioInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct AudioEncoder(Object<gst_audio_sys::GstAudioEncoder, gst_audio_sys::GstAudioEncoderClass, AudioEncoderClass>) @extends gst::Element, gst::Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_audio_sys::gst_audio_encoder_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for AudioEncoder {}
|
||||
unsafe impl Sync for AudioEncoder {}
|
||||
|
||||
pub const NONE_AUDIO_ENCODER: Option<&AudioEncoder> = None;
|
||||
|
||||
pub trait AudioEncoderExt: 'static {
|
||||
fn allocate_output_buffer(&self, size: usize) -> Option<gst::Buffer>;
|
||||
|
||||
fn get_audio_info(&self) -> Option<AudioInfo>;
|
||||
|
||||
fn get_drainable(&self) -> bool;
|
||||
|
||||
fn get_frame_max(&self) -> i32;
|
||||
|
||||
fn get_frame_samples_max(&self) -> i32;
|
||||
|
||||
fn get_frame_samples_min(&self) -> i32;
|
||||
|
||||
fn get_hard_min(&self) -> bool;
|
||||
|
||||
fn get_hard_resync(&self) -> bool;
|
||||
|
||||
fn get_lookahead(&self) -> i32;
|
||||
|
||||
fn get_mark_granule(&self) -> bool;
|
||||
|
||||
fn get_perfect_timestamp(&self) -> bool;
|
||||
|
||||
fn get_tolerance(&self) -> gst::ClockTime;
|
||||
|
||||
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode);
|
||||
|
||||
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps;
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>);
|
||||
|
||||
fn set_drainable(&self, enabled: bool);
|
||||
|
||||
fn set_frame_max(&self, num: i32);
|
||||
|
||||
fn set_frame_samples_max(&self, num: i32);
|
||||
|
||||
fn set_frame_samples_min(&self, num: i32);
|
||||
|
||||
fn set_hard_min(&self, enabled: bool);
|
||||
|
||||
fn set_hard_resync(&self, enabled: bool);
|
||||
|
||||
fn set_headers(&self, headers: &[&gst::Buffer]);
|
||||
|
||||
fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime);
|
||||
|
||||
fn set_lookahead(&self, num: i32);
|
||||
|
||||
fn set_mark_granule(&self, enabled: bool);
|
||||
|
||||
fn set_perfect_timestamp(&self, enabled: bool);
|
||||
|
||||
fn set_tolerance(&self, tolerance: gst::ClockTime);
|
||||
|
||||
fn connect_property_hard_resync_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_mark_granule_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_perfect_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
|
||||
fn connect_property_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
|
||||
fn allocate_output_buffer(&self, size: usize) -> Option<gst::Buffer> {
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_encoder_allocate_output_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
size,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_audio_info(&self) -> Option<AudioInfo> {
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_encoder_get_audio_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_drainable(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_get_drainable(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_frame_max(&self) -> i32 {
|
||||
unsafe { gst_audio_sys::gst_audio_encoder_get_frame_max(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_frame_samples_max(&self) -> i32 {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_get_frame_samples_max(self.as_ref().to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_frame_samples_min(&self) -> i32 {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_get_frame_samples_min(self.as_ref().to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_hard_min(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_get_hard_min(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_hard_resync(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_get_hard_resync(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_lookahead(&self) -> i32 {
|
||||
unsafe { gst_audio_sys::gst_audio_encoder_get_lookahead(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_mark_granule(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_get_mark_granule(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_perfect_timestamp(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_get_perfect_timestamp(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tolerance(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_audio_sys::gst_audio_encoder_get_tolerance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_merge_tags(
|
||||
self.as_ref().to_glib_none().0,
|
||||
tags.to_glib_none().0,
|
||||
mode.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
unsafe {
|
||||
from_glib_full(gst_audio_sys::gst_audio_encoder_proxy_getcaps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
filter.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn set_allocation_caps(&self, allocation_caps: Option<&gst::Caps>) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_allocation_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
allocation_caps.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_drainable(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_drainable(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_frame_max(&self, num: i32) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_frame_max(self.as_ref().to_glib_none().0, num);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_frame_samples_max(&self, num: i32) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_frame_samples_max(
|
||||
self.as_ref().to_glib_none().0,
|
||||
num,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_frame_samples_min(&self, num: i32) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_frame_samples_min(
|
||||
self.as_ref().to_glib_none().0,
|
||||
num,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_hard_min(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_hard_min(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_hard_resync(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_hard_resync(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_headers(&self, headers: &[&gst::Buffer]) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_headers(
|
||||
self.as_ref().to_glib_none().0,
|
||||
headers.to_glib_full(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_latency(&self, min: gst::ClockTime, max: gst::ClockTime) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
min.to_glib(),
|
||||
max.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_lookahead(&self, num: i32) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_lookahead(self.as_ref().to_glib_none().0, num);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_mark_granule(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_mark_granule(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_perfect_timestamp(&self, enabled: bool) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_perfect_timestamp(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enabled.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_tolerance(&self, tolerance: gst::ClockTime) {
|
||||
unsafe {
|
||||
gst_audio_sys::gst_audio_encoder_set_tolerance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
tolerance.to_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_hard_resync_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_hard_resync_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_audio_sys::GstAudioEncoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioEncoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioEncoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::hard-resync\0".as_ptr() as *const _,
|
||||
Some(transmute(notify_hard_resync_trampoline::<Self, F> as usize)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_mark_granule_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_mark_granule_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_audio_sys::GstAudioEncoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioEncoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioEncoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::mark-granule\0".as_ptr() as *const _,
|
||||
Some(transmute(
|
||||
notify_mark_granule_trampoline::<Self, F> as usize,
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_perfect_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_perfect_timestamp_trampoline<
|
||||
P,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_audio_sys::GstAudioEncoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioEncoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioEncoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::perfect-timestamp\0".as_ptr() as *const _,
|
||||
Some(transmute(
|
||||
notify_perfect_timestamp_trampoline::<Self, F> as usize,
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_property_tolerance_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_tolerance_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_audio_sys::GstAudioEncoder,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
) where
|
||||
P: IsA<AudioEncoder>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AudioEncoder::from_glib_borrow(this).unsafe_cast())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
b"notify::tolerance\0".as_ptr() as *const _,
|
||||
Some(transmute(notify_tolerance_trampoline::<Self, F> as usize)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,14 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod audio_decoder;
|
||||
pub use self::audio_decoder::AudioDecoderExt;
|
||||
pub use self::audio_decoder::{AudioDecoder, AudioDecoderClass, NONE_AUDIO_DECODER};
|
||||
|
||||
mod audio_encoder;
|
||||
pub use self::audio_encoder::AudioEncoderExt;
|
||||
pub use self::audio_encoder::{AudioEncoder, AudioEncoderClass, NONE_AUDIO_ENCODER};
|
||||
|
||||
mod stream_volume;
|
||||
pub use self::stream_volume::StreamVolumeExt;
|
||||
pub use self::stream_volume::{StreamVolume, NONE_STREAM_VOLUME};
|
||||
|
@ -24,5 +32,7 @@ pub use self::flags::AudioPackFlags;
|
|||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
pub use super::AudioDecoderExt;
|
||||
pub use super::AudioEncoderExt;
|
||||
pub use super::StreamVolumeExt;
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -14,8 +14,11 @@ extern crate bitflags;
|
|||
extern crate glib;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
#[macro_use]
|
||||
extern crate gstreamer as gst;
|
||||
extern crate gstreamer_audio_sys as gst_audio_sys;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_base_sys as gst_base_sys;
|
||||
extern crate gstreamer_sys as gst_sys;
|
||||
|
||||
macro_rules! assert_initialized_main_thread {
|
||||
|
@ -49,6 +52,11 @@ pub use audio_channel_position::*;
|
|||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
mod audio_stream_align;
|
||||
|
||||
mod audio_decoder;
|
||||
pub use audio_decoder::*;
|
||||
mod audio_encoder;
|
||||
pub use audio_encoder::*;
|
||||
|
||||
use glib::translate::{from_glib_full, ToGlibPtr};
|
||||
pub fn audio_buffer_clip(
|
||||
buffer: gst::Buffer,
|
||||
|
@ -74,5 +82,10 @@ pub mod prelude {
|
|||
pub use glib::prelude::*;
|
||||
pub use gst::prelude::*;
|
||||
|
||||
pub use super::audio_decoder::AudioDecoderExtManual;
|
||||
pub use super::audio_encoder::AudioEncoderExtManual;
|
||||
pub use auto::traits::*;
|
||||
}
|
||||
|
||||
#[cfg(feature = "subclassing")]
|
||||
pub mod subclass;
|
||||
|
|
938
gstreamer-audio/src/subclass/audio_decoder.rs
Normal file
938
gstreamer-audio/src/subclass/audio_decoder.rs
Normal file
|
@ -0,0 +1,938 @@
|
|||
// Copyright (C) 2019 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 glib_sys;
|
||||
use gst_audio_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
|
||||
use glib::subclass::prelude::*;
|
||||
use gst;
|
||||
use gst::subclass::prelude::*;
|
||||
use gst::MiniObject;
|
||||
use gst_base;
|
||||
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
use AudioDecoder;
|
||||
use AudioDecoderClass;
|
||||
|
||||
pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl + Send + Sync + 'static {
|
||||
fn open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_open(element)
|
||||
}
|
||||
|
||||
fn close(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_close(element)
|
||||
}
|
||||
|
||||
fn start(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_start(element)
|
||||
}
|
||||
|
||||
fn stop(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_stop(element)
|
||||
}
|
||||
|
||||
fn set_format(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
caps: &gst::Caps,
|
||||
) -> Result<(), gst::LoggableError> {
|
||||
self.parent_set_format(element, caps)
|
||||
}
|
||||
|
||||
fn parse(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
adapter: &gst_base::Adapter,
|
||||
) -> Result<(u32, u32), gst::FlowError> {
|
||||
self.parent_parse(element, adapter)
|
||||
}
|
||||
|
||||
fn handle_frame(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
buffer: Option<&gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
self.parent_handle_frame(element, buffer)
|
||||
}
|
||||
|
||||
fn pre_push(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<Option<gst::Buffer>, gst::FlowError> {
|
||||
self.parent_pre_push(element, buffer)
|
||||
}
|
||||
|
||||
fn flush(&self, element: &AudioDecoder, hard: bool) {
|
||||
self.parent_flush(element, hard)
|
||||
}
|
||||
|
||||
fn negotiate(&self, element: &AudioDecoder) -> Result<(), gst::LoggableError> {
|
||||
self.parent_negotiate(element)
|
||||
}
|
||||
|
||||
fn get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
self.parent_get_caps(element, filter)
|
||||
}
|
||||
|
||||
fn sink_event(&self, element: &AudioDecoder, event: gst::Event) -> bool {
|
||||
self.parent_sink_event(element, event)
|
||||
}
|
||||
|
||||
fn sink_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_sink_query(element, query)
|
||||
}
|
||||
|
||||
fn src_event(&self, element: &AudioDecoder, event: gst::Event) -> bool {
|
||||
self.parent_src_event(element, event)
|
||||
}
|
||||
|
||||
fn src_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_src_query(element, query)
|
||||
}
|
||||
|
||||
fn propose_allocation(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_propose_allocation(element, query)
|
||||
}
|
||||
|
||||
fn decide_allocation(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_decide_allocation(element, query)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AudioDecoderImplExt {
|
||||
fn parent_open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_close(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_start(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_stop(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_set_format(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
caps: &gst::Caps,
|
||||
) -> Result<(), gst::LoggableError>;
|
||||
|
||||
fn parent_parse(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
adapter: &gst_base::Adapter,
|
||||
) -> Result<(u32, u32), gst::FlowError>;
|
||||
|
||||
fn parent_handle_frame(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
buffer: Option<&gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn parent_pre_push(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<Option<gst::Buffer>, gst::FlowError>;
|
||||
|
||||
fn parent_flush(&self, element: &AudioDecoder, hard: bool);
|
||||
|
||||
fn parent_negotiate(&self, element: &AudioDecoder) -> Result<(), gst::LoggableError>;
|
||||
|
||||
fn parent_get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps;
|
||||
|
||||
fn parent_sink_event(&self, element: &AudioDecoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_sink_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_src_event(&self, element: &AudioDecoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_src_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_decide_allocation(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage>;
|
||||
}
|
||||
|
||||
impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
|
||||
fn parent_open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.open
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `open` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_close(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.close
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `close` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_start(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.start
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `start` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_stop(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.stop
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `stop` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_set_format(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
caps: &gst::Caps,
|
||||
) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.set_format
|
||||
.map(|f| {
|
||||
gst_result_from_gboolean!(
|
||||
f(element.to_glib_none().0, caps.to_glib_none().0),
|
||||
gst::CAT_RUST,
|
||||
"parent function `set_format` failed"
|
||||
)
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_parse(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
adapter: &gst_base::Adapter,
|
||||
) -> Result<(u32, u32), gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.parse
|
||||
.map(|f| {
|
||||
let mut offset = mem::uninitialized();
|
||||
let mut len = mem::uninitialized();
|
||||
match gst::FlowReturn::from_glib(f(
|
||||
element.to_glib_none().0,
|
||||
adapter.to_glib_none().0,
|
||||
&mut offset,
|
||||
&mut len,
|
||||
))
|
||||
.into_result()
|
||||
{
|
||||
Ok(_) => {
|
||||
assert!(offset >= 0);
|
||||
assert!(len >= 0);
|
||||
Ok((offset as u32, len as u32))
|
||||
}
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
})
|
||||
.unwrap_or_else(|| Ok((0, adapter.available() as u32)))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_handle_frame(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
buffer: Option<&gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.handle_frame
|
||||
.map(|f| {
|
||||
gst::FlowReturn::from_glib(f(
|
||||
element.to_glib_none().0,
|
||||
buffer
|
||||
.map(|buffer| buffer.as_mut_ptr() as *mut *mut gst_sys::GstBuffer)
|
||||
.unwrap_or(ptr::null_mut()),
|
||||
))
|
||||
})
|
||||
.unwrap_or(gst::FlowReturn::Error)
|
||||
.into_result()
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_pre_push(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<Option<gst::Buffer>, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
if let Some(f) = (*parent_class).pre_push {
|
||||
let mut buffer = buffer.into_ptr();
|
||||
match gst::FlowReturn::from_glib(f(element.to_glib_none().0, &mut buffer))
|
||||
.into_result()
|
||||
{
|
||||
Ok(_) => Ok(from_glib_full(buffer)),
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
} else {
|
||||
Ok(Some(buffer))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_flush(&self, element: &AudioDecoder, hard: bool) {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.flush
|
||||
.map(|f| f(element.to_glib_none().0, hard.to_glib()))
|
||||
.unwrap_or(())
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_negotiate(&self, element: &AudioDecoder) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.negotiate
|
||||
.map(|f| {
|
||||
gst_result_from_gboolean!(
|
||||
f(element.to_glib_none().0),
|
||||
gst::CAT_RUST,
|
||||
"Parent function `negotiate` failed"
|
||||
)
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.getcaps
|
||||
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
|
||||
.unwrap_or(element.proxy_getcaps(None, filter))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_event(&self, element: &AudioDecoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_event
|
||||
.expect("Missing parent function `sink_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_query
|
||||
.expect("Missing parent function `sink_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_event(&self, element: &AudioDecoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_event
|
||||
.expect("Missing parent function `src_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_query
|
||||
.expect("Missing parent function `src_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.propose_allocation
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0, query.as_mut_ptr())) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `propose_allocation` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_decide_allocation(
|
||||
&self,
|
||||
element: &AudioDecoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
|
||||
(*parent_class)
|
||||
.decide_allocation
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0, query.as_mut_ptr())) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `decide_allocation` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ObjectSubclass + AudioDecoderImpl> IsSubclassable<T> for AudioDecoderClass
|
||||
where
|
||||
<T as ObjectSubclass>::Instance: PanicPoison,
|
||||
{
|
||||
fn override_vfuncs(&mut self) {
|
||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut gst_audio_sys::GstAudioDecoderClass);
|
||||
klass.open = Some(audio_decoder_open::<T>);
|
||||
klass.close = Some(audio_decoder_close::<T>);
|
||||
klass.start = Some(audio_decoder_start::<T>);
|
||||
klass.stop = Some(audio_decoder_stop::<T>);
|
||||
klass.set_format = Some(audio_decoder_set_format::<T>);
|
||||
klass.parse = Some(audio_decoder_parse::<T>);
|
||||
klass.handle_frame = Some(audio_decoder_handle_frame::<T>);
|
||||
klass.pre_push = Some(audio_decoder_pre_push::<T>);
|
||||
klass.flush = Some(audio_decoder_flush::<T>);
|
||||
klass.negotiate = Some(audio_decoder_negotiate::<T>);
|
||||
klass.getcaps = Some(audio_decoder_getcaps::<T>);
|
||||
klass.sink_event = Some(audio_decoder_sink_event::<T>);
|
||||
klass.src_event = Some(audio_decoder_src_event::<T>);
|
||||
klass.sink_query = Some(audio_decoder_sink_query::<T>);
|
||||
klass.src_query = Some(audio_decoder_src_query::<T>);
|
||||
klass.propose_allocation = Some(audio_decoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(audio_decoder_decide_allocation::<T>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_open<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.open(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_close<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.close(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_start<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.start(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_stop<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.stop(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_set_format<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
caps: *mut gst_sys::GstCaps,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.set_format(&wrap, &from_glib_borrow(caps)) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
err.log_with_object(&wrap);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_parse<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
adapter: *mut gst_base_sys::GstAdapter,
|
||||
offset: *mut i32,
|
||||
len: *mut i32,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
match imp.parse(&wrap, &from_glib_borrow(adapter)) {
|
||||
Ok((new_offset, new_len)) => {
|
||||
assert!(new_offset <= std::i32::MAX as u32);
|
||||
assert!(new_len <= std::i32::MAX as u32);
|
||||
*offset = new_offset as i32;
|
||||
*len = new_len as i32;
|
||||
Ok(gst::FlowSuccess::Ok)
|
||||
}
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_handle_frame<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
buffer: *mut *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
// FIXME: Misgenerated in gstreamer-audio-sys
|
||||
let buffer = buffer as *mut gst_sys::GstBuffer;
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
imp.handle_frame(
|
||||
&wrap,
|
||||
Option::<gst::Buffer>::from_glib_none(buffer).as_ref(),
|
||||
)
|
||||
.into()
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_pre_push<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
buffer: *mut *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
match imp.pre_push(&wrap, from_glib_full(*buffer)) {
|
||||
Ok(Some(new_buffer)) => {
|
||||
*buffer = new_buffer.into_ptr();
|
||||
Ok(gst::FlowSuccess::Ok)
|
||||
}
|
||||
Ok(None) => {
|
||||
*buffer = ptr::null_mut();
|
||||
Ok(gst::FlowSuccess::Ok)
|
||||
}
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_flush<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
hard: glib_sys::gboolean,
|
||||
) where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), (), {
|
||||
AudioDecoderImpl::flush(imp, &wrap, from_glib(hard))
|
||||
})
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_negotiate<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.negotiate(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
err.log_with_object(&wrap);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_getcaps<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), {
|
||||
AudioDecoderImpl::get_caps(
|
||||
imp,
|
||||
&wrap,
|
||||
Option::<gst::Caps>::from_glib_borrow(filter).as_ref(),
|
||||
)
|
||||
})
|
||||
.to_glib_full()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_sink_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_src_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_propose_allocation<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
let query = gst::QueryRef::from_mut_ptr(query);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.propose_allocation(&wrap, query) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_decoder_decide_allocation<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioDecoder = from_glib_borrow(ptr);
|
||||
let query = gst::QueryRef::from_mut_ptr(query);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.decide_allocation(&wrap, query) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
856
gstreamer-audio/src/subclass/audio_encoder.rs
Normal file
856
gstreamer-audio/src/subclass/audio_encoder.rs
Normal file
|
@ -0,0 +1,856 @@
|
|||
// Copyright (C) 2019 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 glib_sys;
|
||||
use gst_audio_sys;
|
||||
use gst_sys;
|
||||
|
||||
use glib::translate::*;
|
||||
|
||||
use glib::subclass::prelude::*;
|
||||
use gst;
|
||||
use gst::subclass::prelude::*;
|
||||
use gst::MiniObject;
|
||||
|
||||
use std::ptr;
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
use AudioEncoder;
|
||||
use AudioEncoderClass;
|
||||
use AudioInfo;
|
||||
|
||||
pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl + Send + Sync + 'static {
|
||||
fn open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_open(element)
|
||||
}
|
||||
|
||||
fn close(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_close(element)
|
||||
}
|
||||
|
||||
fn start(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_start(element)
|
||||
}
|
||||
|
||||
fn stop(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_stop(element)
|
||||
}
|
||||
|
||||
fn set_format(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
info: &AudioInfo,
|
||||
) -> Result<(), gst::LoggableError> {
|
||||
self.parent_set_format(element, info)
|
||||
}
|
||||
|
||||
fn handle_frame(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
buffer: Option<&gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
self.parent_handle_frame(element, buffer)
|
||||
}
|
||||
|
||||
fn pre_push(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<Option<gst::Buffer>, gst::FlowError> {
|
||||
self.parent_pre_push(element, buffer)
|
||||
}
|
||||
|
||||
fn flush(&self, element: &AudioEncoder) {
|
||||
self.parent_flush(element)
|
||||
}
|
||||
|
||||
fn negotiate(&self, element: &AudioEncoder) -> Result<(), gst::LoggableError> {
|
||||
self.parent_negotiate(element)
|
||||
}
|
||||
|
||||
fn get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
self.parent_get_caps(element, filter)
|
||||
}
|
||||
|
||||
fn sink_event(&self, element: &AudioEncoder, event: gst::Event) -> bool {
|
||||
self.parent_sink_event(element, event)
|
||||
}
|
||||
|
||||
fn sink_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_sink_query(element, query)
|
||||
}
|
||||
|
||||
fn src_event(&self, element: &AudioEncoder, event: gst::Event) -> bool {
|
||||
self.parent_src_event(element, event)
|
||||
}
|
||||
|
||||
fn src_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_src_query(element, query)
|
||||
}
|
||||
|
||||
fn propose_allocation(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_propose_allocation(element, query)
|
||||
}
|
||||
|
||||
fn decide_allocation(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
self.parent_decide_allocation(element, query)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AudioEncoderImplExt {
|
||||
fn parent_open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_close(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_start(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_stop(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_set_format(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
info: &AudioInfo,
|
||||
) -> Result<(), gst::LoggableError>;
|
||||
|
||||
fn parent_handle_frame(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
buffer: Option<&gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn parent_pre_push(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<Option<gst::Buffer>, gst::FlowError>;
|
||||
|
||||
fn parent_flush(&self, element: &AudioEncoder);
|
||||
|
||||
fn parent_negotiate(&self, element: &AudioEncoder) -> Result<(), gst::LoggableError>;
|
||||
|
||||
fn parent_get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps;
|
||||
|
||||
fn parent_sink_event(&self, element: &AudioEncoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_sink_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_src_event(&self, element: &AudioEncoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_src_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage>;
|
||||
|
||||
fn parent_decide_allocation(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage>;
|
||||
}
|
||||
|
||||
impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
|
||||
fn parent_open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.open
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `open` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_close(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.close
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `close` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_start(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.start
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `start` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_stop(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.stop
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0)) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `stop` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_set_format(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
info: &AudioInfo,
|
||||
) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.set_format
|
||||
.map(|f| {
|
||||
gst_result_from_gboolean!(
|
||||
f(element.to_glib_none().0, info.to_glib_none().0 as *mut _),
|
||||
gst::CAT_RUST,
|
||||
"parent function `set_format` failed"
|
||||
)
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_handle_frame(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
buffer: Option<&gst::Buffer>,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.handle_frame
|
||||
.map(|f| {
|
||||
gst::FlowReturn::from_glib(f(
|
||||
element.to_glib_none().0,
|
||||
buffer
|
||||
.map(|buffer| buffer.as_mut_ptr() as *mut *mut gst_sys::GstBuffer)
|
||||
.unwrap_or(ptr::null_mut()),
|
||||
))
|
||||
})
|
||||
.unwrap_or(gst::FlowReturn::Error)
|
||||
.into_result()
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_pre_push(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
buffer: gst::Buffer,
|
||||
) -> Result<Option<gst::Buffer>, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
if let Some(f) = (*parent_class).pre_push {
|
||||
let mut buffer = buffer.into_ptr();
|
||||
match gst::FlowReturn::from_glib(f(element.to_glib_none().0, &mut buffer))
|
||||
.into_result()
|
||||
{
|
||||
Ok(_) => Ok(from_glib_full(buffer)),
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
} else {
|
||||
Ok(Some(buffer))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_flush(&self, element: &AudioEncoder) {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.flush
|
||||
.map(|f| f(element.to_glib_none().0))
|
||||
.unwrap_or(())
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_negotiate(&self, element: &AudioEncoder) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.negotiate
|
||||
.map(|f| {
|
||||
gst_result_from_gboolean!(
|
||||
f(element.to_glib_none().0),
|
||||
gst::CAT_RUST,
|
||||
"Parent function `negotiate` failed"
|
||||
)
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.getcaps
|
||||
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
|
||||
.unwrap_or(element.proxy_getcaps(None, filter))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_event(&self, element: &AudioEncoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_event
|
||||
.expect("Missing parent function `sink_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_query
|
||||
.expect("Missing parent function `sink_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_event(&self, element: &AudioEncoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_event
|
||||
.expect("Missing parent function `src_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_query
|
||||
.expect("Missing parent function `src_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.propose_allocation
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0, query.as_mut_ptr())) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `propose_allocation` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_decide_allocation(
|
||||
&self,
|
||||
element: &AudioEncoder,
|
||||
query: &mut gst::QueryRef,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
|
||||
(*parent_class)
|
||||
.decide_allocation
|
||||
.map(|f| {
|
||||
if from_glib(f(element.to_glib_none().0, query.as_mut_ptr())) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(gst_error_msg!(
|
||||
gst::CoreError::StateChange,
|
||||
["Parent function `decide_allocation` failed"]
|
||||
))
|
||||
}
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ObjectSubclass + AudioEncoderImpl> IsSubclassable<T> for AudioEncoderClass
|
||||
where
|
||||
<T as ObjectSubclass>::Instance: PanicPoison,
|
||||
{
|
||||
fn override_vfuncs(&mut self) {
|
||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||
unsafe {
|
||||
let klass = &mut *(self as *mut Self as *mut gst_audio_sys::GstAudioEncoderClass);
|
||||
klass.open = Some(audio_encoder_open::<T>);
|
||||
klass.close = Some(audio_encoder_close::<T>);
|
||||
klass.start = Some(audio_encoder_start::<T>);
|
||||
klass.stop = Some(audio_encoder_stop::<T>);
|
||||
klass.set_format = Some(audio_encoder_set_format::<T>);
|
||||
klass.handle_frame = Some(audio_encoder_handle_frame::<T>);
|
||||
klass.pre_push = Some(audio_encoder_pre_push::<T>);
|
||||
klass.flush = Some(audio_encoder_flush::<T>);
|
||||
klass.negotiate = Some(audio_encoder_negotiate::<T>);
|
||||
klass.getcaps = Some(audio_encoder_getcaps::<T>);
|
||||
klass.sink_event = Some(audio_encoder_sink_event::<T>);
|
||||
klass.src_event = Some(audio_encoder_src_event::<T>);
|
||||
klass.sink_query = Some(audio_encoder_sink_query::<T>);
|
||||
klass.src_query = Some(audio_encoder_src_query::<T>);
|
||||
klass.propose_allocation = Some(audio_encoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(audio_encoder_decide_allocation::<T>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_open<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.open(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_close<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.close(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_start<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.start(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_stop<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.stop(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_set_format<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
info: *mut gst_audio_sys::GstAudioInfo,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.set_format(&wrap, &from_glib_none(info)) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
err.log_with_object(&wrap);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_handle_frame<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
buffer: *mut *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
// FIXME: Misgenerated in gstreamer-audio-sys
|
||||
let buffer = buffer as *mut gst_sys::GstBuffer;
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
imp.handle_frame(
|
||||
&wrap,
|
||||
Option::<gst::Buffer>::from_glib_none(buffer).as_ref(),
|
||||
)
|
||||
.into()
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_pre_push<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
buffer: *mut *mut gst_sys::GstBuffer,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
match imp.pre_push(&wrap, from_glib_full(*buffer)) {
|
||||
Ok(Some(new_buffer)) => {
|
||||
*buffer = new_buffer.into_ptr();
|
||||
Ok(gst::FlowSuccess::Ok)
|
||||
}
|
||||
Ok(None) => {
|
||||
*buffer = ptr::null_mut();
|
||||
Ok(gst::FlowSuccess::Ok)
|
||||
}
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_flush<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
) where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), (), {
|
||||
AudioEncoderImpl::flush(imp, &wrap)
|
||||
})
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_negotiate<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.negotiate(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
err.log_with_object(&wrap);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_getcaps<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), {
|
||||
AudioEncoderImpl::get_caps(
|
||||
imp,
|
||||
&wrap,
|
||||
Option::<gst::Caps>::from_glib_borrow(filter).as_ref(),
|
||||
)
|
||||
})
|
||||
.to_glib_full()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_sink_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_src_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_propose_allocation<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
let query = gst::QueryRef::from_mut_ptr(query);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.propose_allocation(&wrap, query) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn audio_encoder_decide_allocation<T: ObjectSubclass>(
|
||||
ptr: *mut gst_audio_sys::GstAudioEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: AudioEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: AudioEncoder = from_glib_borrow(ptr);
|
||||
let query = gst::QueryRef::from_mut_ptr(query);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.decide_allocation(&wrap, query) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
wrap.post_error_message(&err);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
16
gstreamer-audio/src/subclass/mod.rs
Normal file
16
gstreamer-audio/src/subclass/mod.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2019 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.
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
|
||||
pub mod audio_decoder;
|
||||
pub mod audio_encoder;
|
||||
|
||||
pub mod prelude {
|
||||
pub use super::audio_decoder::{AudioDecoderImpl, AudioDecoderImplExt};
|
||||
pub use super::audio_encoder::{AudioEncoderImpl, AudioEncoderImplExt};
|
||||
}
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-base"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Base library"
|
||||
|
@ -15,12 +15,12 @@ build = "build.rs"
|
|||
[dependencies]
|
||||
libc = "0.2"
|
||||
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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -61,6 +61,10 @@ mod base_transform;
|
|||
pub mod base_parse_frame;
|
||||
pub use base_parse_frame::BaseParseFrame;
|
||||
|
||||
pub const BASE_TRANSFORM_FLOW_DROPPED: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
|
||||
pub const BASE_PARSE_FLOW_DROPPED: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
|
||||
pub const AGGREGATOR_FLOW_NEED_DATA: gst::FlowError = gst::FlowError::CustomError;
|
||||
|
||||
// Re-export all the traits in a prelude module, so that applications
|
||||
// can always "use gst::prelude::*" without getting conflicts
|
||||
pub mod prelude {
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-check"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Check library"
|
||||
|
@ -14,12 +14,12 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-check-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-check-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-editing-services"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Thibault Saunier <tsaunier@igalia.com>", "Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Editing Services"
|
||||
|
@ -15,19 +15,18 @@ build = "build.rs"
|
|||
[dependencies]
|
||||
libc = "0.2"
|
||||
bitflags = "1.0"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gio-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
gstreamer-base-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
gstreamer-pbutils-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
gstreamer-editing-services-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"]}
|
||||
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gio = { git = "https://github.com/gtk-rs/gio" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-base = { path = "../gstreamer-base" }
|
||||
gstreamer-pbutils = { path = "../gstreamer-pbutils" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gio-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8" }
|
||||
gstreamer-base-sys = { version = "0.8" }
|
||||
gstreamer-pbutils-sys = { version = "0.8" }
|
||||
gstreamer-editing-services-sys = { version = "0.8", features = ["v1_8"]}
|
||||
glib = { version = "0.8" }
|
||||
gio = { version = "0.7" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-base = { version = "0.14", path = "../gstreamer-base" }
|
||||
gstreamer-pbutils = { version = "0.14", path = "../gstreamer-pbutils" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-gl"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>",
|
||||
"Víctor M. Jáquez L. <vjaquez@igalia.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
|
@ -18,15 +18,15 @@ bitflags = "1.0"
|
|||
byteorder = "1"
|
||||
libc = "0.2"
|
||||
lazy_static = "1.0"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
gstreamer-video-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_14"] }
|
||||
gstreamer-gl-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer", features = ["v1_14"] }
|
||||
gstreamer-base = { path = "../gstreamer-base", features = ["v1_14"] }
|
||||
gstreamer-video = { path = "../gstreamer-video", features = ["v1_14"] }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8" }
|
||||
gstreamer-video-sys = { version = "0.8", features = ["v1_14"] }
|
||||
gstreamer-gl-sys = { version = "0.8" }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer", features = ["v1_14"] }
|
||||
gstreamer-base = { version = "0.14", path = "../gstreamer-base", features = ["v1_14"] }
|
||||
gstreamer-video = { version = "0.14", path = "../gstreamer-video", features = ["v1_14"] }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-net"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Net library"
|
||||
|
@ -13,13 +13,13 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-net-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gio = { git = "https://github.com/gtk-rs/gio" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-net-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gio = { version = "0.7" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-pbutils"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Base Utils library"
|
||||
|
@ -15,12 +15,12 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-pbutils-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-pbutils-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-player"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Player library"
|
||||
|
@ -15,13 +15,13 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_12"] }
|
||||
gstreamer-player-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_12"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer", features = ["v1_12"] }
|
||||
gstreamer-video = { path = "../gstreamer-video", features = ["v1_12"] }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_12"] }
|
||||
gstreamer-player-sys = { version = "0.8", features = ["v1_12"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer", features = ["v1_12"] }
|
||||
gstreamer-video = { version = "0.14", path = "../gstreamer-video", features = ["v1_12"] }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-rtsp-server"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer RTSP Server library"
|
||||
|
@ -16,18 +16,18 @@ build = "build.rs"
|
|||
bitflags = "1.0"
|
||||
libc = "0.2"
|
||||
lazy_static = "1.0"
|
||||
glib-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gio-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-rtsp-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-rtsp-server-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-net-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gio = { git = "https://github.com/gtk-rs/gio" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-rtsp = { path = "../gstreamer-rtsp" }
|
||||
gstreamer-net = { path = "../gstreamer-net" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gio-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-rtsp-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-rtsp-server-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-net-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gio = { version = "0.7" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-rtsp = { version = "0.14", path = "../gstreamer-rtsp" }
|
||||
gstreamer-net = { version = "0.14", path = "../gstreamer-net" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-rtsp"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Rtsp library"
|
||||
|
@ -15,16 +15,16 @@ 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" }
|
||||
gio-sys = { git = "https://github.com/gtk-rs/sys" }
|
||||
gstreamer-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-rtsp-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-sdp-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gio = { git = "https://github.com/gtk-rs/gio" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-sdp = { path = "../gstreamer-sdp" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gio-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-rtsp-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-sdp-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gio = { version = "0.7" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-sdp = { version = "0.14", path = "../gstreamer-sdp" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-sdp"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Sdp library"
|
||||
|
@ -13,12 +13,12 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-sdp-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-sdp-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-video"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer Video library"
|
||||
|
@ -15,14 +15,14 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
gstreamer-video-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer" }
|
||||
gstreamer-base = { path = "../gstreamer-base" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-base-sys = { version = "0.8", features = ["v1_8"] }
|
||||
gstreamer-video-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer" }
|
||||
gstreamer-base = { version = "0.14", path = "../gstreamer-base" }
|
||||
lazy_static = "1.0"
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
|
|
|
@ -12,6 +12,61 @@ use glib::Type;
|
|||
use gobject_sys;
|
||||
use gst_video_sys;
|
||||
|
||||
bitflags! {
|
||||
pub struct VideoBufferFlags: u32 {
|
||||
const INTERLACED = 1048576;
|
||||
const TFF = 2097152;
|
||||
const RFF = 4194304;
|
||||
const ONEFIELD = 8388608;
|
||||
const MULTIPLE_VIEW = 16777216;
|
||||
const FIRST_IN_BUNDLE = 33554432;
|
||||
const TOP_FIELD = 10485760;
|
||||
const BOTTOM_FIELD = 8388608;
|
||||
const LAST = 268435456;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for VideoBufferFlags {
|
||||
type GlibType = gst_video_sys::GstVideoBufferFlags;
|
||||
|
||||
fn to_glib(&self) -> gst_video_sys::GstVideoBufferFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_video_sys::GstVideoBufferFlags> for VideoBufferFlags {
|
||||
fn from_glib(value: gst_video_sys::GstVideoBufferFlags) -> VideoBufferFlags {
|
||||
skip_assert_initialized!();
|
||||
VideoBufferFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VideoBufferFlags {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_video_sys::gst_video_buffer_flags_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for VideoBufferFlags {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for VideoBufferFlags {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for VideoBufferFlags {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct VideoChromaSite: u32 {
|
||||
const UNKNOWN = 0;
|
||||
|
|
|
@ -35,6 +35,7 @@ pub use self::enums::VideoTileMode;
|
|||
pub use self::enums::VideoTransferFunction;
|
||||
|
||||
mod flags;
|
||||
pub use self::flags::VideoBufferFlags;
|
||||
pub use self::flags::VideoChromaSite;
|
||||
pub use self::flags::VideoCodecFrameFlags;
|
||||
pub use self::flags::VideoFlags;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -26,8 +26,6 @@ pub trait VideoDecoderExt: 'static {
|
|||
|
||||
fn allocate_output_buffer(&self) -> Option<gst::Buffer>;
|
||||
|
||||
//fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams);
|
||||
|
||||
fn get_buffer_pool(&self) -> Option<gst::BufferPool>;
|
||||
|
||||
fn get_estimate_rate(&self) -> i32;
|
||||
|
@ -78,10 +76,6 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams) {
|
||||
// unsafe { TODO: call gst_video_sys:gst_video_decoder_get_allocator() }
|
||||
//}
|
||||
|
||||
fn get_buffer_pool(&self) -> Option<gst::BufferPool> {
|
||||
unsafe {
|
||||
from_glib_full(gst_video_sys::gst_video_decoder_get_buffer_pool(
|
||||
|
|
|
@ -34,8 +34,6 @@ pub const NONE_VIDEO_ENCODER: Option<&VideoEncoder> = None;
|
|||
pub trait VideoEncoderExt: 'static {
|
||||
fn allocate_output_buffer(&self, size: usize) -> Option<gst::Buffer>;
|
||||
|
||||
//fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams);
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
fn get_max_encode_time(&self, frame: &VideoCodecFrame) -> gst::ClockTimeDiff;
|
||||
|
||||
|
@ -77,10 +75,6 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams) {
|
||||
// unsafe { TODO: call gst_video_sys:gst_video_encoder_get_allocator() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
fn get_max_encode_time(&self, frame: &VideoCodecFrame) -> gst::ClockTimeDiff {
|
||||
unsafe {
|
||||
|
|
|
@ -50,7 +50,7 @@ pub use video_format_info::*;
|
|||
mod video_info;
|
||||
pub use video_info::*;
|
||||
pub mod video_frame;
|
||||
pub use video_frame::{VideoFrame, VideoFrameRef};
|
||||
pub use video_frame::{VideoBufferExt, VideoFrame, VideoFrameRef};
|
||||
mod video_overlay;
|
||||
pub use video_overlay::*;
|
||||
mod video_event;
|
||||
|
@ -86,6 +86,9 @@ pub mod video_codec_state;
|
|||
pub use video_codec_state::VideoCodecState;
|
||||
mod utils;
|
||||
|
||||
pub const VIDEO_ENCODER_FLOW_NEED_DATA: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
|
||||
pub const VIDEO_DECODER_FLOW_NEED_DATA: gst::FlowSuccess = gst::FlowSuccess::CustomSuccess;
|
||||
|
||||
// Re-export all the traits in a prelude module, so that applications
|
||||
// can always "use gst::prelude::*" without getting conflicts
|
||||
pub mod prelude {
|
||||
|
@ -96,6 +99,7 @@ pub mod prelude {
|
|||
pub use video_buffer_pool::VideoBufferPoolConfig;
|
||||
pub use video_decoder::VideoDecoderExtManual;
|
||||
pub use video_encoder::VideoEncoderExtManual;
|
||||
pub use video_frame::VideoBufferExt;
|
||||
pub use video_overlay::VideoOverlayExtManual;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ use gst::subclass::prelude::*;
|
|||
use gst::MiniObject;
|
||||
use gst_base;
|
||||
|
||||
use crate::prelude::*;
|
||||
use video_codec_state::{Readable, VideoCodecState};
|
||||
use VideoCodecFrame;
|
||||
use VideoDecoder;
|
||||
|
@ -45,6 +46,10 @@ pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl + Send + Sync + 's
|
|||
self.parent_finish(element)
|
||||
}
|
||||
|
||||
fn drain(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
self.parent_drain(element)
|
||||
}
|
||||
|
||||
fn set_format(
|
||||
&self,
|
||||
element: &VideoDecoder,
|
||||
|
@ -75,6 +80,30 @@ pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl + Send + Sync + 's
|
|||
self.parent_flush(element)
|
||||
}
|
||||
|
||||
fn negotiate(&self, element: &VideoDecoder) -> Result<(), gst::LoggableError> {
|
||||
self.parent_negotiate(element)
|
||||
}
|
||||
|
||||
fn get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
self.parent_get_caps(element, filter)
|
||||
}
|
||||
|
||||
fn sink_event(&self, element: &VideoDecoder, event: gst::Event) -> bool {
|
||||
self.parent_sink_event(element, event)
|
||||
}
|
||||
|
||||
fn sink_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_sink_query(element, query)
|
||||
}
|
||||
|
||||
fn src_event(&self, element: &VideoDecoder, event: gst::Event) -> bool {
|
||||
self.parent_src_event(element, event)
|
||||
}
|
||||
|
||||
fn src_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_src_query(element, query)
|
||||
}
|
||||
|
||||
fn propose_allocation(
|
||||
&self,
|
||||
element: &VideoDecoder,
|
||||
|
@ -103,6 +132,8 @@ pub trait VideoDecoderImplExt {
|
|||
|
||||
fn parent_finish(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn parent_drain(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn parent_set_format(
|
||||
&self,
|
||||
element: &VideoDecoder,
|
||||
|
@ -125,6 +156,18 @@ pub trait VideoDecoderImplExt {
|
|||
|
||||
fn parent_flush(&self, element: &VideoDecoder) -> bool;
|
||||
|
||||
fn parent_negotiate(&self, element: &VideoDecoder) -> Result<(), gst::LoggableError>;
|
||||
|
||||
fn parent_get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps;
|
||||
|
||||
fn parent_sink_event(&self, element: &VideoDecoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_sink_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_src_event(&self, element: &VideoDecoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_src_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &VideoDecoder,
|
||||
|
@ -236,6 +279,19 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
|
|||
}
|
||||
}
|
||||
|
||||
fn parent_drain(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
(*parent_class)
|
||||
.drain
|
||||
.map(|f| gst::FlowReturn::from_glib(f(element.to_glib_none().0)))
|
||||
.unwrap_or(gst::FlowReturn::Ok)
|
||||
.into_result()
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_set_format(
|
||||
&self,
|
||||
element: &VideoDecoder,
|
||||
|
@ -315,6 +371,84 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
|
|||
}
|
||||
}
|
||||
|
||||
fn parent_negotiate(&self, element: &VideoDecoder) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
(*parent_class)
|
||||
.negotiate
|
||||
.map(|f| {
|
||||
gst_result_from_gboolean!(
|
||||
f(element.to_glib_none().0),
|
||||
gst::CAT_RUST,
|
||||
"Parent function `negotiate` failed"
|
||||
)
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
(*parent_class)
|
||||
.getcaps
|
||||
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
|
||||
.unwrap_or(element.proxy_getcaps(None, filter).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_event(&self, element: &VideoDecoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_event
|
||||
.expect("Missing parent function `sink_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_query
|
||||
.expect("Missing parent function `sink_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_event(&self, element: &VideoDecoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_event
|
||||
.expect("Missing parent function `src_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_query
|
||||
.expect("Missing parent function `src_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &VideoDecoder,
|
||||
|
@ -379,10 +513,17 @@ where
|
|||
klass.start = Some(video_decoder_start::<T>);
|
||||
klass.stop = Some(video_decoder_stop::<T>);
|
||||
klass.finish = Some(video_decoder_finish::<T>);
|
||||
klass.drain = Some(video_decoder_drain::<T>);
|
||||
klass.set_format = Some(video_decoder_set_format::<T>);
|
||||
klass.parse = Some(video_decoder_parse::<T>);
|
||||
klass.handle_frame = Some(video_decoder_handle_frame::<T>);
|
||||
klass.flush = Some(video_decoder_flush::<T>);
|
||||
klass.negotiate = Some(video_decoder_negotiate::<T>);
|
||||
klass.getcaps = Some(video_decoder_getcaps::<T>);
|
||||
klass.sink_event = Some(video_decoder_sink_event::<T>);
|
||||
klass.src_event = Some(video_decoder_src_event::<T>);
|
||||
klass.sink_query = Some(video_decoder_sink_query::<T>);
|
||||
klass.src_query = Some(video_decoder_src_query::<T>);
|
||||
klass.propose_allocation = Some(video_decoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(video_decoder_decide_allocation::<T>);
|
||||
}
|
||||
|
@ -503,6 +644,24 @@ where
|
|||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_drain<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
) -> gst_sys::GstFlowReturn
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
imp.drain(&wrap).into()
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_set_format<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
state: *mut gst_video_sys::GstVideoCodecState,
|
||||
|
@ -594,6 +753,129 @@ where
|
|||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_negotiate<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.negotiate(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
err.log_with_object(&wrap);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_getcaps<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), {
|
||||
VideoDecoderImpl::get_caps(
|
||||
imp,
|
||||
&wrap,
|
||||
Option::<gst::Caps>::from_glib_borrow(filter).as_ref(),
|
||||
)
|
||||
})
|
||||
.to_glib_full()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_sink_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_src_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoDecoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoDecoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_decoder_propose_allocation<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoDecoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
|
|
|
@ -18,6 +18,7 @@ use gst;
|
|||
use gst::subclass::prelude::*;
|
||||
use gst::MiniObject;
|
||||
|
||||
use crate::prelude::*;
|
||||
use video_codec_state::{Readable, VideoCodecState};
|
||||
use VideoCodecFrame;
|
||||
use VideoEncoder;
|
||||
|
@ -64,6 +65,30 @@ pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl + Send + Sync + 's
|
|||
self.parent_flush(element)
|
||||
}
|
||||
|
||||
fn negotiate(&self, element: &VideoEncoder) -> Result<(), gst::LoggableError> {
|
||||
self.parent_negotiate(element)
|
||||
}
|
||||
|
||||
fn get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
self.parent_get_caps(element, filter)
|
||||
}
|
||||
|
||||
fn sink_event(&self, element: &VideoEncoder, event: gst::Event) -> bool {
|
||||
self.parent_sink_event(element, event)
|
||||
}
|
||||
|
||||
fn sink_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_sink_query(element, query)
|
||||
}
|
||||
|
||||
fn src_event(&self, element: &VideoEncoder, event: gst::Event) -> bool {
|
||||
self.parent_src_event(element, event)
|
||||
}
|
||||
|
||||
fn src_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
self.parent_src_query(element, query)
|
||||
}
|
||||
|
||||
fn propose_allocation(
|
||||
&self,
|
||||
element: &VideoEncoder,
|
||||
|
@ -106,6 +131,18 @@ pub trait VideoEncoderImplExt {
|
|||
|
||||
fn parent_flush(&self, element: &VideoEncoder) -> bool;
|
||||
|
||||
fn parent_negotiate(&self, element: &VideoEncoder) -> Result<(), gst::LoggableError>;
|
||||
|
||||
fn parent_get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps;
|
||||
|
||||
fn parent_sink_event(&self, element: &VideoEncoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_sink_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_src_event(&self, element: &VideoEncoder, event: gst::Event) -> bool;
|
||||
|
||||
fn parent_src_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool;
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &VideoEncoder,
|
||||
|
@ -270,6 +307,84 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
|
|||
}
|
||||
}
|
||||
|
||||
fn parent_negotiate(&self, element: &VideoEncoder) -> Result<(), gst::LoggableError> {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
|
||||
(*parent_class)
|
||||
.negotiate
|
||||
.map(|f| {
|
||||
gst_result_from_gboolean!(
|
||||
f(element.to_glib_none().0),
|
||||
gst::CAT_RUST,
|
||||
"Parent function `negotiate` failed"
|
||||
)
|
||||
})
|
||||
.unwrap_or(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
|
||||
(*parent_class)
|
||||
.getcaps
|
||||
.map(|f| from_glib_full(f(element.to_glib_none().0, filter.to_glib_none().0)))
|
||||
.unwrap_or(element.proxy_getcaps(None, filter).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_event(&self, element: &VideoEncoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_event
|
||||
.expect("Missing parent function `sink_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_sink_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.sink_query
|
||||
.expect("Missing parent function `sink_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_event(&self, element: &VideoEncoder, event: gst::Event) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_event
|
||||
.expect("Missing parent function `src_event`");
|
||||
from_glib(f(element.to_glib_none().0, event.into_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_src_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let data = self.get_type_data();
|
||||
let parent_class =
|
||||
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
|
||||
let f = (*parent_class)
|
||||
.src_query
|
||||
.expect("Missing parent function `src_query`");
|
||||
from_glib(f(element.to_glib_none().0, query.as_mut_ptr()))
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_propose_allocation(
|
||||
&self,
|
||||
element: &VideoEncoder,
|
||||
|
@ -337,6 +452,12 @@ where
|
|||
klass.set_format = Some(video_encoder_set_format::<T>);
|
||||
klass.handle_frame = Some(video_encoder_handle_frame::<T>);
|
||||
klass.flush = Some(video_encoder_flush::<T>);
|
||||
klass.negotiate = Some(video_encoder_negotiate::<T>);
|
||||
klass.getcaps = Some(video_encoder_getcaps::<T>);
|
||||
klass.sink_event = Some(video_encoder_sink_event::<T>);
|
||||
klass.src_event = Some(video_encoder_src_event::<T>);
|
||||
klass.sink_query = Some(video_encoder_sink_query::<T>);
|
||||
klass.src_query = Some(video_encoder_src_query::<T>);
|
||||
klass.propose_allocation = Some(video_encoder_propose_allocation::<T>);
|
||||
klass.decide_allocation = Some(video_encoder_decide_allocation::<T>);
|
||||
}
|
||||
|
@ -522,6 +643,129 @@ where
|
|||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_negotiate<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
match imp.negotiate(&wrap) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
err.log_with_object(&wrap);
|
||||
false
|
||||
}
|
||||
}
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_getcaps<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
filter: *mut gst_sys::GstCaps,
|
||||
) -> *mut gst_sys::GstCaps
|
||||
where
|
||||
T: VideoEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), {
|
||||
VideoEncoderImpl::get_caps(
|
||||
imp,
|
||||
&wrap,
|
||||
Option::<gst::Caps>::from_glib_borrow(filter).as_ref(),
|
||||
)
|
||||
})
|
||||
.to_glib_full()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_sink_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_sink_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.sink_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_src_event<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
event: *mut gst_sys::GstEvent,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_event(&wrap, from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_src_query<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
) -> glib_sys::gboolean
|
||||
where
|
||||
T: VideoEncoderImpl,
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
glib_floating_reference_guard!(ptr);
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: VideoEncoder = from_glib_borrow(ptr);
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
imp.src_query(&wrap, gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
}
|
||||
|
||||
unsafe extern "C" fn video_encoder_propose_allocation<T: ObjectSubclass>(
|
||||
ptr: *mut gst_video_sys::GstVideoEncoder,
|
||||
query: *mut gst_sys::GstQuery,
|
||||
|
|
|
@ -11,6 +11,7 @@ use glib::object::IsA;
|
|||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_video_sys;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use utils::HasStreamLock;
|
||||
use video_codec_state::{InNegotiation, Readable, VideoCodecState, VideoCodecStateContext};
|
||||
|
@ -20,6 +21,20 @@ use VideoFormat;
|
|||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
use VideoInterlaceMode;
|
||||
|
||||
extern "C" {
|
||||
fn _gst_video_decoder_error(
|
||||
dec: *mut gst_video_sys::GstVideoDecoder,
|
||||
weight: i32,
|
||||
domain: glib_sys::GQuark,
|
||||
code: i32,
|
||||
txt: *mut libc::c_char,
|
||||
debug: *mut libc::c_char,
|
||||
file: *const libc::c_char,
|
||||
function: *const libc::c_char,
|
||||
line: i32,
|
||||
) -> gst_sys::GstFlowReturn;
|
||||
}
|
||||
|
||||
pub trait VideoDecoderExtManual: 'static {
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
fn allocate_output_frame(
|
||||
|
@ -32,6 +47,8 @@ pub trait VideoDecoderExtManual: 'static {
|
|||
fn get_frames(&self) -> Vec<VideoCodecFrame>;
|
||||
fn get_oldest_frame(&self) -> Option<VideoCodecFrame>;
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
|
||||
|
||||
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
fn release_frame(&self, frame: VideoCodecFrame);
|
||||
|
@ -62,6 +79,18 @@ pub trait VideoDecoderExtManual: 'static {
|
|||
&'a self,
|
||||
output_state: VideoCodecState<'a, InNegotiation<'a>>,
|
||||
) -> Result<(), gst::FlowError>;
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn error<T: gst::MessageErrorDomain>(
|
||||
&self,
|
||||
weight: i32,
|
||||
code: T,
|
||||
message: Option<&str>,
|
||||
debug: Option<&str>,
|
||||
file: &str,
|
||||
function: &str,
|
||||
line: u32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
}
|
||||
|
||||
impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
|
||||
|
@ -84,6 +113,19 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
|
|||
ret.into_result()
|
||||
}
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
|
||||
unsafe {
|
||||
let mut allocator = ptr::null_mut();
|
||||
let mut params = mem::zeroed();
|
||||
gst_video_sys::gst_video_decoder_get_allocator(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut allocator,
|
||||
&mut params,
|
||||
);
|
||||
(from_glib_full(allocator), params.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_video_sys::gst_video_decoder_have_frame(
|
||||
|
@ -225,7 +267,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
|
|||
};
|
||||
|
||||
if state.is_null() {
|
||||
Err(gst::FlowError::Error)
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
} else {
|
||||
unsafe { Ok(VideoCodecState::<InNegotiation>::new(state, self.as_ref())) }
|
||||
}
|
||||
|
@ -256,7 +298,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
|
|||
};
|
||||
|
||||
if state.is_null() {
|
||||
Err(gst::FlowError::Error)
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
} else {
|
||||
unsafe { Ok(VideoCodecState::<InNegotiation>::new(state, self.as_ref())) }
|
||||
}
|
||||
|
@ -281,6 +323,31 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
|
|||
Err(gst::FlowError::NotNegotiated)
|
||||
}
|
||||
}
|
||||
fn error<T: gst::MessageErrorDomain>(
|
||||
&self,
|
||||
weight: i32,
|
||||
code: T,
|
||||
message: Option<&str>,
|
||||
debug: Option<&str>,
|
||||
file: &str,
|
||||
function: &str,
|
||||
line: u32,
|
||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(_gst_video_decoder_error(
|
||||
self.as_ref().to_glib_none().0,
|
||||
weight,
|
||||
T::domain().to_glib(),
|
||||
code.code(),
|
||||
message.to_glib_full(),
|
||||
debug.to_glib_full(),
|
||||
file.to_glib_none().0,
|
||||
function.to_glib_none().0,
|
||||
line as i32,
|
||||
))
|
||||
};
|
||||
ret.into_result()
|
||||
}
|
||||
}
|
||||
|
||||
impl HasStreamLock for VideoDecoder {
|
||||
|
@ -294,3 +361,79 @@ impl HasStreamLock for VideoDecoder {
|
|||
decoder_sys as *const gst_sys::GstElement
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! gst_video_decoder_error(
|
||||
($obj:expr, $weight:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
|
||||
use $crate::VideoDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some($msg),
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, ($msg:expr)) => { {
|
||||
use $crate::VideoDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some($msg),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, [$debug:expr]) => { {
|
||||
use $crate::VideoDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
None,
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
|
||||
use $crate::VideoDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some(&format!($($msg)*)),
|
||||
Some(&format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, ($($msg:tt)*)) => { {
|
||||
use $crate::VideoDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
Some(&format!($($msg)*)),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
($obj:expr, $weight:expr, $err:expr, [$($debug:tt)*]) => { {
|
||||
use $crate::VideoDecoderExtManual;
|
||||
$obj.error(
|
||||
$weight,
|
||||
$err,
|
||||
None,
|
||||
Some(&format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
}};
|
||||
);
|
||||
|
|
|
@ -12,6 +12,7 @@ use glib::object::IsA;
|
|||
use glib::translate::*;
|
||||
use gst;
|
||||
use gst_video_sys;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use utils::HasStreamLock;
|
||||
use video_codec_state::{InNegotiation, Readable, VideoCodecState, VideoCodecStateContext};
|
||||
|
@ -30,6 +31,8 @@ pub trait VideoEncoderExtManual: 'static {
|
|||
fn get_frames(&self) -> Vec<VideoCodecFrame>;
|
||||
fn get_oldest_frame(&self) -> Option<VideoCodecFrame>;
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams);
|
||||
|
||||
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
|
||||
|
||||
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime);
|
||||
|
@ -65,6 +68,19 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
|
|||
ret.into_result()
|
||||
}
|
||||
|
||||
fn get_allocator(&self) -> (gst::Allocator, gst::AllocationParams) {
|
||||
unsafe {
|
||||
let mut allocator = ptr::null_mut();
|
||||
let mut params = mem::zeroed();
|
||||
gst_video_sys::gst_video_encoder_get_allocator(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut allocator,
|
||||
&mut params,
|
||||
);
|
||||
(from_glib_full(allocator), params.into())
|
||||
}
|
||||
}
|
||||
|
||||
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||
let ret: gst::FlowReturn = unsafe {
|
||||
from_glib(gst_video_sys::gst_video_encoder_finish_frame(
|
||||
|
@ -174,7 +190,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
|
|||
};
|
||||
|
||||
if state.is_null() {
|
||||
Err(gst::FlowError::Error)
|
||||
Err(gst::FlowError::NotNegotiated)
|
||||
} else {
|
||||
unsafe { Ok(VideoCodecState::<InNegotiation>::new(state, self.as_ref())) }
|
||||
}
|
||||
|
|
|
@ -311,7 +311,27 @@ impl Eq for VideoFormatInfo {}
|
|||
|
||||
impl fmt::Debug for VideoFormatInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
f.write_str(self.name())
|
||||
f.debug_struct("VideoFormatInfo")
|
||||
.field("format", &self.format())
|
||||
.field("name", &self.name())
|
||||
.field("description", &self.description())
|
||||
.field("flags", &self.flags())
|
||||
.field("bits", &self.bits())
|
||||
.field("n-components", &self.n_components())
|
||||
.field("shift", &self.shift())
|
||||
.field("depth", &self.depth())
|
||||
.field("pixel-stride", &self.pixel_stride())
|
||||
.field("n-planes", &self.n_planes())
|
||||
.field("plane", &self.plane())
|
||||
.field("poffset", &self.poffset())
|
||||
.field("w-sub", &self.w_sub())
|
||||
.field("h-sub", &self.h_sub())
|
||||
.field("unpack-format", &self.unpack_format())
|
||||
.field("pack-lines", &self.pack_lines())
|
||||
.field("tile-mode", &self.tile_mode())
|
||||
.field("tile-ws", &self.tile_ws())
|
||||
.field("tile-hs", &self.tile_hs())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -665,6 +665,35 @@ impl<T> Drop for VideoFrameRef<T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait VideoBufferExt {
|
||||
fn get_video_flags(&self) -> ::VideoBufferFlags;
|
||||
fn set_video_flags(&mut self, flags: ::VideoBufferFlags);
|
||||
fn unset_video_flags(&mut self, flags: ::VideoBufferFlags);
|
||||
}
|
||||
|
||||
impl VideoBufferExt for gst::BufferRef {
|
||||
fn get_video_flags(&self) -> ::VideoBufferFlags {
|
||||
unsafe {
|
||||
let ptr = self.as_mut_ptr();
|
||||
::VideoBufferFlags::from_bits_truncate((*ptr).mini_object.flags)
|
||||
}
|
||||
}
|
||||
|
||||
fn set_video_flags(&mut self, flags: ::VideoBufferFlags) {
|
||||
unsafe {
|
||||
let ptr = self.as_mut_ptr();
|
||||
(*ptr).mini_object.flags |= flags.bits();
|
||||
}
|
||||
}
|
||||
|
||||
fn unset_video_flags(&mut self, flags: ::VideoBufferFlags) {
|
||||
unsafe {
|
||||
let ptr = self.as_mut_ptr();
|
||||
(*ptr).mini_object.flags &= !flags.bits();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
|
@ -221,6 +221,7 @@ impl fmt::Debug for VideoInfo {
|
|||
let mut b = f.debug_struct("VideoInfo");
|
||||
|
||||
b.field("format", &self.format())
|
||||
.field("format-info", &self.format_info())
|
||||
.field("width", &self.width())
|
||||
.field("height", &self.height())
|
||||
.field("interlace_mode", &self.interlace_mode())
|
||||
|
@ -271,21 +272,43 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
unsafe {
|
||||
let mut info = mem::uninitialized();
|
||||
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
#[cfg(not(feature = "v1_16"))]
|
||||
{
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
|
||||
if let Some(interlace_mode) = self.interlace_mode {
|
||||
info.interlace_mode = interlace_mode.to_glib();
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "v1_16")]
|
||||
{
|
||||
if let Some(interlace_mode) = self.interlace_mode {
|
||||
gst_video_sys::gst_video_info_set_interlaced_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
interlace_mode.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
} else {
|
||||
gst_video_sys::gst_video_info_set_format(
|
||||
&mut info,
|
||||
self.format.to_glib(),
|
||||
self.width,
|
||||
self.height,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if info.finfo.is_null() || info.width <= 0 || info.height <= 0 {
|
||||
return None;
|
||||
}
|
||||
|
||||
if let Some(interlace_mode) = self.interlace_mode {
|
||||
info.interlace_mode = interlace_mode.to_glib();
|
||||
}
|
||||
|
||||
if let Some(flags) = self.flags {
|
||||
info.flags = flags.to_glib();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer-webrtc"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer WebRTC library"
|
||||
|
@ -14,13 +14,13 @@ build = "build.rs"
|
|||
|
||||
[dependencies]
|
||||
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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
gstreamer-webrtc-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
gstreamer = { path = "../gstreamer", features = ["v1_14"] }
|
||||
gstreamer-sdp = { path = "../gstreamer-sdp" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8" }
|
||||
gstreamer-webrtc-sys = { version = "0.8" }
|
||||
glib = { version = "0.8" }
|
||||
gstreamer = { version = "0.14", path = "../gstreamer", features = ["v1_14"] }
|
||||
gstreamer-sdp = { version = "0.14", path = "../gstreamer-sdp" }
|
||||
|
||||
[build-dependencies.rustdoc-stripper]
|
||||
version = "0.1"
|
||||
|
|
|
@ -12,6 +12,76 @@ use glib::Type;
|
|||
use gobject_sys;
|
||||
use gst_web_rtc_sys;
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCBundlePolicy {
|
||||
None,
|
||||
Balanced,
|
||||
MaxCompat,
|
||||
MaxBundle,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for WebRTCBundlePolicy {
|
||||
type GlibType = gst_web_rtc_sys::GstWebRTCBundlePolicy;
|
||||
|
||||
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCBundlePolicy {
|
||||
match *self {
|
||||
WebRTCBundlePolicy::None => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_NONE,
|
||||
WebRTCBundlePolicy::Balanced => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_BALANCED,
|
||||
WebRTCBundlePolicy::MaxCompat => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT,
|
||||
WebRTCBundlePolicy::MaxBundle => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE,
|
||||
WebRTCBundlePolicy::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_web_rtc_sys::GstWebRTCBundlePolicy> for WebRTCBundlePolicy {
|
||||
fn from_glib(value: gst_web_rtc_sys::GstWebRTCBundlePolicy) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => WebRTCBundlePolicy::None,
|
||||
1 => WebRTCBundlePolicy::Balanced,
|
||||
2 => WebRTCBundlePolicy::MaxCompat,
|
||||
3 => WebRTCBundlePolicy::MaxBundle,
|
||||
value => WebRTCBundlePolicy::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl StaticType for WebRTCBundlePolicy {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_bundle_policy_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValueOptional<'a> for WebRTCBundlePolicy {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValue<'a> for WebRTCBundlePolicy {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl SetValue for WebRTCBundlePolicy {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCDTLSSetup {
|
||||
None,
|
||||
|
@ -149,6 +219,147 @@ impl SetValue for WebRTCDTLSTransportState {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCDataChannelState {
|
||||
New,
|
||||
Connecting,
|
||||
Open,
|
||||
Closing,
|
||||
Closed,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for WebRTCDataChannelState {
|
||||
type GlibType = gst_web_rtc_sys::GstWebRTCDataChannelState;
|
||||
|
||||
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCDataChannelState {
|
||||
match *self {
|
||||
WebRTCDataChannelState::New => gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_NEW,
|
||||
WebRTCDataChannelState::Connecting => {
|
||||
gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING
|
||||
}
|
||||
WebRTCDataChannelState::Open => gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_OPEN,
|
||||
WebRTCDataChannelState::Closing => {
|
||||
gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING
|
||||
}
|
||||
WebRTCDataChannelState::Closed => gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED,
|
||||
WebRTCDataChannelState::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_web_rtc_sys::GstWebRTCDataChannelState> for WebRTCDataChannelState {
|
||||
fn from_glib(value: gst_web_rtc_sys::GstWebRTCDataChannelState) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => WebRTCDataChannelState::New,
|
||||
1 => WebRTCDataChannelState::Connecting,
|
||||
2 => WebRTCDataChannelState::Open,
|
||||
3 => WebRTCDataChannelState::Closing,
|
||||
4 => WebRTCDataChannelState::Closed,
|
||||
value => WebRTCDataChannelState::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl StaticType for WebRTCDataChannelState {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_data_channel_state_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValueOptional<'a> for WebRTCDataChannelState {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValue<'a> for WebRTCDataChannelState {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl SetValue for WebRTCDataChannelState {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCFECType {
|
||||
None,
|
||||
UlpRed,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for WebRTCFECType {
|
||||
type GlibType = gst_web_rtc_sys::GstWebRTCFECType;
|
||||
|
||||
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCFECType {
|
||||
match *self {
|
||||
WebRTCFECType::None => gst_web_rtc_sys::GST_WEBRTC_FEC_TYPE_NONE,
|
||||
WebRTCFECType::UlpRed => gst_web_rtc_sys::GST_WEBRTC_FEC_TYPE_ULP_RED,
|
||||
WebRTCFECType::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_web_rtc_sys::GstWebRTCFECType> for WebRTCFECType {
|
||||
fn from_glib(value: gst_web_rtc_sys::GstWebRTCFECType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => WebRTCFECType::None,
|
||||
1 => WebRTCFECType::UlpRed,
|
||||
value => WebRTCFECType::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
impl StaticType for WebRTCFECType {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_fec_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
impl<'a> FromValueOptional<'a> for WebRTCFECType {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
impl<'a> FromValue<'a> for WebRTCFECType {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
impl SetValue for WebRTCFECType {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCICEComponent {
|
||||
Rtp,
|
||||
|
@ -411,6 +622,72 @@ impl SetValue for WebRTCICERole {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCICETransportPolicy {
|
||||
All,
|
||||
Relay,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for WebRTCICETransportPolicy {
|
||||
type GlibType = gst_web_rtc_sys::GstWebRTCICETransportPolicy;
|
||||
|
||||
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCICETransportPolicy {
|
||||
match *self {
|
||||
WebRTCICETransportPolicy::All => gst_web_rtc_sys::GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL,
|
||||
WebRTCICETransportPolicy::Relay => {
|
||||
gst_web_rtc_sys::GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY
|
||||
}
|
||||
WebRTCICETransportPolicy::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_web_rtc_sys::GstWebRTCICETransportPolicy> for WebRTCICETransportPolicy {
|
||||
fn from_glib(value: gst_web_rtc_sys::GstWebRTCICETransportPolicy) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => WebRTCICETransportPolicy::All,
|
||||
1 => WebRTCICETransportPolicy::Relay,
|
||||
value => WebRTCICETransportPolicy::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl StaticType for WebRTCICETransportPolicy {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_ice_transport_policy_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValueOptional<'a> for WebRTCICETransportPolicy {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValue<'a> for WebRTCICETransportPolicy {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl SetValue for WebRTCICETransportPolicy {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCPeerConnectionState {
|
||||
New,
|
||||
|
@ -490,6 +767,76 @@ impl SetValue for WebRTCPeerConnectionState {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCPriorityType {
|
||||
VeryLow,
|
||||
Low,
|
||||
Medium,
|
||||
High,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for WebRTCPriorityType {
|
||||
type GlibType = gst_web_rtc_sys::GstWebRTCPriorityType;
|
||||
|
||||
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCPriorityType {
|
||||
match *self {
|
||||
WebRTCPriorityType::VeryLow => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_VERY_LOW,
|
||||
WebRTCPriorityType::Low => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_LOW,
|
||||
WebRTCPriorityType::Medium => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_MEDIUM,
|
||||
WebRTCPriorityType::High => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_HIGH,
|
||||
WebRTCPriorityType::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_web_rtc_sys::GstWebRTCPriorityType> for WebRTCPriorityType {
|
||||
fn from_glib(value: gst_web_rtc_sys::GstWebRTCPriorityType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
1 => WebRTCPriorityType::VeryLow,
|
||||
2 => WebRTCPriorityType::Low,
|
||||
3 => WebRTCPriorityType::Medium,
|
||||
4 => WebRTCPriorityType::High,
|
||||
value => WebRTCPriorityType::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl StaticType for WebRTCPriorityType {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_priority_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValueOptional<'a> for WebRTCPriorityType {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValue<'a> for WebRTCPriorityType {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl SetValue for WebRTCPriorityType {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCRTPTransceiverDirection {
|
||||
None,
|
||||
|
@ -566,6 +913,82 @@ impl SetValue for WebRTCRTPTransceiverDirection {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCSCTPTransportState {
|
||||
New,
|
||||
Connecting,
|
||||
Connected,
|
||||
Closed,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for WebRTCSCTPTransportState {
|
||||
type GlibType = gst_web_rtc_sys::GstWebRTCSCTPTransportState;
|
||||
|
||||
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCSCTPTransportState {
|
||||
match *self {
|
||||
WebRTCSCTPTransportState::New => gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW,
|
||||
WebRTCSCTPTransportState::Connecting => {
|
||||
gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING
|
||||
}
|
||||
WebRTCSCTPTransportState::Connected => {
|
||||
gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED
|
||||
}
|
||||
WebRTCSCTPTransportState::Closed => {
|
||||
gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED
|
||||
}
|
||||
WebRTCSCTPTransportState::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_web_rtc_sys::GstWebRTCSCTPTransportState> for WebRTCSCTPTransportState {
|
||||
fn from_glib(value: gst_web_rtc_sys::GstWebRTCSCTPTransportState) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => WebRTCSCTPTransportState::New,
|
||||
1 => WebRTCSCTPTransportState::Connecting,
|
||||
2 => WebRTCSCTPTransportState::Connected,
|
||||
3 => WebRTCSCTPTransportState::Closed,
|
||||
value => WebRTCSCTPTransportState::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl StaticType for WebRTCSCTPTransportState {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_sctp_transport_state_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValueOptional<'a> for WebRTCSCTPTransportState {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl<'a> FromValue<'a> for WebRTCSCTPTransportState {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
impl SetValue for WebRTCSCTPTransportState {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
pub enum WebRTCSDPType {
|
||||
Offer,
|
||||
|
|
|
@ -21,14 +21,26 @@ mod web_rtc_session_description;
|
|||
pub use self::web_rtc_session_description::WebRTCSessionDescription;
|
||||
|
||||
mod enums;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub use self::enums::WebRTCBundlePolicy;
|
||||
pub use self::enums::WebRTCDTLSSetup;
|
||||
pub use self::enums::WebRTCDTLSTransportState;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub use self::enums::WebRTCDataChannelState;
|
||||
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
|
||||
pub use self::enums::WebRTCFECType;
|
||||
pub use self::enums::WebRTCICEComponent;
|
||||
pub use self::enums::WebRTCICEConnectionState;
|
||||
pub use self::enums::WebRTCICEGatheringState;
|
||||
pub use self::enums::WebRTCICERole;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub use self::enums::WebRTCICETransportPolicy;
|
||||
pub use self::enums::WebRTCPeerConnectionState;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub use self::enums::WebRTCPriorityType;
|
||||
pub use self::enums::WebRTCRTPTransceiverDirection;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
pub use self::enums::WebRTCSCTPTransportState;
|
||||
pub use self::enums::WebRTCSDPType;
|
||||
pub use self::enums::WebRTCSignalingState;
|
||||
pub use self::enums::WebRTCStatsType;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -5,6 +5,142 @@ 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.14.5] - 2019-09-17
|
||||
### Added
|
||||
- Support subclassing of `gst::Device`, `gst::DeviceProvider`,
|
||||
`gst_audio::AudioDecoder` and `::AudioEncoder`
|
||||
- Support for `Element::set_clock` and `::provide_clock` virtual methods
|
||||
- `ElementClass::add_metadata` was added
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got support for `get_caps`,
|
||||
`negotiate`, `src/sink_query/event` and the `drain` virtual methods
|
||||
- `Element::num_pads`, `::num_src_pads` and `::num_sink_pads` functions
|
||||
- `gst_video::VideoDecoder` and `::VideoEncoder` got `get_allocator` bindings
|
||||
- `gst::Iterator` implements `IntoIterator` now for providing
|
||||
`std::iter::Iterator<Item=<Result<T, IteratorError>>` adapter
|
||||
- Error macros for audio/video decoder subclasses to handle decoding errors
|
||||
more gracefully and only actually error out after many consecutive errors
|
||||
|
||||
### Fixed
|
||||
- Macros now also work in Rust 2018 edition without `#[macro_use]` but
|
||||
explicit imports
|
||||
- The log handler unit test runs reliable in parallel with other tests
|
||||
- Manually implement `Debug` for `gst::Iterator` to allow it for any `T`
|
||||
instead of `T: Debug`
|
||||
- `Device::create_element` has correct reference count handling now
|
||||
- Return `NotNegotiated` in the video codec base classes if setting the output
|
||||
state fails instead of `Error`
|
||||
|
||||
## [0.14.4] - 2019-08-14
|
||||
### Added
|
||||
- Bindings for adding/removing custom log functions
|
||||
- Bindings for `calculate_linear_regression()`
|
||||
- Constants for base class custom flow returns
|
||||
|
||||
### Fixed
|
||||
- Ownership of pad in `Element::release_pad()` virtual method implementations
|
||||
|
||||
## [0.14.3] - 2019-07-16
|
||||
### Added
|
||||
- `Buffer::unset_flags()` for unsetting specific buffer flags
|
||||
- `VideoBufferFlags` flags type and `VideoBufferExt::set_video_flags()`,
|
||||
`unset_video_flags()` and `get_video_flags()` for working with video buffer
|
||||
flags from safe code.
|
||||
|
||||
### Fixed
|
||||
- Setting buffer flags does not override arbitrary other flags anymore but
|
||||
only sets the flags in question. This is necessary to not override extension
|
||||
buffer flags like `gst_video::VideoBufferFlags`.
|
||||
|
||||
## [0.14.2] - 2019-07-15
|
||||
### Added
|
||||
- Support for `ReferenceTimestampMeta`
|
||||
|
||||
## [0.14.1] - 2019-07-06
|
||||
### Added
|
||||
- Various new WebRTC enum types from 1.14.1/1.16.0
|
||||
|
||||
### Fixed
|
||||
- Correctly generate interlaced `VideoInfo` by using
|
||||
`gst_video_info_set_interlaced_format()` instead of the generic function.
|
||||
- serde serialization unit tests for `gst::format` succeed again now.
|
||||
|
||||
### Changed
|
||||
- `Debug` impls for `VideoFormatInfo` and `AudioFormatInfo` now print all the
|
||||
details of the format instead of only the name, and the `Debug` impls for
|
||||
`VideoInfo` and `AudioInfo` also print the format now.
|
||||
|
||||
## [0.14.0] - 2019-06-24
|
||||
### Added
|
||||
- Bindings for `GLSyncMeta`.
|
||||
- Bindings for setting/getting `TagScope` on a `TagList`
|
||||
- Bindings for `GLDisplayWayland` and `GLDisplayX11` in addition to the
|
||||
already existing `GLDisplayEGL`
|
||||
- Bindings for `Bus::pop_filtered()` and related functions
|
||||
- Bindings for getting/setting `Object`, `Element`, `Bin`, `Pipeline` and
|
||||
`Plugin` flags
|
||||
- Bindings for `VideoCaptionMeta`
|
||||
- `Debug` impl of `Buffer` now also shows the metas of the buffers
|
||||
- Expose flow return in `PadProbeInfo` for overriding the return value
|
||||
- Bindings for `VideoDecoder` and `VideoEncoder`, including subclassing
|
||||
support
|
||||
- Bindings for `Memory`, `Allocator` and `VideoBufferPool`
|
||||
- Bindings for `VideoFormatInfo::pack` and `::unpack` for format conversion
|
||||
- Bindings for `BaseParse`, including subclassing support
|
||||
- Various new arithmetic operation impls for fractions, formatted values and
|
||||
`ClockTime`
|
||||
- Bindings for `VideoInfo::align()`
|
||||
|
||||
### Changed
|
||||
- The `SDPMessage` and `SDPMedia` bindings were completely rewritten as they
|
||||
were broken before and caused crashes in various usages. As part of this
|
||||
there's also some more convenience API available on these types, like
|
||||
iterators for example, and API to modify the `SDPMedia` contained in a
|
||||
`SDPMessage`.
|
||||
- Update to GStreamer 1.16.
|
||||
- Regenerate with latest gir.
|
||||
- Run all autogenerated code through rustfmt after generation too.
|
||||
- Updated to latest versions of GLib/GIO/etc crates.
|
||||
- Updated to futures 0.3 / `std::future`
|
||||
- `ProxyPad` default functions moved to an extension trait instead of plain
|
||||
functions on `ProxyPad`, making them more in sync with the default `Pad`
|
||||
functions
|
||||
- GStreamer plugins are now exporting the new 1.14+ plugin symbols if they
|
||||
were configured for GStreamer 1.14+
|
||||
- Arithmetic operations on formatted values and `ClockTime` do overflow checks
|
||||
now and replace the result with the `NONE` value on overflow
|
||||
- `TryFrom`/`TryInto` traits are used in various places now instead of the
|
||||
previous ad-hoc implementations of them.
|
||||
- Registering element/typefind/device monitor factories requires passing a
|
||||
value of `gst::Rank` now instead of an arbitrary `u32`
|
||||
|
||||
### Fixed
|
||||
- Use correct type for destroying pad task closure data. This was previously
|
||||
using the wrong type, causing crashes at runtime.
|
||||
- `DeviceAdded`/`DeviceRemoved` message getters are transfer full so we don't
|
||||
need to take an additional reference that would be leaked.
|
||||
- `AppSink` callbacks are correctly marked as `Send` instead of `Send+Sync`,
|
||||
allowing a wider range of closures to be used for them.
|
||||
- Handle `PadProbeReturn::Handled` return values from pad probes more
|
||||
correctly.
|
||||
- `ToOwned::to_owned()` on miniobjects has to create copies instead of
|
||||
only increasing the reference count. Otherwise it was possible to create
|
||||
multiple mutable and immutable references to the same object at the same
|
||||
time.
|
||||
- Various functions take references to owned miniobjects instead of borrowed
|
||||
references as it was otherwise possible to create multiple mutable or
|
||||
immutable references to the same object at the same time.
|
||||
- `URIHandler::set_uri` does not accept `None` anymore as this is not allowed
|
||||
by the C function.
|
||||
- Comparisons and addition of `TypeFindProbability` and `Rank` work correctly now
|
||||
- Various `Display` implementations were fixed to not cause a stack overflow
|
||||
due to infinite recursion anymore
|
||||
- Various `::to_string()` functions don't take ownership of C strings anymore
|
||||
that they do not own, which caused double frees before
|
||||
|
||||
### Removed
|
||||
- MIKEY related bindings from the SDP library. The bindings were broken and
|
||||
until someone needs them these are not available anymore.
|
||||
|
||||
## [0.13.0] - 2019-02-22
|
||||
### Added
|
||||
- Subclassing infrastructure was moved directly into the bindings,
|
||||
|
@ -430,7 +566,10 @@ 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://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...HEAD
|
||||
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.2...HEAD
|
||||
[0.14.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.1...0.14.2
|
||||
[0.14.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.14.0...0.14.1
|
||||
[0.14.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.13.0...0.14.0
|
||||
[0.13.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.12.2...0.13.0
|
||||
[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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gstreamer"
|
||||
version = "0.14.0"
|
||||
version = "0.14.5"
|
||||
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
|
||||
categories = ["api-bindings", "multimedia"]
|
||||
description = "Rust bindings for GStreamer"
|
||||
|
@ -16,10 +16,10 @@ build = "build.rs"
|
|||
bitflags = "1.0"
|
||||
cfg-if = "0.1"
|
||||
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://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"] }
|
||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||
glib-sys = { version = "0.9" }
|
||||
gobject-sys = { version = "0.9" }
|
||||
gstreamer-sys = { version = "0.8", features = ["v1_8"] }
|
||||
glib = { version = "0.8" }
|
||||
num-rational = { version = "0.2", default-features = false, features = [] }
|
||||
lazy_static = "1.0"
|
||||
futures-core-preview = { version = "0.3.0-alpha", optional = true }
|
||||
|
|
|
@ -57,7 +57,7 @@ pub trait DeviceExt: 'static {
|
|||
impl<O: IsA<Device>> DeviceExt for O {
|
||||
fn create_element(&self, name: Option<&str>) -> Option<Element> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_create_element(
|
||||
from_glib_none(gst_sys::gst_device_create_element(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ e586ff8)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 20feecf)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
|
@ -374,7 +374,11 @@ impl BufferRef {
|
|||
}
|
||||
|
||||
pub fn set_flags(&mut self, flags: BufferFlags) {
|
||||
self.0.mini_object.flags = flags.bits();
|
||||
self.0.mini_object.flags |= flags.bits();
|
||||
}
|
||||
|
||||
pub fn unset_flags(&mut self, flags: BufferFlags) {
|
||||
self.0.mini_object.flags &= !flags.bits();
|
||||
}
|
||||
|
||||
pub fn get_meta<T: MetaAPI>(&self) -> Option<MetaRef<T>> {
|
||||
|
|
|
@ -191,6 +191,10 @@ pub trait ElementExtManual: 'static {
|
|||
fn get_sink_pads(&self) -> Vec<Pad>;
|
||||
fn get_src_pads(&self) -> Vec<Pad>;
|
||||
|
||||
fn num_pads(&self) -> u16;
|
||||
fn num_sink_pads(&self) -> u16;
|
||||
fn num_src_pads(&self) -> u16;
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn add_property_deep_notify_watch(
|
||||
&self,
|
||||
|
@ -500,6 +504,30 @@ impl<O: IsA<Element>> ElementExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn num_pads(&self) -> u16 {
|
||||
unsafe {
|
||||
let elt: &gst_sys::GstElement = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&elt.object.lock);
|
||||
elt.numpads
|
||||
}
|
||||
}
|
||||
|
||||
fn num_sink_pads(&self) -> u16 {
|
||||
unsafe {
|
||||
let elt: &gst_sys::GstElement = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&elt.object.lock);
|
||||
elt.numsinkpads
|
||||
}
|
||||
}
|
||||
|
||||
fn num_src_pads(&self) -> u16 {
|
||||
unsafe {
|
||||
let elt: &gst_sys::GstElement = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&elt.object.lock);
|
||||
elt.numsrcpads
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn add_property_deep_notify_watch(
|
||||
&self,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue