Class: Gtk::MediaStream
- Inherits:
-
Object
- Object
- Gtk::MediaStream
- Defined in:
- (unknown)
Direct Known Subclasses
Instance Method Summary collapse
-
#duration ⇒ Integer
The stream's duration in microseconds or 0 if unknown.
-
#duration=(duration) ⇒ Integer
The stream's duration in microseconds or 0 if unknown.
-
#ended ⇒ Boolean
Returns whether the streams playback is finished.
-
#ended=(ended) ⇒ Boolean
Set when playback has finished.
-
#ended? ⇒ Boolean
Set when playback has finished.
-
#error ⇒ GLib::Error
nil for a properly working stream or the
GErrorthat the stream is in. -
#error=(error) ⇒ GLib::Error
nil for a properly working stream or the
GErrorthat the stream is in. -
#error_valist(domain, code, format, args) ⇒ nil
Sets self into an error state using a printf()-style format string.
-
#gerror(error) ⇒ nil
Sets self into an error state.
-
#has_audio ⇒ Boolean
Returns whether the stream has audio.
-
#has_audio=(has_audio) ⇒ Boolean
Whether the stream contains audio.
-
#has_audio? ⇒ Boolean
Whether the stream contains audio.
-
#has_video ⇒ Boolean
Returns whether the stream has video.
-
#has_video=(has_video) ⇒ Boolean
Whether the stream contains video.
-
#has_video? ⇒ Boolean
Whether the stream contains video.
-
#is_prepared ⇒ Boolean
Returns whether the stream has finished initializing.
-
#is_seekable ⇒ Boolean
Checks if a stream may be seekable.
-
#is_seeking ⇒ Boolean
Checks if there is currently a seek operation going on.
-
#loop ⇒ Boolean
Returns whether the stream is set to loop.
-
#loop=(loop) ⇒ Boolean
Try to restart the media from the beginning once it ended.
-
#loop? ⇒ Boolean
Try to restart the media from the beginning once it ended.
-
#muted ⇒ Boolean
Returns whether the audio for the stream is muted.
-
#muted=(muted) ⇒ Boolean
Whether the audio stream should be muted.
-
#muted? ⇒ Boolean
Whether the audio stream should be muted.
-
#pause ⇒ nil
Pauses playback of the stream.
-
#play ⇒ nil
Starts playing the stream.
-
#playing ⇒ Boolean
Return whether the stream is currently playing.
-
#playing=(playing) ⇒ Boolean
Whether the stream is currently playing.
-
#playing? ⇒ Boolean
Whether the stream is currently playing.
-
#prepared(has_audio, has_video, seekable, duration) ⇒ nil
Same as gtk_media_stream_stream_prepared().
-
#prepared=(prepared) ⇒ Boolean
Whether the stream has finished initializing and existence of audio and video is known.
-
#prepared? ⇒ Boolean
Whether the stream has finished initializing and existence of audio and video is known.
-
#realize(surface) ⇒ nil
Called by users to attach the media stream to a
GdkSurfacethey manage. -
#seek(timestamp) ⇒ nil
Start a seek operation on self to timestamp.
-
#seek_failed ⇒ nil
Ends a seek operation started via GtkMediaStream.seek() as a failure.
-
#seek_success ⇒ nil
Ends a seek operation started via GtkMediaStream.seek() successfully.
-
#seekable=(seekable) ⇒ Boolean
Set unless the stream is known to not support seeking.
-
#seekable? ⇒ Boolean
Set unless the stream is known to not support seeking.
-
#seeking=(seeking) ⇒ Boolean
Set while a seek is in progress.
-
#seeking? ⇒ Boolean
Set while a seek is in progress.
-
#stream_ended ⇒ nil
Pauses the media stream and marks it as ended.
-
#stream_prepared(has_audio, has_video, seekable, duration) ⇒ nil
Called by
GtkMediaStreamimplementations to advertise the stream being ready to play and providing details about the stream. -
#stream_unprepared ⇒ nil
Resets a given media stream implementation.
-
#timestamp ⇒ Integer
The current presentation timestamp in microseconds.
-
#timestamp=(timestamp) ⇒ Integer
The current presentation timestamp in microseconds.
-
#unprepared ⇒ nil
Same as gtk_media_stream_stream_unprepared().
-
#unrealize(surface) ⇒ nil
Undoes a previous call to gtk_media_stream_realize().
-
#update(timestamp) ⇒ nil
Media stream implementations should regularly call this function to update the timestamp reported by the stream.
-
#volume ⇒ Float
Volume of the audio stream.
-
#volume=(volume) ⇒ Float
Volume of the audio stream.
Instance Method Details
#duration ⇒ Integer
The stream's duration in microseconds or 0 if unknown.
#duration=(duration) ⇒ Integer
The stream's duration in microseconds or 0 if unknown.
#ended ⇒ Boolean
Returns whether the streams playback is finished.
#ended=(ended) ⇒ Boolean
Set when playback has finished.
#ended? ⇒ Boolean
Set when playback has finished.
#error ⇒ GLib::Error
nil for a properly working stream or the GError
that the stream is in.
#error=(error) ⇒ GLib::Error
nil for a properly working stream or the GError
that the stream is in.
#error_valist(domain, code, format, args) ⇒ nil
Sets self into an error state using a printf()-style format string.
This is a utility function that calls [methodGtk.MediaStream.gerror]. See that function for details.
#gerror(error) ⇒ nil
Sets self into an error state.
This will pause the stream (you can check for an error via [methodGtk.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 [methodGtk.MediaStream.unprepared].
#has_audio ⇒ Boolean
Returns whether the stream has audio.
#has_audio=(has_audio) ⇒ Boolean
Whether the stream contains audio.
#has_audio? ⇒ Boolean
Whether the stream contains audio.
#has_video ⇒ Boolean
Returns whether the stream has video.
#has_video=(has_video) ⇒ Boolean
Whether the stream contains video.
#has_video? ⇒ Boolean
Whether the stream contains video.
#is_prepared ⇒ Boolean
Returns whether the stream has finished initializing.
At this point the existence of audio and video is known.
#is_seekable ⇒ Boolean
Checks 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 [methodGtk.MediaStream.seek] on a non-seekable stream, though it will not do anything.
#is_seeking ⇒ Boolean
Checks if there is currently a seek operation going on.
#loop ⇒ Boolean
Returns whether the stream is set to loop.
See [methodGtk.MediaStream.set_loop] for details.
#loop=(loop) ⇒ Boolean
Try to restart the media from the beginning once it ended.
#loop? ⇒ Boolean
Try to restart the media from the beginning once it ended.
#muted ⇒ Boolean
Returns whether the audio for the stream is muted.
See [methodGtk.MediaStream.set_muted] for details.
#muted=(muted) ⇒ Boolean
Whether the audio stream should be muted.
#muted? ⇒ Boolean
Whether the audio stream should be muted.
#pause ⇒ nil
Pauses playback of the stream.
If the stream is not playing, do nothing.
#play ⇒ nil
Starts playing the stream.
If the stream is in error or already playing, do nothing.
#playing ⇒ Boolean
Return whether the stream is currently playing.
#playing=(playing) ⇒ Boolean
Whether the stream is currently playing.
#playing? ⇒ Boolean
Whether the stream is currently playing.
#prepared(has_audio, has_video, seekable, duration) ⇒ nil
Same as gtk_media_stream_stream_prepared().
#prepared=(prepared) ⇒ Boolean
Whether the stream has finished initializing and existence of audio and video is known.
#prepared? ⇒ Boolean
Whether the stream has finished initializing and existence of audio and video is known.
#realize(surface) ⇒ nil
Called 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 [methodGtk.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 [methodGtk.MediaStream.unrealize].
It is not required to call this function to make a media stream work.
#seek(timestamp) ⇒ nil
Start 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 [propertyGtk.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.
#seek_failed ⇒ nil
Ends 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 [methodGtk.MediaStream.seek_success] for the other way of ending a seek.
#seek_success ⇒ nil
Ends a seek operation started via GtkMediaStream.seek() successfully.
This function will unset the GtkMediaStream:ended property if it was set.
See [methodGtk.MediaStream.seek_failed] for the other way of ending a seek.
#seekable=(seekable) ⇒ Boolean
Set unless the stream is known to not support seeking.
#seekable? ⇒ Boolean
Set unless the stream is known to not support seeking.
#seeking=(seeking) ⇒ Boolean
Set while a seek is in progress.
#seeking? ⇒ Boolean
Set while a seek is in progress.
#stream_ended ⇒ nil
Pauses the media stream and marks it as ended.
This is a hint only, calls to [methodGtk.MediaStream.play] may still happen.
The media stream must be prepared when this function is called.
#stream_prepared(has_audio, has_video, seekable, duration) ⇒ nil
Called 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 [methodGtk.MediaStream.stream_unprepared].
#stream_unprepared ⇒ nil
Resets a given media stream implementation.
[methodGtk.MediaStream.stream_prepared] can then be called again.
This function will also reset any error state the stream was in.
#timestamp ⇒ Integer
The current presentation timestamp in microseconds.
#timestamp=(timestamp) ⇒ Integer
The current presentation timestamp in microseconds.
#unprepared ⇒ nil
Same as gtk_media_stream_stream_unprepared().
#unrealize(surface) ⇒ nil
Undoes a previous call to gtk_media_stream_realize().
This causes the stream to release all resources it had allocated from surface.
#update(timestamp) ⇒ nil
Media 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.
#volume ⇒ Float
Volume of the audio stream.
#volume=(volume) ⇒ Float
Volume of the audio stream.