Compare commits

...

20 commits
main ... 0.9

Author SHA1 Message Date
Sebastian Dröge
7ceff5bafd Print clock times as actual time in Segment/Buffer/BufferList debug output 2017-12-01 19:03:15 +02:00
Sebastian Dröge
927b1ac822 Revert "Event/Message::get_structure() can return None"
This reverts commit aa275d5ddb.

It actually breaks the API, we need to find another way.
2017-12-01 16:08:12 +02:00
Sebastian Dröge
aa275d5ddb Event/Message::get_structure() can return None 2017-12-01 11:54:57 +02:00
Sebastian Dröge
affc53a515 Implement fmt::Debug more consistently for miniobjects and various other types 2017-12-01 11:35:46 +02:00
Sebastian Dröge
ec900d7e3f Implement some functions on EventType and implement PartialOrd for serialized events 2017-12-01 11:35:43 +02:00
Sebastian Dröge
bc991708e5 Implement ToOwned for Message/Event/QueryRef 2017-12-01 11:35:14 +02:00
Sebastian Dröge
6f09e5c791 Regenerate with latest GIR to fix various issues with property getters
Get rid of unneeded transmutes and actually initialize flags/enum
GValues with the correct type instead of using integers.
2017-11-27 19:19:00 +02:00
Sebastian Dröge
85e1d84784 Include 0.9.1 CHANGELOG.md in all sub-crates 2017-11-27 14:37:52 +02:00
Sebastian Dröge
67e47b0cbf Fix some clippy warnings in examples/tutorials 2017-11-27 14:35:24 +02:00
Sebastian Dröge
291193c1ad Remove some unneeded lifetime annotations 2017-11-27 14:35:24 +02:00
Sebastian Dröge
98ca60b684 Get rid of some unneeded transmute() in VideoInfo 2017-11-27 14:35:24 +02:00
Sebastian Dröge
0483d0881f Add TagListRef::merge() and ::insert() 2017-11-27 14:35:24 +02:00
Sebastian Dröge
a4eea8734d Toc::merge() doesn't take ownership of the taglist 2017-11-27 14:35:24 +02:00
Sebastian Dröge
918b34fb7a Use Arc::clone(&val) instead of val.clone() to make it more explicit that only the Arc cloned here 2017-11-27 14:35:24 +02:00
Sebastian Dröge
2b0674b7cb Derive more useful traits for various enums 2017-11-27 14:35:24 +02:00
Sebastian Dröge
124564d6f0 Update version to 0.9.1 2017-11-26 20:41:38 +02:00
Sebastian Dröge
1d63b0d89b Export FlowError/Success, ClockError/Success, PadLinkError/Success too 2017-11-26 20:40:20 +02:00
Sebastian Dröge
4e2f89835b Update CHANGELOG.md for 0.9.0 2017-11-26 19:32:20 +02:00
Sebastian Dröge
d09dd828d6 Update docs 2017-11-26 19:32:20 +02:00
Sebastian Dröge
1d80323b58 Update versions of all dependencies and point to releases instead of GIT 2017-11-26 19:32:20 +02:00
110 changed files with 1972 additions and 950 deletions

View file

@ -39,7 +39,7 @@ to avoid polling.
# Implements # Implements
[`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html) [`BaseSinkExt`](trait.BaseSinkExt.html), [`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html), [`URIHandlerExt`](trait.URIHandlerExt.html)
<!-- impl AppSink::fn get_buffer_list_support --> <!-- impl AppSink::fn get_buffer_list_support -->
Check if `self` supports buffer lists. Check if `self` supports buffer lists.
@ -235,6 +235,125 @@ the maximum amount of time to wait for a sample
a `gst::Sample` or NULL when the appsink is stopped or EOS or the timeout expires. a `gst::Sample` or NULL when the appsink is stopped or EOS or the timeout expires.
Call `gst_sample_unref` after usage. Call `gst_sample_unref` after usage.
<!-- trait AppSinkExt::fn connect_eos -->
Signal that the end-of-stream has been reached. This signal is emitted from
the streaming thread.
<!-- trait AppSinkExt::fn connect_new_preroll -->
Signal that a new preroll sample is available.
This signal is emitted from the streaming thread and only when the
"emit-signals" property is `true`.
The new preroll sample can be retrieved with the "pull-preroll" action
signal or `AppSink::pull_preroll` either from this signal callback
or from any other thread.
Note that this signal is only emitted when the "emit-signals" property is
set to `true`, which it is not by default for performance reasons.
<!-- trait AppSinkExt::fn connect_new_sample -->
Signal that a new sample is available.
This signal is emitted from the streaming thread and only when the
"emit-signals" property is `true`.
The new sample can be retrieved with the "pull-sample" action
signal or `AppSink::pull_sample` either from this signal callback
or from any other thread.
Note that this signal is only emitted when the "emit-signals" property is
set to `true`, which it is not by default for performance reasons.
<!-- trait AppSinkExt::fn connect_pull_preroll -->
Get the last preroll sample in `appsink`. This was the sample that caused the
appsink to preroll in the PAUSED state. This sample can be pulled many times
and remains available to the application even after EOS.
This function is typically used when dealing with a pipeline in the PAUSED
state. Calling this function after doing a seek will give the sample right
after the seek position.
Note that the preroll sample will also be returned as the first sample
when calling `AppSink::pull_sample` or the "pull-sample" action signal.
If an EOS event was received before any buffers, this function returns
`None`. Use gst_app_sink_is_eos () to check for the EOS condition.
This function blocks until a preroll sample or EOS is received or the appsink
element is set to the READY/NULL state.
# Returns
a `gst::Sample` or NULL when the appsink is stopped or EOS.
<!-- trait AppSinkExt::fn connect_pull_sample -->
This function blocks until a sample or EOS becomes available or the appsink
element is set to the READY/NULL state.
This function will only return samples when the appsink is in the PLAYING
state. All rendered samples will be put in a queue so that the application
can pull samples at its own rate.
Note that when the application does not pull samples fast enough, the
queued samples could consume a lot of memory, especially when dealing with
raw video frames. It's possible to control the behaviour of the queue with
the "drop" and "max-buffers" properties.
If an EOS event was received before any buffers, this function returns
`None`. Use gst_app_sink_is_eos () to check for the EOS condition.
# Returns
a `gst::Sample` or NULL when the appsink is stopped or EOS.
<!-- trait AppSinkExt::fn connect_try_pull_preroll -->
Get the last preroll sample in `appsink`. This was the sample that caused the
appsink to preroll in the PAUSED state. This sample can be pulled many times
and remains available to the application even after EOS.
This function is typically used when dealing with a pipeline in the PAUSED
state. Calling this function after doing a seek will give the sample right
after the seek position.
Note that the preroll sample will also be returned as the first sample
when calling `AppSink::pull_sample` or the "pull-sample" action signal.
If an EOS event was received before any buffers or the timeout expires,
this function returns `None`. Use gst_app_sink_is_eos () to check for the EOS
condition.
This function blocks until a preroll sample or EOS is received, the appsink
element is set to the READY/NULL state, or the timeout expires.
Feature: `v1_10`
## `timeout`
the maximum amount of time to wait for the preroll sample
# Returns
a `gst::Sample` or NULL when the appsink is stopped or EOS or the timeout expires.
<!-- trait AppSinkExt::fn connect_try_pull_sample -->
This function blocks until a sample or EOS becomes available or the appsink
element is set to the READY/NULL state or the timeout expires.
This function will only return samples when the appsink is in the PLAYING
state. All rendered samples will be put in a queue so that the application
can pull samples at its own rate.
Note that when the application does not pull samples fast enough, the
queued samples could consume a lot of memory, especially when dealing with
raw video frames. It's possible to control the behaviour of the queue with
the "drop" and "max-buffers" properties.
If an EOS event was received before any buffers or the timeout expires,
this function returns `None`. Use gst_app_sink_is_eos () to check
for the EOS condition.
Feature: `v1_10`
## `timeout`
the maximum amount of time to wait for a sample
# Returns
a `gst::Sample` or NULL when the appsink is stopped or EOS or the timeout expires.
<!-- struct AppSrc --> <!-- struct AppSrc -->
The appsrc element can be used by applications to insert data into a The appsrc element can be used by applications to insert data into a
GStreamer pipeline. Unlike most GStreamer elements, appsrc provides GStreamer pipeline. Unlike most GStreamer elements, appsrc provides
@ -303,7 +422,7 @@ occurs or the state of the appsrc has gone through READY.
# Implements # Implements
[`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html) [`BaseSrcExt`](trait.BaseSrcExt.html), [`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html), [`URIHandlerExt`](trait.URIHandlerExt.html)
<!-- impl AppSrc::fn end_of_stream --> <!-- impl AppSrc::fn end_of_stream -->
Indicates to the appsrc element that the last buffer queued in the Indicates to the appsrc element that the last buffer queued in the
element is the last buffer of the stream. element is the last buffer of the stream.
@ -458,6 +577,56 @@ be connected to.
A stream_type stream A stream_type stream
## `type_` ## `type_`
the new state the new state
<!-- trait AppSrcExt::fn connect_end_of_stream -->
Notify `appsrc` that no more buffer are available.
<!-- trait AppSrcExt::fn connect_enough_data -->
Signal that the source has enough data. It is recommended that the
application stops calling push-buffer until the need-data signal is
emitted again to avoid excessive buffer queueing.
<!-- trait AppSrcExt::fn connect_need_data -->
Signal that the source needs more data. In the callback or from another
thread you should call push-buffer or end-of-stream.
`length` is just a hint and when it is set to -1, any number of bytes can be
pushed into `appsrc`.
You can call push-buffer multiple times until the enough-data signal is
fired.
## `length`
the amount of bytes needed.
<!-- trait AppSrcExt::fn connect_push_buffer -->
Adds a buffer to the queue of buffers that the appsrc element will
push to its source pad. This function does not take ownership of the
buffer so the buffer 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.
## `buffer`
a buffer to push
<!-- trait AppSrcExt::fn connect_push_sample -->
Extract a buffer from the provided sample and adds the extracted buffer
to the queue of buffers that the appsrc element will
push to its source pad. This function set the appsrc caps based on the caps
in the sample and reset the caps if they change.
Only the caps and the buffer of the provided sample are used and not
for example the segment in the sample.
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`
a sample from which extract buffer to push
<!-- trait AppSrcExt::fn connect_seek_data -->
Seek to the given offset. The next push-buffer should produce buffers from
the new `offset`.
This callback is only called for seekable stream types.
## `offset`
the offset to seek to
# Returns
`true` if the seek succeeded.
<!-- enum AppStreamType --> <!-- enum AppStreamType -->
The stream type. The stream type.
<!-- enum AppStreamType::variant Stream --> <!-- enum AppStreamType::variant Stream -->

View file

@ -949,6 +949,66 @@ render function.
`gst::FlowReturn::Ok` if the preroll completed and processing can `gst::FlowReturn::Ok` if the preroll completed and processing can
continue. Any other return value should be returned from the render vmethod. continue. Any other return value should be returned from the render vmethod.
<!-- trait BaseSinkExt::fn get_property_async -->
If set to `true`, the basesink will perform asynchronous state changes.
When set to `false`, the sink will not signal the parent when it prerolls.
Use this option when dealing with sparse streams or when synchronisation is
not required.
<!-- trait BaseSinkExt::fn set_property_async -->
If set to `true`, the basesink will perform asynchronous state changes.
When set to `false`, the sink will not signal the parent when it prerolls.
Use this option when dealing with sparse streams or when synchronisation is
not required.
<!-- trait BaseSinkExt::fn get_property_blocksize -->
The amount of bytes to pull when operating in pull mode.
<!-- trait BaseSinkExt::fn set_property_blocksize -->
The amount of bytes to pull when operating in pull mode.
<!-- trait BaseSinkExt::fn get_property_enable-last-sample -->
Enable the last-sample property. If `false`, basesink doesn't keep a
reference to the last buffer arrived and the last-sample property is always
set to `None`. This can be useful if you need buffers to be released as soon
as possible, eg. if you're using a buffer pool.
<!-- trait BaseSinkExt::fn set_property_enable-last-sample -->
Enable the last-sample property. If `false`, basesink doesn't keep a
reference to the last buffer arrived and the last-sample property is always
set to `None`. This can be useful if you need buffers to be released as soon
as possible, eg. if you're using a buffer pool.
<!-- trait BaseSinkExt::fn get_property_last-sample -->
The last buffer that arrived in the sink and was used for preroll or for
rendering. This property can be used to generate thumbnails. This property
can be `None` when the sink has not yet received a buffer.
<!-- trait BaseSinkExt::fn get_property_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 set_property_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_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
make other sinks compensate for the delay.
<!-- trait BaseSinkExt::fn set_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
make other sinks compensate for the delay.
<!-- trait BaseSinkExt::fn get_property_throttle-time -->
The time to insert between buffers. This property can be used to control
the maximum amount of buffers per second to render. Setting this property
to a value bigger than 0 will make the sink create THROTTLE QoS events.
<!-- trait BaseSinkExt::fn set_property_throttle-time -->
The time to insert between buffers. This property can be used to control
the maximum amount of buffers per second to render. Setting this property
to a value bigger than 0 will make the sink create THROTTLE QoS events.
<!-- trait BaseSinkExt::fn get_property_ts-offset -->
Controls the final synchronisation, a negative value will render the buffer
earlier while a positive value delays playback. This property can be
used to fix synchronisation in bad files.
<!-- trait BaseSinkExt::fn set_property_ts-offset -->
Controls the final synchronisation, a negative value will render the buffer
earlier while a positive value delays playback. This property can be
used to fix synchronisation in bad files.
<!-- struct BaseSrc --> <!-- struct BaseSrc -->
This is a generic base class for source elements. The following This is a generic base class for source elements. The following
types of sources are supported: types of sources are supported:

File diff suppressed because it is too large Load diff

View file

@ -4,15 +4,15 @@ version = "0.9.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies] [dependencies]
glib = { version = "0.3", git = "https://github.com/gtk-rs/glib" } glib = "0.4"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.9", path = "../gstreamer" }
gstreamer-app = { path = "../gstreamer-app" } gstreamer-app = { version = "0.9", path = "../gstreamer-app" }
gstreamer-audio = { path = "../gstreamer-audio" } gstreamer-audio = { version = "0.9", path = "../gstreamer-audio" }
gstreamer-video = { path = "../gstreamer-video" } gstreamer-video = { version = "0.9", path = "../gstreamer-video" }
gstreamer-player = { path = "../gstreamer-player", optional = true } gstreamer-player = { version = "0.9", path = "../gstreamer-player", optional = true }
gtk = { version = "0.2", git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true } gtk = { version = "0.3", features = ["v3_6"], optional = true }
gdk = { version = "0.6", git = "https://github.com/gtk-rs/gdk", optional = true } gdk = { version = "0.7", optional = true }
gio = { version = "0.2", git = "https://github.com/gtk-rs/gio", optional = true } gio = { version = "0.3", optional = true }
futures = { version = "0.1", optional = true } futures = { version = "0.1", optional = true }
tokio-core = { version = "0.1", optional = true } tokio-core = { version = "0.1", optional = true }
send-cell = "0.1" send-cell = "0.1"

View file

@ -142,7 +142,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
Err(ErrorMessage { Err(ErrorMessage {
src: msg.get_src() src: msg.get_src()
.map(|s| s.get_path_string()) .map(|s| s.get_path_string())
.unwrap_or(String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().description().into(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),

View file

@ -113,7 +113,7 @@ fn main_loop(pipeline: gst::Pipeline, appsrc: gst_app::AppSrc) -> Result<(), Err
Err(ErrorMessage { Err(ErrorMessage {
src: msg.get_src() src: msg.get_src()
.map(|s| s.get_path_string()) .map(|s| s.get_path_string())
.unwrap_or(String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().description().into(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),

View file

@ -39,7 +39,7 @@ fn example_main() -> Result<(), Error> {
args[1].as_ref() args[1].as_ref()
} else { } else {
println!("Usage: decodebin file_path"); println!("Usage: decodebin file_path");
std::process::exit(-1); std::process::exit(-1)
}; };
let pipeline = gst::Pipeline::new(None); let pipeline = gst::Pipeline::new(None);
@ -177,7 +177,7 @@ fn example_main() -> Result<(), Error> {
ErrorMessage { ErrorMessage {
src: msg.get_src() src: msg.get_src()
.map(|s| s.get_path_string()) .map(|s| s.get_path_string())
.unwrap_or(String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().description().into(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),
@ -190,7 +190,7 @@ fn example_main() -> Result<(), Error> {
Err(ErrorMessage { Err(ErrorMessage {
src: msg.get_src() src: msg.get_src()
.map(|s| s.get_path_string()) .map(|s| s.get_path_string())
.unwrap_or(String::from("None")), .unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(), error: err.get_error().description().into(),
debug: err.get_debug(), debug: err.get_debug(),
cause: err.get_error(), cause: err.get_error(),

View file

@ -16,7 +16,7 @@ fn example_main() {
args[1].as_ref() args[1].as_ref()
} else { } else {
println!("Usage: playbin uri"); println!("Usage: playbin uri");
std::process::exit(-1); std::process::exit(-1)
}; };
let playbin = gst::ElementFactory::make("playbin", None).unwrap(); let playbin = gst::ElementFactory::make("playbin", None).unwrap();

View file

@ -75,13 +75,13 @@ fn example_main() {
args[1].as_ref() args[1].as_ref()
} else { } else {
println!("Usage: player uri"); println!("Usage: player uri");
std::process::exit(-1); std::process::exit(-1)
}; };
#[cfg(not(feature = "gst-player"))] #[cfg(not(feature = "gst-player"))]
{ {
eprintln!("Feature gst-player is required. Please rebuild with --features gst-player"); eprintln!("Feature gst-player is required. Please rebuild with --features gst-player");
std::process::exit(-1); std::process::exit(-1)
} }
#[cfg(feature = "gst-player")] #[cfg(feature = "gst-player")]

View file

@ -16,7 +16,7 @@ fn example_main() {
args[1].as_ref() args[1].as_ref()
} else { } else {
println!("Usage: toc file_path"); println!("Usage: toc file_path");
std::process::exit(-1); std::process::exit(-1)
}; };
let pipeline = gst::Pipeline::new(None); let pipeline = gst::Pipeline::new(None);

View file

@ -5,6 +5,85 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [0.8.1] - 2017-09-15 ## [0.8.1] - 2017-09-15
### Added ### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding - Implement Send+Sync for Query, Message and Event, and their corresponding

View file

@ -15,14 +15,14 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.5"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.5"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.3", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-base-sys = { version = "0.3", features = ["v1_8"] }
gstreamer-app-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-app-sys = { version = "0.3", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.4"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.9", path = "../gstreamer" }
gstreamer-base = { path = "../gstreamer-base" } gstreamer-base = { version = "0.9", path = "../gstreamer-base" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"

View file

@ -1,7 +1,8 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
@ -144,11 +145,12 @@ impl AppSink {
} }
pub fn get_property_buffer_list(&self) -> bool { pub fn get_property_buffer_list(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "buffer-list".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "buffer-list".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_buffer_list(&self, buffer_list: bool) { pub fn set_property_buffer_list(&self, buffer_list: bool) {
@ -158,11 +160,12 @@ impl AppSink {
} }
pub fn get_property_eos(&self) -> bool { pub fn get_property_eos(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "eos".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "eos".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn connect_eos<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_eos<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {

View file

@ -1,8 +1,9 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use AppStreamType; use AppStreamType;
use ffi; use ffi;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
@ -147,11 +148,12 @@ impl AppSrc {
} }
pub fn get_property_block(&self) -> bool { pub fn get_property_block(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "block".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "block".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_block(&self, block: bool) { pub fn set_property_block(&self, block: bool) {
@ -161,19 +163,21 @@ impl AppSrc {
} }
pub fn get_property_current_level_bytes(&self) -> u64 { pub fn get_property_current_level_bytes(&self) -> u64 {
let mut value = Value::from(&0u64);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <u64 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "current-level-bytes".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "current-level-bytes".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn get_property_duration(&self) -> u64 { pub fn get_property_duration(&self) -> u64 {
let mut value = Value::from(&0u64);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <u64 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "duration".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "duration".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_duration(&self, duration: u64) { pub fn set_property_duration(&self, duration: u64) {
@ -183,26 +187,27 @@ impl AppSrc {
} }
pub fn get_property_format(&self) -> gst::Format { pub fn get_property_format(&self) -> gst::Format {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <gst::Format as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "format".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "format".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<i32>().unwrap())) value.get().unwrap()
} }
} }
pub fn set_property_format(&self, format: gst::Format) { pub fn set_property_format(&self, format: gst::Format) {
let format = format.to_glib() as i32;
unsafe { unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "format".to_glib_none().0, Value::from(&format).to_glib_none().0); gobject_ffi::g_object_set_property(self.to_glib_none().0, "format".to_glib_none().0, Value::from(&format).to_glib_none().0);
} }
} }
pub fn get_property_is_live(&self) -> bool { pub fn get_property_is_live(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "is-live".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "is-live".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_is_live(&self, is_live: bool) { pub fn set_property_is_live(&self, is_live: bool) {
@ -212,11 +217,12 @@ impl AppSrc {
} }
pub fn get_property_max_latency(&self) -> i64 { pub fn get_property_max_latency(&self) -> i64 {
let mut value = Value::from(&0i64);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <i64 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "max-latency".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "max-latency".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_max_latency(&self, max_latency: i64) { pub fn set_property_max_latency(&self, max_latency: i64) {
@ -226,11 +232,12 @@ impl AppSrc {
} }
pub fn get_property_min_latency(&self) -> i64 { pub fn get_property_min_latency(&self) -> i64 {
let mut value = Value::from(&0i64);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <i64 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "min-latency".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "min-latency".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_min_latency(&self, min_latency: i64) { pub fn set_property_min_latency(&self, min_latency: i64) {
@ -240,11 +247,12 @@ impl AppSrc {
} }
pub fn get_property_min_percent(&self) -> u32 { pub fn get_property_min_percent(&self) -> u32 {
let mut value = Value::from(&0u32);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <u32 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "min-percent".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "min-percent".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
pub fn set_property_min_percent(&self, min_percent: u32) { pub fn set_property_min_percent(&self, min_percent: u32) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod app_sink; mod app_sink;

View file

@ -5,6 +5,85 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [0.8.1] - 2017-09-15 ## [0.8.1] - 2017-09-15
### Added ### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding - Implement Send+Sync for Query, Message and Event, and their corresponding

View file

@ -14,12 +14,12 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.5"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.5"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.3", features = ["v1_8"] }
gstreamer-audio-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-audio-sys = { version = "0.3", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.4"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.9", path = "../gstreamer" }
array-init = "0.0" array-init = "0.0"
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]

View file

@ -17,7 +17,7 @@ use std::str;
use glib; use glib;
use glib::translate::{from_glib, FromGlib, FromGlibPtrNone, ToGlib, ToGlibPtr, ToGlibPtrMut}; use glib::translate::{from_glib, FromGlib, FromGlibPtrNone, ToGlib, ToGlibPtr, ToGlibPtrMut};
#[derive(PartialEq, Eq, Debug)] #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
pub enum AudioEndianness { pub enum AudioEndianness {
Unknown, Unknown,
LittleEndian = 1234, LittleEndian = 1234,

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod stream_volume; mod stream_volume;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use StreamVolumeFormat; use StreamVolumeFormat;

View file

@ -5,10 +5,110 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [0.8.1] - 2017-09-15
### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding
Ref types.
### Fixed
- Constructor for gst_player::Player now works properly with GStreamer 1.12
when passing a video renderer or signal dispatcher. There was a reference
counting bug.
- Instead of returning &'static references from functions, return references
with a generic, unbound lifetime instead.
See https://github.com/rust-lang/rust/pull/42417#issue-233404573
- Various "unused external crate" warnings and clippy warnings everywhere.
### Changed
- Remove Cargo.lock from GIT, it's not very useful for library crates.
- Run everything through latest rustfmt-nightly.
- Use while-let (instead of loop and if-let) and CLOCK_TIME_NONE (instead of
u64::MAX) in the examples.
## [0.8.0] - 2017-08-31 ## [0.8.0] - 2017-08-31
- Initial release of the autogenerated GStreamer bindings. Older versions - Initial release of the autogenerated GStreamer bindings. Older versions
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...HEAD [Unreleased]: https://github.com/sdroege/gstreamer-rs/compare/0.8.1...HEAD
[0.8.1]: https://github.com/sdroege/gstreamer-rs/compare/0.8.0...0.8.1

View file

@ -14,12 +14,12 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.5"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.5"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.3", features = ["v1_8"] }
gstreamer-base-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-base-sys = { version = "0.3", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.4"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.9", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,8 +1,9 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -313,11 +314,12 @@ impl<O: IsA<BaseSink> + IsA<glib::object::Object>> BaseSinkExt for O {
} }
fn get_property_async(&self) -> bool { fn get_property_async(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "async".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "async".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_async(&self, async: bool) { fn set_property_async(&self, async: bool) {
@ -327,11 +329,12 @@ impl<O: IsA<BaseSink> + IsA<glib::object::Object>> BaseSinkExt for O {
} }
fn get_property_enable_last_sample(&self) -> bool { fn get_property_enable_last_sample(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "enable-last-sample".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "enable-last-sample".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_enable_last_sample(&self, enable_last_sample: bool) { fn set_property_enable_last_sample(&self, enable_last_sample: bool) {
@ -341,11 +344,12 @@ impl<O: IsA<BaseSink> + IsA<glib::object::Object>> BaseSinkExt for O {
} }
fn get_property_qos(&self) -> bool { fn get_property_qos(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "qos".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "qos".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_qos(&self, qos: bool) { fn set_property_qos(&self, qos: bool) {

View file

@ -1,8 +1,9 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -204,11 +205,12 @@ impl<O: IsA<BaseSrc> + IsA<glib::object::Object>> BaseSrcExt for O {
} }
fn get_property_num_buffers(&self) -> i32 { fn get_property_num_buffers(&self) -> i32 {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <i32 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "num-buffers".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "num-buffers".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_num_buffers(&self, num_buffers: i32) { fn set_property_num_buffers(&self, num_buffers: i32) {
@ -218,11 +220,12 @@ impl<O: IsA<BaseSrc> + IsA<glib::object::Object>> BaseSrcExt for O {
} }
fn get_property_typefind(&self) -> bool { fn get_property_typefind(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "typefind".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "typefind".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_typefind(&self, typefind: bool) { fn set_property_typefind(&self, typefind: bool) {

View file

@ -1,8 +1,9 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -150,11 +151,12 @@ impl<O: IsA<BaseTransform> + IsA<glib::object::Object>> BaseTransformExt for O {
} }
fn get_property_qos(&self) -> bool { fn get_property_qos(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "qos".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "qos".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_qos(&self, qos: bool) { fn set_property_qos(&self, qos: bool) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod adapter; mod adapter;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use BaseSrc; use BaseSrc;

View file

@ -5,6 +5,85 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [0.8.1] - 2017-09-15 ## [0.8.1] - 2017-09-15
### Added ### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding - Implement Send+Sync for Query, Message and Event, and their corresponding

View file

@ -15,11 +15,11 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.5"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.5"
gstreamer-player-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_12"] } gstreamer-player-sys = { version = "0.3", features = ["v1_12"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.4"
gstreamer = { path = "../gstreamer", features = ["v1_12"] } gstreamer = { version = "0.9", path = "../gstreamer", features = ["v1_12"] }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod player; mod player;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Error; use Error;
@ -11,6 +11,7 @@ use PlayerSubtitleInfo;
use PlayerVideoInfo; use PlayerVideoInfo;
use PlayerVisualization; use PlayerVisualization;
use ffi; use ffi;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
@ -280,11 +281,12 @@ impl Player {
} }
pub fn get_property_suburi(&self) -> Option<String> { pub fn get_property_suburi(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <String as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "suburi".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "suburi".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn set_property_suburi(&self, suburi: Option<&str>) { pub fn set_property_suburi(&self, suburi: Option<&str>) {
@ -294,30 +296,30 @@ impl Player {
} }
//pub fn get_property_video_multiview_flags(&self) -> /*Ignored*/gst_video::VideoMultiviewFlags { //pub fn get_property_video_multiview_flags(&self) -> /*Ignored*/gst_video::VideoMultiviewFlags {
// let mut value = Value::from(&0u32);
// unsafe { // unsafe {
// let mut value = Value::uninitialized();
// gobject_ffi::g_value_init(value.to_glib_none_mut().0, </*Unknown type*/ as StaticType>::static_type().to_glib());
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-multiview-flags".to_glib_none().0, value.to_glib_none_mut().0); // gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-multiview-flags".to_glib_none().0, value.to_glib_none_mut().0);
// from_glib(transmute(value.get::<u32>().unwrap())) // value.get().unwrap()
// } // }
//} //}
//pub fn set_property_video_multiview_flags(&self, video_multiview_flags: /*Ignored*/gst_video::VideoMultiviewFlags) { //pub fn set_property_video_multiview_flags(&self, video_multiview_flags: /*Ignored*/gst_video::VideoMultiviewFlags) {
// let video_multiview_flags = video_multiview_flags.to_glib().bits() as u32;
// unsafe { // unsafe {
// gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-multiview-flags".to_glib_none().0, Value::from(&video_multiview_flags).to_glib_none().0); // gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-multiview-flags".to_glib_none().0, Value::from(&video_multiview_flags).to_glib_none().0);
// } // }
//} //}
//pub fn get_property_video_multiview_mode(&self) -> /*Ignored*/gst_video::VideoMultiviewFramePacking { //pub fn get_property_video_multiview_mode(&self) -> /*Ignored*/gst_video::VideoMultiviewFramePacking {
// let mut value = Value::from(&0);
// unsafe { // unsafe {
// let mut value = Value::uninitialized();
// gobject_ffi::g_value_init(value.to_glib_none_mut().0, </*Unknown type*/ as StaticType>::static_type().to_glib());
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-multiview-mode".to_glib_none().0, value.to_glib_none_mut().0); // gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-multiview-mode".to_glib_none().0, value.to_glib_none_mut().0);
// from_glib(transmute(value.get::<i32>().unwrap())) // value.get().unwrap()
// } // }
//} //}
//pub fn set_property_video_multiview_mode(&self, video_multiview_mode: /*Ignored*/gst_video::VideoMultiviewFramePacking) { //pub fn set_property_video_multiview_mode(&self, video_multiview_mode: /*Ignored*/gst_video::VideoMultiviewFramePacking) {
// let video_multiview_mode = video_multiview_mode.to_glib() as i32;
// unsafe { // unsafe {
// gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-multiview-mode".to_glib_none().0, Value::from(&video_multiview_mode).to_glib_none().0); // gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-multiview-mode".to_glib_none().0, Value::from(&video_multiview_mode).to_glib_none().0);
// } // }

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use PlayerStreamInfo; use PlayerStreamInfo;

View file

@ -1,9 +1,10 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use PlayerSignalDispatcher; use PlayerSignalDispatcher;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
@ -25,11 +26,12 @@ glib_wrapper! {
impl PlayerGMainContextSignalDispatcher { impl PlayerGMainContextSignalDispatcher {
pub fn get_property_application_context(&self) -> Option<glib::MainContext> { pub fn get_property_application_context(&self) -> Option<glib::MainContext> {
let mut value = Value::from(None::<&glib::MainContext>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <glib::MainContext as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "application-context".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "application-context".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn connect_property_application_context_notify<F: Fn(&PlayerGMainContextSignalDispatcher) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { pub fn connect_property_application_context_notify<F: Fn(&PlayerGMainContextSignalDispatcher) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use PlayerAudioInfo; use PlayerAudioInfo;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use PlayerStreamInfo; use PlayerStreamInfo;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use PlayerStreamInfo; use PlayerStreamInfo;

View file

@ -1,9 +1,10 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use PlayerVideoRenderer; use PlayerVideoRenderer;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
@ -58,11 +59,12 @@ impl PlayerVideoOverlayVideoRenderer {
//} //}
pub fn get_property_video_sink(&self) -> Option<gst::Element> { pub fn get_property_video_sink(&self) -> Option<gst::Element> {
let mut value = Value::from(None::<&gst::Element>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <gst::Element as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-sink".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-sink".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) { pub fn set_property_video_sink<P: IsA<gst::Element> + IsA<glib::object::Object> + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -5,6 +5,85 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [0.8.1] - 2017-09-15 ## [0.8.1] - 2017-09-15
### Added ### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding - Implement Send+Sync for Query, Message and Event, and their corresponding

View file

@ -15,12 +15,12 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.5"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.5"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.3", features = ["v1_8"] }
gstreamer-video-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-video-sys = { version = "0.3", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.4"
gstreamer = { path = "../gstreamer" } gstreamer = { version = "0.9", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper] [build-dependencies.rustdoc-stripper]
version = "0.1" version = "0.1"

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod video_overlay; mod video_overlay;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -14,7 +14,7 @@ use std::str;
use glib::translate::{from_glib, FromGlib, ToGlib, ToGlibPtr}; use glib::translate::{from_glib, FromGlib, ToGlib, ToGlibPtr};
#[derive(PartialEq, Eq, Debug)] #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
pub enum VideoEndianness { pub enum VideoEndianness {
Unknown, Unknown,
LittleEndian = 1234, LittleEndian = 1234,

View file

@ -38,7 +38,7 @@ impl ToGlib for VideoColorRange {
VideoColorRange::Unknown => ffi::GST_VIDEO_COLOR_RANGE_UNKNOWN, VideoColorRange::Unknown => ffi::GST_VIDEO_COLOR_RANGE_UNKNOWN,
VideoColorRange::Range0255 => ffi::GST_VIDEO_COLOR_RANGE_0_255, VideoColorRange::Range0255 => ffi::GST_VIDEO_COLOR_RANGE_0_255,
VideoColorRange::Range16235 => ffi::GST_VIDEO_COLOR_RANGE_16_235, VideoColorRange::Range16235 => ffi::GST_VIDEO_COLOR_RANGE_16_235,
VideoColorRange::__Unknown(value) => unsafe { mem::transmute(value) }, VideoColorRange::__Unknown(value) => value,
} }
} }
} }
@ -70,9 +70,7 @@ impl<'a> glib::value::FromValueOptional<'a> for VideoColorRange {
impl<'a> glib::value::FromValue<'a> for VideoColorRange { impl<'a> glib::value::FromValue<'a> for VideoColorRange {
unsafe fn from_value(value: &glib::value::Value) -> Self { unsafe fn from_value(value: &glib::value::Value) -> Self {
from_glib(mem::transmute::<i32, ffi::GstVideoColorRange>( from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0))
gobject_ffi::g_value_get_enum(value.to_glib_none().0),
))
} }
} }
@ -255,7 +253,7 @@ impl<'a> VideoInfoBuilder<'a> {
if let Some(multiview_mode) = self.multiview_mode { if let Some(multiview_mode) = self.multiview_mode {
let ptr = &mut info._gst_reserved as *mut _ as *mut i32; let ptr = &mut info._gst_reserved as *mut _ as *mut i32;
ptr::write(ptr.offset(0), mem::transmute(multiview_mode.to_glib())); ptr::write(ptr.offset(0), multiview_mode.to_glib());
} }
if let Some(multiview_flags) = self.multiview_flags { if let Some(multiview_flags) = self.multiview_flags {
@ -267,7 +265,7 @@ impl<'a> VideoInfoBuilder<'a> {
{ {
if let Some(field_order) = self.field_order { if let Some(field_order) = self.field_order {
let ptr = &mut info._gst_reserved as *mut _ as *mut i32; let ptr = &mut info._gst_reserved as *mut _ as *mut i32;
ptr::write(ptr.offset(2), mem::transmute(field_order.to_glib())); ptr::write(ptr.offset(2), field_order.to_glib());
} }
} }
@ -498,14 +496,14 @@ impl VideoInfo {
pub fn multiview_mode(&self) -> ::VideoMultiviewMode { pub fn multiview_mode(&self) -> ::VideoMultiviewMode {
unsafe { unsafe {
let ptr = &self.0._gst_reserved as *const _ as *const i32; let ptr = &self.0._gst_reserved as *const _ as *const i32;
from_glib(mem::transmute(ptr::read(ptr.offset(0)))) from_glib(ptr::read(ptr.offset(0)))
} }
} }
pub fn multiview_flags(&self) -> ::VideoMultiviewFlags { pub fn multiview_flags(&self) -> ::VideoMultiviewFlags {
unsafe { unsafe {
let ptr = &self.0._gst_reserved as *const _ as *const u32; let ptr = &self.0._gst_reserved as *const _ as *const u32;
from_glib(mem::transmute(ptr::read(ptr.offset(1)))) from_glib(ffi::GstVideoMultiviewFlags::from_bits_truncate(ptr::read(ptr.offset(1))))
} }
} }
@ -513,7 +511,7 @@ impl VideoInfo {
pub fn field_order(&self) -> ::VideoFieldOrder { pub fn field_order(&self) -> ::VideoFieldOrder {
unsafe { unsafe {
let ptr = &self.0._gst_reserved as *const _ as *const i32; let ptr = &self.0._gst_reserved as *const _ as *const i32;
from_glib(mem::transmute(ptr::read(ptr.offset(2)))) from_glib(ptr::read(ptr.offset(2)))
} }
} }

View file

@ -5,6 +5,85 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.9.1] - 2017-11-26
### Fixed
- Export `FlowError`/`FlowSuccess`, `ClockError`/`ClockSuccess`,
`PadLinkError`/`PadLinkSuccess` too
## [0.9.0] - 2017-11-26
### Added
- Bindings for (outputting to) the GStreamer logging system
- Bindings for the GStreamer base library
- Bindings for all the `Pad` functions to override pad behaviour, and pad task
functions
- Bindings for `StaticCaps` and `StaticPadTemplate`
- Bindings for `deep-notify` signal on `Object`
- Support for directly creating `Error`/`Warning`/`Info` `Messages` and posting them
from an element with context information (file, line, module, etc.) similar
to the C `GST_ELEMENT_ERROR` macro
- Support for setting custom fields in `Messages`/`Events` during construction
- Support for creating Buffers out of anything that is `AsRef<[u8]>` or
`AsMut<[u8]>`
- Support for using the `Read` trait on `Adapter`
- Functions for getting all sink/src/all pads of an `Element`, and all children
of a `Bin`
- Builder for `Caps` and `Structures` in addition to the existing functions
- `AppSrc`/`AppSink` implement `BaseSrc`/`BaseSink` and `URIHandler`
- Rust ports of the basic tutorials 1 to 8 from
https://gstreamer.freedesktop.org/documentation/tutorials/
- "Getting started" and "Installation" sections to the README.md
- "dox" feature for generating documentation for all available configurations
### Fixed
- `StackTraceFlags` are only available since 1.12
- Worked around macOS requiring a `NSRunLoop` running on the main thread in all
examples and tutorials, to be able to show a window or anything else
### Changed
- `ClockTime` is now a wrapper around `Option<u64>` to handle the
`CLOCK_TIME_NONE` case better. This wrapper implements all the arithmetic
and other traits as needed and ensures that no accidential calculations with
`CLOCK_TIME_NONE` can happen
- "Values with format", like in `Duration`/`Position`/`Convert` queries or
`Seek` events now return a `FormatValue` type. This contains the actual
`Format` together with the value and does any required conversions. This
also makes it harder to accidentially mix e.g. values in bytes and time
- `PadProbeId` does not implement `Clone`/`Copy` anymore
- Property notify watches return a custom type instead of ulong
- `Error`/`Warning`/`Info` `Messages` can only be created with specific kinds of
`glib::Error` now. Using arbitrary ones does not work
- `Iterator` bindings were completely rewritten and provide the item type as a
generic type parameter now, greatly simplifying its usage
- All `glib::Values` are now `glib::SendValue` instead, e.g. in `Caps` and
`Structures`, as their content must be possible to send to different threads
safely
- `Message::get_src()` can return `None`
- Allow `None` as `Caps` in `AppSrc`/`AppSink`
- Allow everything implementing `Into<Option<&str>>` to be used as a pad name
- Moved `copy()` from `GstRc` directly to `MiniObject`
- Success/Error enums (like `FlowReturn`, `PadLinkReturn`, `StateChangeReturn`) now
implement an `into_result()` function that splits them into a `Result` with
the good and bad cases. Also mark them as `#[must_use]` to make it harder to
accidentially ignore errors.
- Error enums implement the `Error` trait
- Many examples use the `failure` crate for error handling now, cleaning up the
error handling code quite a bit
- Lots of other code cleanup, compiler/clippy warning cleanup, etc.
## [0.8.2] - 2017-11-11
### Fixed
- Implement StaticType of BufferRef instead of Buffer. Buffer aka
GstRc<BufferRef> already implements StaticType if BufferRef does, and
without this it was not possible to use Buffers in GValues.
- Free memory of the appsink/appsrc callbacks with the correct type. It was
crashing because of using the wrong type before.
- Fix documentation URLs in Cargo.toml.
### Added
- Installation instructions and links to documentation for getting started to
README.md.
## [0.8.1] - 2017-09-15 ## [0.8.1] - 2017-09-15
### Added ### Added
- Implement Send+Sync for Query, Message and Event, and their corresponding - Implement Send+Sync for Query, Message and Event, and their corresponding

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer" name = "gstreamer"
version = "0.9.0" version = "0.9.1"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer" description = "Rust bindings for GStreamer"
@ -15,10 +15,10 @@ build = "build.rs"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
glib-sys = { git = "https://github.com/gtk-rs/sys" } glib-sys = "0.5"
gobject-sys = { git = "https://github.com/gtk-rs/sys" } gobject-sys = "0.5"
gstreamer-sys = { git = "https://github.com/sdroege/gstreamer-sys", features = ["v1_8"] } gstreamer-sys = { version = "0.3", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/glib" } glib = "0.4"
num-rational = { version = "0.1.38", default-features = false, features = [] } num-rational = { version = "0.1.38", default-features = false, features = [] }
lazy_static = "0.2" lazy_static = "0.2"
futures = { version = "0.1", optional = true } futures = { version = "0.1", optional = true }

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
#[allow(unused_imports)] #[allow(unused_imports)]

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ChildProxy; use ChildProxy;
@ -10,6 +10,7 @@ use Pad;
use PadDirection; use PadDirection;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -205,11 +206,12 @@ impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O {
} }
fn get_property_async_handling(&self) -> bool { fn get_property_async_handling(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "async-handling".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "async-handling".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_async_handling(&self, async_handling: bool) { fn set_property_async_handling(&self, async_handling: bool) {
@ -219,11 +221,12 @@ impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O {
} }
fn get_property_message_forward(&self) -> bool { fn get_property_message_forward(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "message-forward".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "message-forward".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_message_forward(&self, message_forward: bool) { fn set_property_message_forward(&self, message_forward: bool) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ClockTime; use ClockTime;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,10 +1,11 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ClockTime; use ClockTime;
use Object; use Object;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -51,7 +52,7 @@ impl Clock {
// unsafe { TODO: call ffi::gst_clock_id_wait() } // unsafe { TODO: call ffi::gst_clock_id_wait() }
//} //}
//pub fn id_wait_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(id: /*Unimplemented*/ClockID, func: /*Unknown conversion*//*Unimplemented*/ClockCallback, user_data: P, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> ClockReturn { //pub fn id_wait_async(id: /*Unimplemented*/ClockID, func: /*Unknown conversion*//*Unimplemented*/ClockCallback, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> ClockReturn {
// unsafe { TODO: call ffi::gst_clock_id_wait_async() } // unsafe { TODO: call ffi::gst_clock_id_wait_async() }
//} //}
} }
@ -270,11 +271,12 @@ impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExt for O {
} }
fn get_property_window_size(&self) -> i32 { fn get_property_window_size(&self) -> i32 {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <i32 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "window-size".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "window-size".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_window_size(&self, window_size: i32) { fn set_property_window_size(&self, window_size: i32) {
@ -284,11 +286,12 @@ impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExt for O {
} }
fn get_property_window_threshold(&self) -> i32 { fn get_property_window_threshold(&self) -> i32 {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <i32 as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "window-threshold".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "window-threshold".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_window_threshold(&self, window_threshold: i32) { fn set_property_window_threshold(&self, window_threshold: i32) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;
@ -7,6 +7,7 @@ use Object;
use Structure; use Structure;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -119,35 +120,39 @@ impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {
} }
fn get_property_caps(&self) -> Option<Caps> { fn get_property_caps(&self) -> Option<Caps> {
let mut value = Value::from(None::<&Caps>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <Caps as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
fn get_property_device_class(&self) -> Option<String> { fn get_property_device_class(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <String as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "device-class".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "device-class".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
fn get_property_display_name(&self) -> Option<String> { fn get_property_display_name(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <String as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "display-name".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "display-name".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
fn get_property_properties(&self) -> Option<Structure> { fn get_property_properties(&self) -> Option<Structure> {
let mut value = Value::from(None::<&Structure>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <Structure as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "properties".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "properties".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bus; use Bus;
@ -7,6 +7,7 @@ use Device;
use Object; use Object;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -132,11 +133,12 @@ impl<O: IsA<DeviceMonitor> + IsA<glib::object::Object>> DeviceMonitorExt for O {
} }
fn get_property_show_all(&self) -> bool { fn get_property_show_all(&self) -> bool {
let mut value = Value::from(&false);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <bool as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "show-all".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "show-all".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
} }
value.get().unwrap()
} }
fn set_property_show_all(&self, show_all: bool) { fn set_property_show_all(&self, show_all: bool) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bus; use Bus;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use DeviceProvider; use DeviceProvider;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bus; use Bus;
@ -85,7 +85,7 @@ pub trait ElementExt {
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError>; fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError>;
//#[cfg(any(feature = "v1_10", feature = "dox"))] //#[cfg(any(feature = "v1_10", feature = "dox"))]
//fn call_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, user_data: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify); //fn call_async(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn change_state(&self, transition: StateChange) -> StateChangeReturn; fn change_state(&self, transition: StateChange) -> StateChangeReturn;
@ -199,7 +199,7 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
} }
//#[cfg(any(feature = "v1_10", feature = "dox"))] //#[cfg(any(feature = "v1_10", feature = "dox"))]
//fn call_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, user_data: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) { //fn call_async(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_element_call_async() } // unsafe { TODO: call ffi::gst_element_call_async() }
//} //}

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bin; use Bin;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Object; use Object;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod bin; mod bin;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ClockTime; use ClockTime;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;
@ -18,6 +18,7 @@ use Stream;
use TaskState; use TaskState;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -543,19 +544,21 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
} }
fn get_property_caps(&self) -> Option<Caps> { fn get_property_caps(&self) -> Option<Caps> {
let mut value = Value::from(None::<&Caps>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <Caps as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
fn get_property_template(&self) -> Option<PadTemplate> { fn get_property_template(&self) -> Option<PadTemplate> {
let mut value = Value::from(None::<&PadTemplate>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <PadTemplate as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "template".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "template".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
fn set_property_template(&self, template: Option<&PadTemplate>) { fn set_property_template(&self, template: Option<&PadTemplate>) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;
@ -7,6 +7,7 @@ use Pad;
use PadDirection; use PadDirection;
use PadPresence; use PadPresence;
use ffi; use ffi;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
@ -48,26 +49,29 @@ impl PadTemplate {
} }
pub fn get_property_direction(&self) -> PadDirection { pub fn get_property_direction(&self) -> PadDirection {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <PadDirection as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "direction".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "direction".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<i32>().unwrap())) value.get().unwrap()
} }
} }
pub fn get_property_name_template(&self) -> Option<String> { pub fn get_property_name_template(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <String as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "name-template".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "name-template".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn get_property_presence(&self) -> PadPresence { pub fn get_property_presence(&self) -> PadPresence {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <PadPresence as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "presence".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "presence".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<i32>().unwrap())) value.get().unwrap()
} }
} }

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bin; use Bin;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Error; use Error;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Object; use Object;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;
@ -7,6 +7,7 @@ use StreamFlags;
use StreamType; use StreamType;
use TagList; use TagList;
use ffi; use ffi;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
@ -107,11 +108,12 @@ impl Stream {
} }
pub fn get_property_caps(&self) -> Option<Caps> { pub fn get_property_caps(&self) -> Option<Caps> {
let mut value = Value::from(None::<&Caps>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <Caps as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn set_property_caps(&self, caps: Option<&Caps>) { pub fn set_property_caps(&self, caps: Option<&Caps>) {
@ -121,49 +123,51 @@ impl Stream {
} }
pub fn get_property_stream_flags(&self) -> StreamFlags { pub fn get_property_stream_flags(&self) -> StreamFlags {
let mut value = Value::from(&0u32);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <StreamFlags as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-flags".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-flags".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<u32>().unwrap())) value.get().unwrap()
} }
} }
pub fn set_property_stream_flags(&self, stream_flags: StreamFlags) { pub fn set_property_stream_flags(&self, stream_flags: StreamFlags) {
let stream_flags = stream_flags.to_glib().bits() as u32;
unsafe { unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "stream-flags".to_glib_none().0, Value::from(&stream_flags).to_glib_none().0); gobject_ffi::g_object_set_property(self.to_glib_none().0, "stream-flags".to_glib_none().0, Value::from(&stream_flags).to_glib_none().0);
} }
} }
pub fn get_property_stream_id(&self) -> Option<String> { pub fn get_property_stream_id(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <String as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-id".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-id".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn get_property_stream_type(&self) -> StreamType { pub fn get_property_stream_type(&self) -> StreamType {
let mut value = Value::from(&0u32);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <StreamType as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-type".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-type".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<u32>().unwrap())) value.get().unwrap()
} }
} }
pub fn set_property_stream_type(&self, stream_type: StreamType) { pub fn set_property_stream_type(&self, stream_type: StreamType) {
let stream_type = stream_type.to_glib().bits() as u32;
unsafe { unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "stream-type".to_glib_none().0, Value::from(&stream_type).to_glib_none().0); gobject_ffi::g_object_set_property(self.to_glib_none().0, "stream-type".to_glib_none().0, Value::from(&stream_type).to_glib_none().0);
} }
} }
pub fn get_property_tags(&self) -> Option<TagList> { pub fn get_property_tags(&self) -> Option<TagList> {
let mut value = Value::from(None::<&TagList>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <TagList as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "tags".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "tags".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn set_property_tags(&self, tags: Option<&TagList>) { pub fn set_property_tags(&self, tags: Option<&TagList>) {

View file

@ -1,10 +1,11 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Object; use Object;
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
use Stream; use Stream;
use ffi; use ffi;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::signal::connect; use glib::signal::connect;
@ -64,11 +65,12 @@ impl StreamCollection {
} }
pub fn get_property_upstream_id(&self) -> Option<String> { pub fn get_property_upstream_id(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <String as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "upstream-id".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "upstream-id".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
} }
value.get()
} }
pub fn set_property_upstream_id(&self, upstream_id: Option<&str>) { pub fn set_property_upstream_id(&self, upstream_id: Option<&str>) {

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Clock; use Clock;
@ -6,6 +6,7 @@ use ClockType;
use Object; use Object;
use ffi; use ffi;
use glib; use glib;
use glib::StaticType;
use glib::Value; use glib::Value;
use glib::object::Downcast; use glib::object::Downcast;
use glib::object::IsA; use glib::object::IsA;
@ -56,15 +57,15 @@ pub trait SystemClockExt {
impl<O: IsA<SystemClock> + IsA<glib::object::Object>> SystemClockExt for O { impl<O: IsA<SystemClock> + IsA<glib::object::Object>> SystemClockExt for O {
fn get_property_clock_type(&self) -> ClockType { fn get_property_clock_type(&self) -> ClockType {
let mut value = Value::from(&0);
unsafe { unsafe {
let mut value = Value::uninitialized();
gobject_ffi::g_value_init(value.to_glib_none_mut().0, <ClockType as StaticType>::static_type().to_glib());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "clock-type".to_glib_none().0, value.to_glib_none_mut().0); gobject_ffi::g_object_get_property(self.to_glib_none().0, "clock-type".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<i32>().unwrap())) value.get().unwrap()
} }
} }
fn set_property_clock_type(&self, clock_type: ClockType) { fn set_property_clock_type(&self, clock_type: ClockType) {
let clock_type = clock_type.to_glib() as i32;
unsafe { unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "clock-type".to_glib_none().0, Value::from(&clock_type).to_glib_none().0); gobject_ffi::g_object_set_property(self.to_glib_none().0, "clock-type".to_glib_none().0, Value::from(&clock_type).to_glib_none().0);
} }

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Element; use Element;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Element; use Element;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (0409d73) from gir-files (???) // This file was generated by gir (d50d839) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Error; use Error;

View file

@ -371,7 +371,15 @@ impl ToOwned for BufferRef {
impl fmt::Debug for BufferRef { impl fmt::Debug for BufferRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", unsafe { self.as_ptr() }) f.debug_struct("Buffer")
.field("pts", &self.get_pts().to_string())
.field("dts", &self.get_dts().to_string())
.field("duration", &self.get_duration().to_string())
.field("size", &self.get_size())
.field("offset", &self.get_offset())
.field("offset_end", &self.get_offset_end())
.field("flags", &self.get_flags())
.finish()
} }
} }

View file

@ -10,6 +10,7 @@ use ffi;
use glib; use glib;
use glib::StaticType; use glib::StaticType;
use glib::translate::{from_glib, from_glib_full}; use glib::translate::{from_glib, from_glib_full};
use std::fmt;
use miniobject::*; use miniobject::*;
use Buffer; use Buffer;
@ -94,6 +95,20 @@ impl ToOwned for BufferListRef {
} }
} }
impl fmt::Debug for BufferListRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let size = self.iter().map(|b| b.get_size()).sum::<usize>();
let (pts, dts) = self.get(0).map(|b| (b.get_pts(), b.get_dts())).unwrap_or((::ClockTime::none(), ::ClockTime::none()));
f.debug_struct("BufferList")
.field("buffers", &self.len())
.field("pts", &pts.to_string())
.field("dts", &dts.to_string())
.field("size", &size)
.finish()
}
}
impl StaticType for BufferListRef { impl StaticType for BufferListRef {
fn static_type() -> glib::Type { fn static_type() -> glib::Type {
unsafe { from_glib(ffi::gst_buffer_list_get_type()) } unsafe { from_glib(ffi::gst_buffer_list_get_type()) }

View file

@ -149,7 +149,7 @@ mod futures {
pub fn new(bus: &Bus) -> Self { pub fn new(bus: &Bus) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
let task = Arc::new(Mutex::new(None)); let task = Arc::new(Mutex::new(None));
let task_clone = task.clone(); let task_clone = Arc::clone(&task);
bus.set_sync_handler(move |_, _| { bus.set_sync_handler(move |_, _| {
let mut task = task_clone.lock().unwrap(); let mut task = task_clone.lock().unwrap();

View file

@ -344,6 +344,14 @@ define_iter!(Iter, &'a CapsRef, &'a StructureRef);
define_iter!(IterMut, &'a mut CapsRef, &'a mut StructureRef); define_iter!(IterMut, &'a mut CapsRef, &'a mut StructureRef);
impl fmt::Debug for CapsRef { impl fmt::Debug for CapsRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Caps")
.field(&self.to_string())
.finish()
}
}
impl fmt::Display for CapsRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.to_string()) f.write_str(&self.to_string())
} }

View file

@ -6,6 +6,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use std::fmt;
use std::ffi::CStr; use std::ffi::CStr;
use ffi; use ffi;
@ -76,6 +77,15 @@ impl StaticType for ContextRef {
} }
} }
impl fmt::Debug for ContextRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Context")
.field("type", &self.get_context_type())
.field("structure", &self.get_structure())
.finish()
}
}
impl ToOwned for ContextRef { impl ToOwned for ContextRef {
type Owned = GstRc<ContextRef>; type Owned = GstRc<ContextRef>;

View file

@ -0,0 +1,16 @@
// Copyright (C) 2017 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 DateTime;
use std::fmt;
impl fmt::Display for DateTime {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(self.to_iso8601_string().unwrap_or(String::from("None")).as_str())
}
}

View file

@ -54,6 +54,7 @@ impl Element {
} }
} }
#[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
pub enum ElementMessageType { pub enum ElementMessageType {
Error, Error,
Warning, Warning,

View file

@ -12,6 +12,8 @@ use structure::*;
use std::ptr; use std::ptr;
use std::mem; use std::mem;
use std::cmp;
use std::fmt;
use std::ffi::CStr; use std::ffi::CStr;
use glib; use glib;
@ -21,6 +23,8 @@ use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibP
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
use glib::translate::FromGlibPtrContainer; use glib::translate::FromGlibPtrContainer;
use EventType;
#[repr(C)] #[repr(C)]
pub struct EventRef(ffi::GstEvent); pub struct EventRef(ffi::GstEvent);
@ -33,6 +37,60 @@ unsafe impl MiniObject for EventRef {
type GstType = ffi::GstEvent; type GstType = ffi::GstEvent;
} }
impl EventType {
pub fn is_upstream(&self) -> bool {
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_UPSTREAM.bits()) != 0
}
pub fn is_downstream(&self) -> bool {
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_DOWNSTREAM.bits()) != 0
}
pub fn is_serialized(&self) -> bool {
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_SERIALIZED.bits()) != 0
}
pub fn is_sticky(&self) -> bool {
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_STICKY.bits()) != 0
}
pub fn is_sticky_multi(&self) -> bool {
(self.to_glib() as u32) & (ffi::GST_EVENT_TYPE_STICKY_MULTI.bits()) != 0
}
}
impl PartialOrd for EventType {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
if !self.is_serialized() || !other.is_serialized() {
return None;
}
let v1 = self.to_glib() as u32;
let v2 = other.to_glib() as u32;
let stream_start = ffi::GST_EVENT_STREAM_START as u32;
let segment = ffi::GST_EVENT_SEGMENT as u32;
let eos = ffi::GST_EVENT_EOS as u32;
// Strictly ordered range between stream_start and segment,
// and EOS is bigger than everything else
if v1 >= stream_start && v1 <= segment || v2 >= stream_start && v2 <= segment {
Some(v1.cmp(&v2))
// If one is EOS, the other is definitely less or equal
} else if v1 == eos || v2 == eos {
if v1 == v2 {
Some(cmp::Ordering::Equal)
} else if v1 == eos {
Some(cmp::Ordering::Greater)
} else {
Some(cmp::Ordering::Less)
}
} else {
None
}
}
}
impl EventRef { impl EventRef {
pub fn get_seqnum(&self) -> u32 { pub fn get_seqnum(&self) -> u32 {
unsafe { ffi::gst_event_get_seqnum(self.as_mut_ptr()) } unsafe { ffi::gst_event_get_seqnum(self.as_mut_ptr()) }
@ -51,23 +109,27 @@ impl EventRef {
} }
pub fn is_upstream(&self) -> bool { pub fn is_upstream(&self) -> bool {
unsafe { ((*self.as_ptr()).type_ as u32) & (ffi::GST_EVENT_TYPE_UPSTREAM.bits()) != 0 } self.get_type().is_upstream()
} }
pub fn is_downstream(&self) -> bool { pub fn is_downstream(&self) -> bool {
unsafe { ((*self.as_ptr()).type_ as u32) & (ffi::GST_EVENT_TYPE_DOWNSTREAM.bits()) != 0 } self.get_type().is_downstream()
} }
pub fn is_serialized(&self) -> bool { pub fn is_serialized(&self) -> bool {
unsafe { ((*self.as_ptr()).type_ as u32) & (ffi::GST_EVENT_TYPE_SERIALIZED.bits()) != 0 } self.get_type().is_serialized()
} }
pub fn is_sticky(&self) -> bool { pub fn is_sticky(&self) -> bool {
unsafe { ((*self.as_ptr()).type_ as u32) & (ffi::GST_EVENT_TYPE_STICKY.bits()) != 0 } self.get_type().is_sticky()
} }
pub fn is_sticky_multi(&self) -> bool { pub fn is_sticky_multi(&self) -> bool {
unsafe { ((*self.as_ptr()).type_ as u32) & (ffi::GST_EVENT_TYPE_STICKY_MULTI.bits()) != 0 } self.get_type().is_sticky_multi()
}
pub fn get_type(&self) -> EventType {
unsafe { from_glib((*self.as_ptr()).type_) }
} }
pub fn view(&self) -> EventView { pub fn view(&self) -> EventView {
@ -139,9 +201,9 @@ impl GstRc<EventRef> {
} }
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn new_stream_collection<'a>( pub fn new_stream_collection(
stream_collection: &'a ::StreamCollection, stream_collection: &::StreamCollection,
) -> StreamCollectionBuilder<'a> { ) -> StreamCollectionBuilder {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
StreamCollectionBuilder::new(stream_collection) StreamCollectionBuilder::new(stream_collection)
} }
@ -307,6 +369,30 @@ impl glib::types::StaticType for EventRef {
} }
} }
impl fmt::Debug for EventRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Event")
.field("type", & unsafe {
let type_ = ffi::gst_event_type_get_name((*self.as_ptr()).type_);
CStr::from_ptr(type_).to_str().unwrap()
})
.field("seqnum", &self.get_seqnum())
.field("structure", &self.get_structure())
.finish()
}
}
impl ToOwned for EventRef {
type Owned = GstRc<EventRef>;
fn to_owned(&self) -> GstRc<EventRef> {
unsafe {
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
as *mut _)
}
}
}
pub enum EventView<'a> { pub enum EventView<'a> {
FlushStart(FlushStart<'a>), FlushStart(FlushStart<'a>),
FlushStop(FlushStop<'a>), FlushStop(FlushStop<'a>),

View file

@ -355,7 +355,7 @@ unsafe extern "C" fn filter_boxed_ref<T: 'static>(boxed: gpointer) -> gpointer {
callback_guard!(); callback_guard!();
let boxed = Arc::from_raw(boxed as *const (Box<Fn(T) -> bool + Send + Sync + 'static>)); let boxed = Arc::from_raw(boxed as *const (Box<Fn(T) -> bool + Send + Sync + 'static>));
let copy = boxed.clone(); let copy = Arc::clone(&boxed);
// Forget it and keep it alive, we will still need it later // Forget it and keep it alive, we will still need it later
let _ = Arc::into_raw(boxed); let _ = Arc::into_raw(boxed);

View file

@ -106,6 +106,7 @@ mod parse_context;
mod enums; mod enums;
mod clock_time; mod clock_time;
mod format; mod format;
mod date_time;
pub use object::GstObjectExtManual; pub use object::GstObjectExtManual;
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId}; pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
pub use element::{ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI, pub use element::{ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI,
@ -120,7 +121,8 @@ pub use device_provider::DeviceProviderExtManual;
pub use parse_context::ParseContext; pub use parse_context::ParseContext;
#[cfg(any(feature = "futures", feature = "dox"))] #[cfg(any(feature = "futures", feature = "dox"))]
pub use bus::BusStream; pub use bus::BusStream;
pub use enums::{StateChangeError, StateChangeSuccess}; pub use enums::{ClockError, ClockSuccess, FlowError, FlowSuccess, PadLinkError, PadLinkSuccess,
StateChangeError, StateChangeSuccess};
pub use clock_time::ClockTime; pub use clock_time::ClockTime;
pub use format::FormatValue; pub use format::FormatValue;

Some files were not shown because too many files have changed in this diff Show more