### Class

# Gtk MediaStream

since: 4.0

#### Description [src]

    abstract class Gtk.MediaStream : GObject.Object
      implements Gdk.Paintable {
      /* No available fields */
    }

`GtkMediaStream` is the integration point for media playback inside GTK.

GTK provides an implementation of the `GtkMediaStream` interface that is called `GtkMediaFile`.

Apart from application-facing API for stream playback, `GtkMediaStream` has a number of APIs that are only useful for implementations and should not be used in applications: `gtk_media_stream_prepared()`, `gtk_media_stream_unprepared()`, `gtk_media_stream_update()`, `gtk_media_stream_ended()`, `gtk_media_stream_seek_success()`, `gtk_media_stream_seek_failed()`, `gtk_media_stream_gerror()`, `gtk_media_stream_error()`, `gtk_media_stream_error_valist()`.

Available since: 4.0

#### Ancestors

- GObject

#### Descendants

- GtkMediaFile

#### Implements

- GdkPaintable

#### Instance methods

###### gtk_media_stream_ended

Pauses the media stream and marks it as ended.

deprecated: 4.4 since: 4.0

###### gtk_media_stream_error

Sets `self` into an error state using a printf()-style format string.

since: 4.0

###### gtk_media_stream_error_valist

Sets `self` into an error state using a printf()-style format string.

since: 4.0

###### gtk_media_stream_gerror

Sets `self` into an error state.

since: 4.0

###### gtk_media_stream_get_duration

Gets the duration of the stream.

since: 4.0

###### gtk_media_stream_get_ended

Returns whether the streams playback is finished.

since: 4.0

###### gtk_media_stream_get_error

If the stream is in an error state, returns the `GError` explaining that state.

since: 4.0

###### gtk_media_stream_get_loop

Returns whether the stream is set to loop.

since: 4.0

###### gtk_media_stream_get_muted

Returns whether the audio for the stream is muted.

since: 4.0

###### gtk_media_stream_get_playing

Return whether the stream is currently playing.

since: 4.0

###### gtk_media_stream_get_timestamp

Returns the current presentation timestamp in microseconds.

since: 4.0

###### gtk_media_stream_get_volume

Returns the volume of the audio for the stream.

since: 4.0

###### gtk_media_stream_has_audio

Returns whether the stream has audio.

since: 4.0

###### gtk_media_stream_has_video

Returns whether the stream has video.

since: 4.0

###### gtk_media_stream_is_prepared

Returns whether the stream has finished initializing.

since: 4.0

###### gtk_media_stream_is_seekable

Checks if a stream may be seekable.

since: 4.0

###### gtk_media_stream_is_seeking

Checks if there is currently a seek operation going on.

since: 4.0

###### gtk_media_stream_pause

Pauses playback of the stream.

since: 4.0

###### gtk_media_stream_play

Starts playing the stream.

since: 4.0

###### gtk_media_stream_prepared

Same as gtk_media_stream_stream_prepared().

deprecated: 4.4 since: 4.0

###### gtk_media_stream_realize

Called by users to attach the media stream to a `GdkSurface` they manage.

since: 4.0

###### gtk_media_stream_seek

Start a seek operation on `self` to `timestamp`.

since: 4.0

###### gtk_media_stream_seek_failed

Ends a seek operation started via GtkMediaStream.seek() as a failure.

since: 4.0

###### gtk_media_stream_seek_success

Ends a seek operation started via GtkMediaStream.seek() successfully.

since: 4.0

###### gtk_media_stream_set_loop

Sets whether the stream should loop.

since: 4.0

###### gtk_media_stream_set_muted

Sets whether the audio stream should be muted.

since: 4.0

###### gtk_media_stream_set_playing

Starts or pauses playback of the stream.

since: 4.0

###### gtk_media_stream_set_volume

Sets the volume of the audio stream.

since: 4.0

###### gtk_media_stream_stream_ended

Pauses the media stream and marks it as ended.

since: 4.4

###### gtk_media_stream_stream_prepared

Called by `GtkMediaStream` implementations to advertise the stream being ready to play and providing details about the stream.

since: 4.4

###### gtk_media_stream_stream_unprepared

Resets a given media stream implementation.

since: 4.4

###### gtk_media_stream_unprepared

Same as gtk_media_stream_stream_unprepared().

deprecated: 4.4 since: 4.0

###### gtk_media_stream_unrealize

Undoes a previous call to gtk_media_stream_realize().

since: 4.0

###### gtk_media_stream_update

Media stream implementations should regularly call this function to update the timestamp reported by the stream.

since: 4.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from GdkPaintable (9)

###### gdk_paintable_compute_concrete_size

Compute a concrete size for the `GdkPaintable`.

since: 4.0

###### gdk_paintable_get_current_image

Gets an immutable paintable for the current contents displayed by `paintable`.

since: 4.0

###### gdk_paintable_get_flags

Get flags for the paintable.

since: 4.0

###### gdk_paintable_get_intrinsic_aspect_ratio

Gets the preferred aspect ratio the `paintable` would like to be displayed at.

since: 4.0

###### gdk_paintable_get_intrinsic_height

Gets the preferred height the `paintable` would like to be displayed at.

since: 4.0

###### gdk_paintable_get_intrinsic_width

Gets the preferred width the `paintable` would like to be displayed at.

since: 4.0

###### gdk_paintable_invalidate_contents

Called by implementations of `GdkPaintable` to invalidate their contents.

since: 4.0

###### gdk_paintable_invalidate_size

Called by implementations of `GdkPaintable` to invalidate their size.

since: 4.0

###### gdk_paintable_snapshot

Snapshots the given paintable with the given `width` and `height`.

since: 4.0

#### Properties

###### Gtk.MediaStream:duration

The stream’s duration in microseconds or 0 if unknown.

since: 4.0

###### Gtk.MediaStream:ended

Set when playback has finished.

since: 4.0

###### Gtk.MediaStream:error

`NULL` for a properly working stream or the `GError` that the stream is in.

since: 4.0

###### Gtk.MediaStream:has-audio

Whether the stream contains audio.

since: 4.0

###### Gtk.MediaStream:has-video

Whether the stream contains video.

since: 4.0

###### Gtk.MediaStream:loop

Try to restart the media from the beginning once it ended.

since: 4.0

###### Gtk.MediaStream:muted

Whether the audio stream should be muted.

since: 4.0

###### Gtk.MediaStream:playing

Whether the stream is currently playing.

since: 4.0

###### Gtk.MediaStream:prepared

Whether the stream has finished initializing and existence of audio and video is known.

since: 4.0

###### Gtk.MediaStream:seekable

Set unless the stream is known to not support seeking.

since: 4.0

###### Gtk.MediaStream:seeking

Set while a seek is in progress.

since: 4.0

###### Gtk.MediaStream:timestamp

The current presentation timestamp in microseconds.

since: 4.0

###### Gtk.MediaStream:volume

Volume of the audio stream.

since: 4.0

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

##### Signals inherited from GdkPaintable (2)

###### GdkPaintable::invalidate-contents

Emitted when the contents of the `paintable` change.

since: 4.0

###### GdkPaintable::invalidate-size

Emitted when the intrinsic size of the `paintable` changes.

since: 4.0

#### Class structure

    struct GtkMediaStreamClass {
      GObjectClass parent_class;
      gboolean (* play) (
        GtkMediaStream* self
      );
      void (* pause) (
        GtkMediaStream* self
      );
      void (* seek) (
        GtkMediaStream* self,
        gint64 timestamp
      );
      void (* update_audio) (
        GtkMediaStream* self,
        gboolean muted,
        double volume
      );
      void (* realize) (
        GtkMediaStream* self,
        GdkSurface* surface
      );
      void (* unrealize) (
        GtkMediaStream* self,
        GdkSurface* surface
      );
      void (* _gtk_reserved1) (
    void
      );
      void (* _gtk_reserved2) (
    void
      );
      void (* _gtk_reserved3) (
    void
      );
      void (* _gtk_reserved4) (
    void
      );
      void (* _gtk_reserved5) (
    void
      );
      void (* _gtk_reserved6) (
    void
      );
      void (* _gtk_reserved7) (
    void
      );
      void (* _gtk_reserved8) (
    void
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.
`play: gboolean (* play) ( GtkMediaStream* self )`
  No description available.
`pause: void (* pause) ( GtkMediaStream* self )`
  No description available.
`seek: void (* seek) ( GtkMediaStream* self, gint64 timestamp )`
  No description available.
`update_audio: void (* update_audio) ( GtkMediaStream* self, gboolean muted, double volume )`
  No description available.
`realize: void (* realize) ( GtkMediaStream* self, GdkSurface* surface )`
  No description available.
`unrealize: void (* unrealize) ( GtkMediaStream* self, GdkSurface* surface )`
  No description available.
`_gtk_reserved1: void (* _gtk_reserved1) ( void )`
  No description available.
`_gtk_reserved2: void (* _gtk_reserved2) ( void )`
  No description available.
`_gtk_reserved3: void (* _gtk_reserved3) ( void )`
  No description available.
`_gtk_reserved4: void (* _gtk_reserved4) ( void )`
  No description available.
`_gtk_reserved5: void (* _gtk_reserved5) ( void )`
  No description available.
`_gtk_reserved6: void (* _gtk_reserved6) ( void )`
  No description available.
`_gtk_reserved7: void (* _gtk_reserved7) ( void )`
  No description available.
`_gtk_reserved8: void (* _gtk_reserved8) ( void )`
  No description available.

#### Virtual methods

###### Gtk.MediaStreamClass.pause

Pauses playback of the stream.

since: 4.0

###### Gtk.MediaStreamClass.play

No description available.

since: 4.0

###### Gtk.MediaStreamClass.realize

Called by users to attach the media stream to a `GdkSurface` they manage.

since: 4.0

###### Gtk.MediaStreamClass.seek

Start a seek operation on `self` to `timestamp`.

since: 4.0

###### Gtk.MediaStreamClass.unrealize

Undoes a previous call to gtk_media_stream_realize().

since: 4.0

###### Gtk.MediaStreamClass.update_audio

No description available.

since: 4.0