package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Media_stream/index.html
Module Wrappers.Media_stream
type t = [ `media_stream | `object_ ] Gobject.objval update : t -> int64 -> unitMedia stream implementations should regularly call this function to update the timestamp reported by the stream.
It is up to implementations to call this at the frequency they deem appropriate.
The media stream must be prepared when this function is called.
val unrealize : t -> Ocgtk_gdk.Gdk.Wrappers.Surface.t -> unitUndoes a previous call to gtk_media_stream_realize().
This causes the stream to release all resources it had allocated from @surface.
val stream_unprepared : t -> unitResets a given media stream implementation.
method@Gtk.MediaStream.stream_prepared can then be called again.
This function will also reset any error state the stream was in.
val stream_prepared : t -> bool -> bool -> bool -> int64 -> unitCalled by `GtkMediaStream` implementations to advertise the stream being ready to play and providing details about the stream.
Note that the arguments are hints. If the stream implementation cannot determine the correct values, it is better to err on the side of caution and return %TRUE. User interfaces will use those values to determine what controls to show.
This function may not be called again until the stream has been reset via method@Gtk.MediaStream.stream_unprepared.
val stream_ended : t -> unitPauses the media stream and marks it as ended.
This is a hint only, calls to method@Gtk.MediaStream.play may still happen.
The media stream must be prepared when this function is called.
val set_volume : t -> float -> unitSets the volume of the audio stream.
This function call will work even if the stream is muted.
The given @volume should range from 0.0 for silence to 1.0 for as loud as possible. Values outside of this range will be clamped to the nearest value.
If the stream has no audio or is muted, calling this function will still work but it will not have an immediate audible effect. When the stream is unmuted, the new volume setting will take effect.
val set_playing : t -> bool -> unitStarts or pauses playback of the stream.
val set_muted : t -> bool -> unitSets whether the audio stream should be muted.
Muting a stream will cause no audio to be played, but it does not modify the volume. This means that muting and then unmuting the stream will restore the volume settings.
If the stream has no audio, calling this function will still work but it will not have an audible effect.
val set_loop : t -> bool -> unitSets whether the stream should loop.
In this case, it will attempt to restart playback from the beginning instead of stopping at the end.
Not all streams may support looping, in particular non-seekable streams. Those streams will ignore the loop setting and just end.
val seek_success : t -> unitEnds a seek operation started via GtkMediaStream.seek() successfully.
This function will unset the GtkMediaStream:ended property if it was set.
See method@Gtk.MediaStream.seek_failed for the other way of ending a seek.
val seek_failed : t -> unitEnds a seek operation started via GtkMediaStream.seek() as a failure.
This will not cause an error on the stream and will assume that playback continues as if no seek had happened.
See method@Gtk.MediaStream.seek_success for the other way of ending a seek.
val seek : t -> int64 -> unitStart a seek operation on @self to @timestamp.
If @timestamp is out of range, it will be clamped.
Seek operations may not finish instantly. While a seek operation is in process, the property@Gtk.MediaStream:seeking property will be set.
When calling gtk_media_stream_seek() during an ongoing seek operation, the new seek will override any pending seek.
val realize : t -> Ocgtk_gdk.Gdk.Wrappers.Surface.t -> unitCalled by users to attach the media stream to a `GdkSurface` they manage.
The stream can then access the resources of @surface for its rendering purposes. In particular, media streams might want to create a `GdkGLContext` or sync to the `GdkFrameClock`.
Whoever calls this function is responsible for calling method@Gtk.MediaStream.unrealize before either the stream or @surface get destroyed.
Multiple calls to this function may happen from different users of the video, even with the same @surface. Each of these calls must be followed by its own call to method@Gtk.MediaStream.unrealize.
It is not required to call this function to make a media stream work.
val play : t -> unitStarts playing the stream.
If the stream is in error or already playing, do nothing.
val pause : t -> unitPauses playback of the stream.
If the stream is not playing, do nothing.
val is_seeking : t -> boolChecks if there is currently a seek operation going on.
val is_seekable : t -> boolChecks if a stream may be seekable.
This is meant to be a hint. Streams may not allow seeking even if this function returns %TRUE. However, if this function returns %FALSE, streams are guaranteed to not be seekable and user interfaces may hide controls that allow seeking.
It is allowed to call method@Gtk.MediaStream.seek on a non-seekable stream, though it will not do anything.
val is_prepared : t -> boolReturns whether the stream has finished initializing.
At this point the existence of audio and video is known.
val has_video : t -> boolReturns whether the stream has video.
val has_audio : t -> boolReturns whether the stream has audio.
val get_volume : t -> floatReturns the volume of the audio for the stream.
See method@Gtk.MediaStream.set_volume for details.
val get_timestamp : t -> int64Returns the current presentation timestamp in microseconds.
val get_playing : t -> boolReturn whether the stream is currently playing.
val get_muted : t -> boolReturns whether the audio for the stream is muted.
See method@Gtk.MediaStream.set_muted for details.
val get_loop : t -> boolReturns whether the stream is set to loop.
See method@Gtk.MediaStream.set_loop for details.
If the stream is in an error state, returns the `GError` explaining that state.
Any type of error can be reported here depending on the implementation of the media stream.
A media stream in an error cannot be operated on, calls like method@Gtk.MediaStream.play or method@Gtk.MediaStream.seek will not have any effect.
`GtkMediaStream` itself does not provide a way to unset an error, but implementations may provide options. For example, a class@Gtk.MediaFile will unset errors when a new source is set, e.g. with method@Gtk.MediaFile.set_file.
val get_ended : t -> boolReturns whether the streams playback is finished.
val get_duration : t -> int64Gets the duration of the stream.
If the duration is not known, 0 will be returned.
Sets @self into an error state.
This will pause the stream (you can check for an error via method@Gtk.MediaStream.get_error in your GtkMediaStream.pause() implementation), abort pending seeks and mark the stream as prepared.
if the stream is already in an error state, this call will be ignored and the existing error will be retained.
To unset an error, the stream must be reset via a call to method@Gtk.MediaStream.unprepared.
val get_prepared : t -> boolGet property: prepared
val set_prepared : t -> bool -> unitSet property: prepared
val get_seekable : t -> boolGet property: seekable
val get_seeking : t -> boolGet property: seeking