Skip to content
Commits on Source (112)
......@@ -5,6 +5,7 @@ members = [
"gstreamer-app",
"gstreamer-audio",
"gstreamer-base",
"gstreamer-net",
"gstreamer-player",
"gstreamer-video",
"examples",
......
......@@ -36,9 +36,6 @@ generate = [
"Gst.URIError",
"Gst.StructureChangeType",
"Gst.StreamStatusType",
"Gst.DeviceProvider",
"Gst.Device",
"Gst.DeviceMonitor",
"Gst.StreamType",
"Gst.StreamFlags",
"Gst.ProgressType",
......@@ -48,11 +45,11 @@ generate = [
"Gst.PadProbeReturn",
"Gst.CapsIntersectMode",
"Gst.BufferFlags",
"Gst.BufferCopyFlags",
"Gst.SegmentFlags",
"Gst.PadMode",
"Gst.SchedulingFlags",
"Gst.ChildProxy",
"Gst.Preset",
"Gst.TagSetter",
"Gst.QOSType",
"Gst.EventType",
......@@ -70,6 +67,9 @@ generate = [
"Gst.DebugGraphDetails",
"Gst.ParseFlags",
"Gst.TaskState",
"Gst.PluginDependencyFlags",
"Gst.DateTime",
"Gst.TypeFindProbability",
]
manual = [
......@@ -119,6 +119,11 @@ trait = false
# Needs manual bindings and GSource support in glib-rs
ignore = true
[[object.function]]
name = "add_signal_watch_full"
# Priority
ignore = true
[[object.function]]
name = "timed_pop_filtered"
# Uses enum as flags
......@@ -141,6 +146,10 @@ trait = false
name = "message"
concurrency = "send"
[[object.function]]
name = "post"
[object.function.return]
bool_return_is_error = "Failed to post message"
[[object]]
name = "Gst.Structure"
......@@ -207,11 +216,6 @@ name = "Gst.TocEntry"
status = "manual"
ref_mode = "ref"
[[object]]
name = "Gst.DateTime"
status = "generate"
concurrency = "send"
[[object]]
name = "Gst.Clock"
status = "generate"
......@@ -225,6 +229,16 @@ status = "generate"
[object.function.return]
bool_return_is_error = "Timed out waiting for sync"
[[object.function]]
name = "adjust_with_calibration"
# Useless clock parameter
ignore = true
[[object.function]]
name = "unadjust_with_calibration"
# Useless clock parameter
ignore = true
[[object]]
name = "Gst.SystemClock"
status = "generate"
......@@ -266,6 +280,16 @@ status = "generate"
[object.function.return]
bool_return_is_error = "Failed to link pads"
[[object.function]]
name = "link_pads_full"
[object.function.return]
bool_return_is_error = "Failed to link pads"
[[object.function]]
name = "post_message"
[object.function.return]
bool_return_is_error = "Failed to post message"
[[object.function]]
name = "seek"
[object.function.return]
......@@ -341,16 +365,70 @@ status = "generate"
# formatted value
ignore = true
[[object.function]]
name = "state_change_return_get_name"
# Wrong place
ignore = true
[[object.function]]
name = "state_get_name"
# Wrong place
ignore = true
[[object]]
name = "Gst.ElementFactory"
status = "generate"
trait = false
[[object]]
name = "Gst.TypeFindFactory"
status = "generate"
trait = false
[[object]]
name = "Gst.DeviceProviderFactory"
status = "generate"
trait = false
[[object]]
name = "Gst.DeviceProvider"
status = "generate"
[[object.function]]
name = "get_bus"
[object.function.return]
nullable = false
[[object.function]]
name = "start"
[object.function.return]
bool_return_is_error = "Failed to start"
[[object]]
name = "Gst.DeviceMonitor"
status = "generate"
[[object.function]]
name = "get_bus"
[object.function.return]
nullable = false
[[object.function]]
name = "start"
[object.function.return]
bool_return_is_error = "Failed to start"
[[object]]
name = "Gst.Device"
status = "generate"
[[object.function]]
name = "get_display_name"
[object.function.return]
nullable = false
[[object.function]]
name = "get_device_class"
[object.function.return]
nullable = false
[[object]]
name = "Gst.Object"
# For renaming the trait...
......@@ -366,6 +444,12 @@ trait_name = "GstObjectExt"
[object.function.return]
nullable = false
[[object.function]]
name = "set_name"
[[object.function.parameter]]
name = "name"
nullable = false
[[object.function]]
name = "get_path_string"
[object.function.return]
......@@ -524,6 +608,11 @@ status = "generate"
# formatted value
ignore = true
[[object.function]]
name = "link_get_name"
# Wrong place
ignore = true
[[object]]
name = "Gst.PadTemplate"
status = "generate"
......@@ -549,6 +638,16 @@ status = "generate"
name = "construct"
ignore = true
[[object.function]]
name = "activate_mode_default"
# wrong instance type
ignore = true
[[object.function]]
name = "internal_activate_mode_default"
# wrong instance type
ignore = true
[[object]]
name = "Gst.ProxyPad"
status = "generate"
......@@ -583,14 +682,128 @@ name = "Gst.Plugin"
status = "generate"
trait = false
[[object.function]]
name = "list_free"
# useless and unsafe
ignore = true
[[object.function]]
name = "set_cache_data"
# pass by value
ignore = true
[[object.function]]
name = "get_cache_data"
# structure ref
ignore = true
[[object.function]]
name = "get_description"
[object.function.return]
nullable = false
[[object.function]]
name = "get_name"
[object.function.return]
nullable = false
[[object.function]]
name = "get_license"
[object.function.return]
nullable = false
[[object.function]]
name = "get_origin"
[object.function.return]
nullable = false
[[object.function]]
name = "get_package"
[object.function.return]
nullable = false
[[object.function]]
name = "get_source"
[object.function.return]
nullable = false
[[object.function]]
name = "get_version"
[object.function.return]
nullable = false
[[object]]
name = "Gst.*"
name = "Gst.PluginFeature"
status = "generate"
[[object.function]]
pattern = "list_.*"
ignore = true
[[object.function]]
name = "rank_compare_func"
ignore = true
[[object]]
name = "Gst.Registry"
status = "generate"
trait = false
[[object.function]]
pattern = "fork_.*"
ignore = true
[[object.function]]
name = "get"
[object.function.return]
nullable = false
[[object.function]]
name = "add_feature"
[object.function.return]
bool_return_is_error = "Failed to add feature"
[[object.function]]
name = "add_plugin"
[object.function.return]
bool_return_is_error = "Failed to add plugin"
[[object]]
name = "Gst.Preset"
status = "generate"
[[object.function]]
name = "set_app_dir"
[object.function.return]
bool_return_is_error = "Failed to set app preset directory"
[[object.function]]
name = "delete_preset"
[object.function.return]
bool_return_is_error = "Failed to delete preset"
[[object.function]]
name = "load_preset"
[object.function.return]
bool_return_is_error = "Failed to load preset"
[[object.function]]
name = "update_registry"
name = "save_preset"
[object.function.return]
bool_return_is_error = "Failed to update registry"
bool_return_is_error = "Failed to save preset"
[[object.function]]
name = "rename_preset"
[object.function.return]
bool_return_is_error = "Failed to rename preset"
[[object.function]]
name = "set_meta"
[object.function.return]
bool_return_is_error = "Failed to set preset meta"
[[object]]
name = "Gst.*"
status = "generate"
[[object.function]]
name = "util_dump_mem"
ignore = true
......@@ -761,6 +974,31 @@ status = "generate"
# wrong mutable for context parameter
ignore = true
[[object.function]]
name = "util_group_id_next"
# newtype wrapper
ignore = true
[[object.function]]
name = "util_seqnum_next"
# newtype wrapper
ignore = true
[[object.function]]
name = "debug_bin_to_dot_data"
[object.function.return]
nullable = false
[[object.function]]
name = "version_string"
[object.function.return]
nullable = false
[[object.function]]
name = "parse_bin_from_description"
[object.function.return]
nullable = false
[[object]]
name = "Gst.StateChangeReturn"
status = "generate"
......
......@@ -86,6 +86,16 @@ trait = false
# Action signal
ignore = true
[[object.function]]
name = "set_latency"
# ClockTime
ignore = true
[[object.function]]
name = "get_latency"
# ClockTime
ignore = true
[[object.function]]
name = "set_caps"
[[object.function.parameter]]
......
......@@ -31,6 +31,7 @@ manual = [
"Gst.FlowReturn",
"Gst.Format",
"Gst.Pad",
"Gst.TypeFindProbability",
]
[[object]]
......@@ -71,6 +72,15 @@ status = "manual"
trait = false
concurrency = "none"
[[object]]
name = "GstBase.*"
status = "generate"
[[object.function]]
name = "type_find_helper_for_data"
# broken data type
ignore = true
[[object]]
name = "Gst.Structure"
status = "manual"
......
[options]
girs_dir = "gir-files"
library = "GstNet"
version = "1.0"
min_cfg_version = "1.8"
target_path = "gstreamer-net"
work_mode = "normal"
concurrency = "send+sync"
generate_safety_asserts = true
external_libraries = [
"GLib",
"GObject",
"Gst",
"Gio",
]
generate = [
]
manual = [
"GObject.Object",
"Gst.Object",
"Gst.Clock",
"Gst.Bus",
]
[[object]]
name = "Gst.ClockTime"
status = "manual"
conversion_type = "scalar"
[[object]]
name = "GstNet.NtpClock"
status = "generate"
trait = false
[[object.function]]
name = "new"
[[object.function.parameter]]
name = "name"
nullable = true
[[object]]
name = "GstNet.PtpClock"
status = "generate"
trait = false
[[object.function]]
name = "new"
[[object.function.parameter]]
name = "name"
nullable = true
[[object]]
name = "GstNet.NetClientClock"
status = "generate"
trait = false
[[object.function]]
name = "new"
[[object.function.parameter]]
name = "name"
nullable = true
[[object]]
name = "GstNet.NetTimeProvider"
status = "generate"
trait = false
......@@ -19,7 +19,6 @@ generate = [
"GstPlayer.PlayerSignalDispatcher",
"GstPlayer.PlayerSnapshotFormat",
"GstPlayer.PlayerState",
"GstPlayer.PlayerStreamInfo",
"GstPlayer.PlayerVideoRenderer",
"GstPlayer.PlayerVisualization",
]
......@@ -29,6 +28,8 @@ manual = [
"GLib.MainContext",
"GObject.Object",
"Gst.Element",
"GstVideo.VideoMultiviewFlags",
"GstVideo.VideoMultiviewFramePacking",
]
[[object]]
......@@ -64,13 +65,52 @@ trait = false
[[object.function]]
name = "set_config"
# Pass by value
# Custom type
ignore = true
[[object.function]]
name = "new"
ignore = true
[[object.function]]
name = "get_config"
# Custom type
ignore = true
[[object.function]]
pattern = "config_.*"
# Custom type
ignore = true
[[object.function]]
name = "get_pipeline"
[object.function.return]
nullable = false
[[object.function]]
name = "set_audio_track"
[object.function.return]
bool_return_is_error = "Failed to set audio track"
[[object.function]]
name = "set_subtitle_track"
[object.function.return]
bool_return_is_error = "Failed to set subtitle track"
[[object.function]]
name = "set_video_track"
[object.function.return]
bool_return_is_error = "Failed to set video track"
[[object.function]]
name = "set_visualization"
[[object.function.parameter]]
name = "name"
nullable = true
[object.function.return]
bool_return_is_error = "Failed to set visualization"
[[object.signal]]
name = "buffering"
concurrency = "send"
......@@ -78,6 +118,8 @@ trait = false
[[object.signal]]
name = "duration-changed"
concurrency = "send"
# Pass ClockTime instead of u64
ignore = true
[[object.signal]]
name = "end-of-stream"
......@@ -96,12 +138,16 @@ trait = false
concurrency = "send"
[[object.signal]]
name = "position-changed"
name = "position-updated"
concurrency = "send"
# Pass ClockTime instead of u64
ignore = true
[[object.signal]]
name = "seek-done"
concurrency = "send"
# Pass ClockTime instead of u64
ignore = true
[[object.signal]]
name = "state-changed"
......@@ -123,6 +169,16 @@ trait = false
name = "warning"
concurrency = "send"
[[object]]
name = "GstPlayer.PlayerStreamInfo"
status = "generate"
[[object.function]]
name = "get_stream_type"
[object.function.return]
nullable = false
[[object]]
name = "GstPlayer.PlayerAudioInfo"
status = "generate"
......@@ -133,6 +189,16 @@ name = "GstPlayer.PlayerVideoInfo"
status = "generate"
trait = false
[[object.function]]
name = "get_framerate"
# Fraction
ignore = true
[[object.function]]
name = "get_pixel_aspect_ratio"
# Fraction
ignore = true
[[object]]
name = "GstPlayer.PlayerSubtitleInfo"
status = "generate"
......@@ -143,6 +209,11 @@ name = "GstPlayer.PlayerMediaInfo"
status = "generate"
trait = false
[[object.function]]
name = "get_uri"
[object.function.return]
nullable = false
[[object]]
name = "GstPlayer.PlayerVideoOverlayVideoRenderer"
status = "generate"
......
......@@ -28,6 +28,7 @@ generate = [
"GstVideo.VideoMultiviewFlags",
"GstVideo.VideoFieldOrder",
"GstVideo.VideoFrameFlags",
"GstVideo.VideoMultiviewFramePacking",
]
manual = [
......
......@@ -39,7 +39,7 @@ to avoid polling.
# Implements
[`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`gst_base::BaseSinkExt`](../gst_base/trait.BaseSinkExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`gst::URIHandlerExt`](../gst/trait.URIHandlerExt.html)
<!-- impl AppSink::fn get_buffer_list_support -->
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.
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 -->
The appsrc element can be used by applications to insert data into a
GStreamer pipeline. Unlike most GStreamer elements, appsrc provides
......@@ -303,7 +422,7 @@ occurs or the state of the appsrc has gone through READY.
# Implements
[`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`gst_base::BaseSrcExt`](../gst_base/trait.BaseSrcExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`gst::URIHandlerExt`](../gst/trait.URIHandlerExt.html)
<!-- impl AppSrc::fn end_of_stream -->
Indicates to the appsrc element that the last buffer queued in the
element is the last buffer of the stream.
......@@ -458,6 +577,56 @@ be connected to.
A stream_type stream
## `type_`
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 -->
The stream type.
<!-- enum AppStreamType::variant Stream -->
......
......@@ -103,7 +103,7 @@ buffer pushed in it.
# Implements
[`ObjectExt`](trait.ObjectExt.html)
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl Adapter::fn new -->
Creates a new `Adapter`. Free with `gobject::ObjectExt::unref`.
......@@ -664,7 +664,7 @@ with non-synchronized streams or sparse streams.
# Implements
[`BaseSinkExt`](trait.BaseSinkExt.html), [`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`BaseSinkExt`](trait.BaseSinkExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- trait BaseSinkExt -->
Trait containing all `BaseSink` methods.
......@@ -949,6 +949,66 @@ render function.
`gst::FlowReturn::Ok` if the preroll completed and processing can
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 -->
This is a generic base class for source elements. The following
types of sources are supported:
......@@ -1066,7 +1126,7 @@ received, it may safely shut down the entire pipeline.
# Implements
[`BaseSrcExt`](trait.BaseSrcExt.html), [`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`BaseSrcExt`](trait.BaseSrcExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- trait BaseSrcExt -->
Trait containing all `BaseSrc` methods.
......@@ -1343,7 +1403,7 @@ It provides for:
# Implements
[`BaseTransformExt`](trait.BaseTransformExt.html), [`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`BaseTransformExt`](trait.BaseTransformExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- trait BaseTransformExt -->
Trait containing all `BaseTransform` methods.
......@@ -1581,4 +1641,4 @@ base class.
# Implements
[`BaseSrcExt`](trait.BaseSrcExt.html), [`ElementExt`](trait.ElementExt.html), [`ObjectExt`](trait.ObjectExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`BaseSrcExt`](trait.BaseSrcExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- file * -->
<!-- struct NetClientClock -->
`NetClientClock` implements a custom `gst::Clock` that synchronizes its time
to a remote time provider such as `NetTimeProvider`. `NtpClock`
implements a `gst::Clock` that synchronizes its time to a remote NTPv4 server.
A new clock is created with `NetClientClock::new` or
`NtpClock::new`, which takes the address and port of the remote time
provider along with a name and an initial time.
This clock will poll the time provider and will update its calibration
parameters based on the local and remote observations.
The "round-trip" property limits the maximum round trip packets can take.
Various parameters of the clock can be configured with the parent `gst::Clock`
"timeout", "window-size" and "window-threshold" object properties.
A `NetClientClock` and `NtpClock` is typically set on a `gst::Pipeline` with
`gst::Pipeline::use_clock`.
If you set a `gst::Bus` on the clock via the "bus" object property, it will
send `gst::MessageType::Element` messages with an attached `gst::Structure` containing
statistics about clock accuracy and network traffic.
# Implements
[`gst::ClockExt`](../gst/trait.ClockExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl NetClientClock::fn new -->
Create a new `GstNetClientInternalClock` that will report the time
provided by the `NetTimeProvider` on `remote_address` and
`remote_port`.
## `name`
a name for the clock
## `remote_address`
the address or hostname of the remote clock provider
## `remote_port`
the port of the remote clock provider
## `base_time`
initial time of the clock
# Returns
a new `gst::Clock` that receives a time from the remote
clock.
<!-- struct NetTimeProvider -->
This object exposes the time of a `gst::Clock` on the network.
A `NetTimeProvider` is created with `NetTimeProvider::new` which
takes a `gst::Clock`, an address and a port number as arguments.
After creating the object, a client clock such as `NetClientClock` can
query the exposed clock over the network for its values.
The `NetTimeProvider` typically wraps the clock used by a `gst::Pipeline`.
# Implements
[`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl NetTimeProvider::fn new -->
Allows network clients to get the current time of `clock`.
## `clock`
a `gst::Clock` to export over the network
## `address`
an address to bind on as a dotted quad
(xxx.xxx.xxx.xxx), IPv6 address, or NULL to bind to all addresses
## `port`
a port to bind on, or 0 to let the kernel choose
# Returns
the new `NetTimeProvider`, or NULL on error
<!-- struct NtpClock -->
# Implements
[`NetClientClockExt`](trait.NetClientClockExt.html), [`gst::ClockExt`](../gst/trait.ClockExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl NtpClock::fn new -->
Create a new `NtpClock` that will report the time provided by
the NTPv4 server on `remote_address` and `remote_port`.
## `name`
a name for the clock
## `remote_address`
the address or hostname of the remote clock provider
## `remote_port`
the port of the remote clock provider
## `base_time`
initial time of the clock
# Returns
a new `gst::Clock` that receives a time from the remote
clock.
<!-- struct PtpClock -->
GstPtpClock implements a PTP (IEEE1588:2008) ordinary clock in slave-only
mode, that allows a GStreamer pipeline to synchronize to a PTP network
clock in some specific domain.
The PTP subsystem can be initialized with `gst_ptp_init`, which then starts
a helper process to do the actual communication via the PTP ports. This is
required as PTP listens on ports < 1024 and thus requires special
privileges. Once this helper process is started, the main process will
synchronize to all PTP domains that are detected on the selected
interfaces.
`PtpClock::new` then allows to create a GstClock that provides the PTP
time from a master clock inside a specific PTP domain. This clock will only
return valid timestamps once the timestamps in the PTP domain are known. To
check this, you can use `gst::ClockExt::wait_for_sync`, the GstClock::synced
signal and `gst::ClockExt::is_synced`.
To gather statistics about the PTP clock synchronization,
`gst_ptp_statistics_callback_add` can be used. This gives the application
the possibility to collect all kinds of statistics from the clock
synchronization.
# Implements
[`gst::ClockExt`](../gst/trait.ClockExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl PtpClock::fn new -->
Creates a new PTP clock instance that exports the PTP time of the master
clock in `domain`. This clock can be slaved to other clocks as needed.
If `gst_ptp_init` was not called before, this will call `gst_ptp_init` with
default parameters.
This clock only returns valid timestamps after it received the first
times from the PTP master clock on the network. Once this happens the
GstPtpClock::internal-clock property will become non-NULL. You can
check this with `gst::ClockExt::wait_for_sync`, the GstClock::synced signal and
`gst::ClockExt::is_synced`.
## `name`
Name of the clock
## `domain`
PTP domain
......@@ -4,7 +4,7 @@
# Implements
[`ObjectExt`](trait.ObjectExt.html)
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl Player::fn new -->
Creates a new `Player` instance that uses `signal_dispatcher` to dispatch
signals to some event loop system, or emits signals directly if NULL is
......@@ -394,7 +394,7 @@ in the stream.
# Implements
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl PlayerAudioInfo::fn get_bitrate -->
# Returns
......@@ -438,7 +438,7 @@ generic error.
# Implements
[`ObjectExt`](trait.ObjectExt.html), [`PlayerSignalDispatcherExt`](trait.PlayerSignalDispatcherExt.html)
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`PlayerSignalDispatcherExt`](trait.PlayerSignalDispatcherExt.html)
<!-- impl PlayerGMainContextSignalDispatcher::fn new -->
Creates a new GstPlayerSignalDispatcher that uses `application_context`,
or the thread default one if `None` is used. See `gst_player_new_full`.
......@@ -453,7 +453,7 @@ Structure containing the media information of a URI.
# Implements
[`ObjectExt`](trait.ObjectExt.html)
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl PlayerMediaInfo::fn get_audio_streams -->
# Returns
......@@ -570,7 +570,7 @@ the stream type, one can find more media-specific information in
# Implements
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- trait PlayerStreamInfoExt -->
Trait containing all `PlayerStreamInfo` methods.
......@@ -611,7 +611,7 @@ the tags contained in this stream.
# Implements
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl PlayerSubtitleInfo::fn get_language -->
# Returns
......@@ -622,7 +622,7 @@ the language of the stream, or NULL if unknown.
# Implements
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`ObjectExt`](trait.ObjectExt.html)
[`PlayerStreamInfoExt`](trait.PlayerStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl PlayerVideoInfo::fn get_bitrate -->
# Returns
......@@ -659,7 +659,7 @@ the width of video in `PlayerVideoInfo`.
# Implements
[`ObjectExt`](trait.ObjectExt.html), [`PlayerVideoRendererExt`](trait.PlayerVideoRendererExt.html)
[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`PlayerVideoRendererExt`](trait.PlayerVideoRendererExt.html)
<!-- impl PlayerVideoOverlayVideoRenderer::fn new -->
## `window_handle`
Window handle to use or `None`
......
......@@ -471,6 +471,46 @@ frames contains both interlaced and
Each field has only half the amount of lines as noted in the
height property. This mode requires multiple GstVideoMeta metadata
to describe the fields.
<!-- enum VideoMultiviewFramePacking -->
`VideoMultiviewFramePacking` represents the subset of `VideoMultiviewMode`
values that can be applied to any video frame without needing extra metadata.
It can be used by elements that provide a property to override the
multiview interpretation of a video stream when the video doesn't contain
any markers.
This enum is used (for example) on playbin, to re-interpret a played
video stream as a stereoscopic video. The individual enum values are
equivalent to and have the same value as the matching `VideoMultiviewMode`.
<!-- enum VideoMultiviewFramePacking::variant None -->
A special value indicating
no frame packing info.
<!-- enum VideoMultiviewFramePacking::variant Mono -->
All frames are monoscopic.
<!-- enum VideoMultiviewFramePacking::variant Left -->
All frames represent a left-eye view.
<!-- enum VideoMultiviewFramePacking::variant Right -->
All frames represent a right-eye view.
<!-- enum VideoMultiviewFramePacking::variant SideBySide -->
Left and right eye views are
provided in the left and right half of the frame respectively.
<!-- enum VideoMultiviewFramePacking::variant SideBySideQuincunx -->
Left and right eye
views are provided in the left and right half of the frame, but
have been sampled using quincunx method, with half-pixel offset
between the 2 views.
<!-- enum VideoMultiviewFramePacking::variant ColumnInterleaved -->
Alternating vertical
columns of pixels represent the left and right eye view respectively.
<!-- enum VideoMultiviewFramePacking::variant RowInterleaved -->
Alternating horizontal
rows of pixels represent the left and right eye view respectively.
<!-- enum VideoMultiviewFramePacking::variant TopBottom -->
The top half of the frame
contains the left eye, and the bottom half the right eye.
<!-- enum VideoMultiviewFramePacking::variant Checkerboard -->
Pixels are arranged with
alternating pixels representing left and right eye views in a
checkerboard fashion.
<!-- enum VideoMultiviewMode -->
All possible stereoscopic 3D and multiview representations.
In conjunction with `VideoMultiviewFlags`, describes how
......
This diff is collapsed.
[package]
name = "examples"
version = "0.9.0"
version = "0.10.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies]
glib = { version = "0.3", git = "https://github.com/gtk-rs/glib" }
gstreamer = { path = "../gstreamer" }
gstreamer-app = { path = "../gstreamer-app" }
gstreamer-audio = { path = "../gstreamer-audio" }
gstreamer-video = { path = "../gstreamer-video" }
gstreamer-player = { path = "../gstreamer-player", optional = true }
gtk = { version = "0.2", git = "https://github.com/gtk-rs/gtk", features = ["v3_6"], optional = true }
gdk = { version = "0.6", git = "https://github.com/gtk-rs/gdk", optional = true }
gio = { version = "0.2", git = "https://github.com/gtk-rs/gio", optional = true }
glib = "0.4"
gstreamer = { version = "0.10", path = "../gstreamer" }
gstreamer-app = { version = "0.10", path = "../gstreamer-app" }
gstreamer-audio = { version = "0.10", path = "../gstreamer-audio" }
gstreamer-video = { version = "0.10", path = "../gstreamer-video" }
gstreamer-player = { version = "0.10", path = "../gstreamer-player", optional = true }
gtk = { version = "0.3", features = ["v3_6"], optional = true }
gdk = { version = "0.7", optional = true }
gio = { version = "0.3", optional = true }
futures = { version = "0.1", optional = true }
tokio-core = { version = "0.1", optional = true }
send-cell = "0.1"
......
......@@ -60,67 +60,64 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
],
));
appsink.set_callbacks(gst_app::AppSinkCallbacks::new(
/* eos */
|_| {},
/* new_preroll */
|_| gst::FlowReturn::Ok,
/* new_samples */
|appsink| {
let sample = match appsink.pull_sample() {
None => return gst::FlowReturn::Eos,
Some(sample) => sample,
};
let buffer = if let Some(buffer) = sample.get_buffer() {
buffer
} else {
gst_element_error!(
appsink,
gst::ResourceError::Failed,
("Failed to get buffer from appsink")
);
return gst::FlowReturn::Error;
};
let map = if let Some(map) = buffer.map_readable() {
map
} else {
gst_element_error!(
appsink,
gst::ResourceError::Failed,
("Failed to map buffer readable")
);
return gst::FlowReturn::Error;
};
let samples = if let Ok(samples) = map.as_slice().as_slice_of::<i16>() {
samples
} else {
gst_element_error!(
appsink,
gst::ResourceError::Failed,
("Failed to interprete buffer as S16 PCM")
);
return gst::FlowReturn::Error;
};
let sum: f64 = samples
.iter()
.map(|sample| {
let f = f64::from(*sample) / f64::from(i16::MAX);
f * f
})
.sum();
let rms = (sum / (samples.len() as f64)).sqrt();
println!("rms: {}", rms);
gst::FlowReturn::Ok
},
));
appsink.set_callbacks(
gst_app::AppSinkCallbacks::new()
.new_sample(|appsink| {
let sample = match appsink.pull_sample() {
None => return gst::FlowReturn::Eos,
Some(sample) => sample,
};
let buffer = if let Some(buffer) = sample.get_buffer() {
buffer
} else {
gst_element_error!(
appsink,
gst::ResourceError::Failed,
("Failed to get buffer from appsink")
);
return gst::FlowReturn::Error;
};
let map = if let Some(map) = buffer.map_readable() {
map
} else {
gst_element_error!(
appsink,
gst::ResourceError::Failed,
("Failed to map buffer readable")
);
return gst::FlowReturn::Error;
};
let samples = if let Ok(samples) = map.as_slice().as_slice_of::<i16>() {
samples
} else {
gst_element_error!(
appsink,
gst::ResourceError::Failed,
("Failed to interprete buffer as S16 PCM")
);
return gst::FlowReturn::Error;
};
let sum: f64 = samples
.iter()
.map(|sample| {
let f = f64::from(*sample) / f64::from(i16::MAX);
f * f
})
.sum();
let rms = (sum / (samples.len() as f64)).sqrt();
println!("rms: {}", rms);
gst::FlowReturn::Ok
})
.build(),
);
Ok(pipeline)
}
......@@ -142,7 +139,7 @@ fn main_loop(pipeline: gst::Pipeline) -> Result<(), Error> {
Err(ErrorMessage {
src: msg.get_src()
.map(|s| s.get_path_string())
.unwrap_or(String::from("None")),
.unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
......
......@@ -113,7 +113,7 @@ fn main_loop(pipeline: gst::Pipeline, appsrc: gst_app::AppSrc) -> Result<(), Err
Err(ErrorMessage {
src: msg.get_src()
.map(|s| s.get_path_string())
.unwrap_or(String::from("None")),
.unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
......
......@@ -39,7 +39,7 @@ fn example_main() -> Result<(), Error> {
args[1].as_ref()
} else {
println!("Usage: decodebin file_path");
std::process::exit(-1);
std::process::exit(-1)
};
let pipeline = gst::Pipeline::new(None);
......@@ -133,7 +133,7 @@ fn example_main() -> Result<(), Error> {
("Failed to insert sink"),
details: gst::Structure::builder("error-details")
.field("error",
glib::AnySendValue::new(Arc::new(Mutex::new(Some(err)))))
&glib::AnySendValue::new(Arc::new(Mutex::new(Some(err)))))
.build()
);
......@@ -173,16 +173,14 @@ fn example_main() -> Result<(), Error> {
})
.map(Result::Err)
.expect("error-details message without actual error"),
_ => Err(
ErrorMessage {
src: msg.get_src()
.map(|s| s.get_path_string())
.unwrap_or(String::from("None")),
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
}.into(),
),
_ => Err(ErrorMessage {
src: msg.get_src()
.map(|s| s.get_path_string())
.unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
}.into()),
}?;
}
#[cfg(not(feature = "v1_10"))]
......@@ -190,7 +188,7 @@ fn example_main() -> Result<(), Error> {
Err(ErrorMessage {
src: msg.get_src()
.map(|s| s.get_path_string())
.unwrap_or(String::from("None")),
.unwrap_or_else(|| String::from("None")),
error: err.get_error().description().into(),
debug: err.get_debug(),
cause: err.get_error(),
......
......@@ -59,13 +59,9 @@ fn create_ui(app: &gtk::Application) {
let pipeline_clone = pipeline.clone();
gtk::timeout_add(500, move || {
let pipeline = &pipeline_clone;
let position = if let Some(gst::FormatValue::Time(position)) =
pipeline.query_position(gst::Format::Time)
{
position
} else {
0.into()
};
let position = pipeline
.query_position::<gst::ClockTime>()
.unwrap_or_else(|| 0.into());
label.set_text(&format!("Position: {:.0}", position));
glib::Continue(true)
......
......@@ -129,13 +129,9 @@ fn create_ui(app: &gtk::Application) {
let pipeline_clone = pipeline.clone();
gtk::timeout_add(500, move || {
let pipeline = &pipeline_clone;
let position = if let Some(gst::FormatValue::Time(position)) =
pipeline.query_position(gst::Format::Time)
{
position
} else {
0.into()
};
let position = pipeline
.query_position::<gst::ClockTime>()
.unwrap_or_else(|| 0.into());
label.set_text(&format!("Position: {:.0}", position));
glib::Continue(true)
......
......@@ -16,7 +16,7 @@ fn example_main() {
args[1].as_ref()
} else {
println!("Usage: playbin uri");
std::process::exit(-1);
std::process::exit(-1)
};
let playbin = gst::ElementFactory::make("playbin", None).unwrap();
......