### Class

# GtkMediaStream

#### 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()`.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- GtkMediaFile

#### Implements

- GdkPaintable

#### Instance methods

###### gtk_media_stream_ended

Pauses the media stream and marks it as ended.

deprecated: 4.4

###### gtk_media_stream_error

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

###### gtk_media_stream_error_valist

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

###### gtk_media_stream_gerror

Sets `self` into an error state.

###### gtk_media_stream_get_duration

Gets the duration of the stream.

###### gtk_media_stream_get_ended

Returns whether the streams playback is finished.

###### gtk_media_stream_get_error

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

###### gtk_media_stream_get_loop

Returns whether the stream is set to loop.

###### gtk_media_stream_get_muted

Returns whether the audio for the stream is muted.

###### gtk_media_stream_get_playing

Return whether the stream is currently playing.

###### gtk_media_stream_get_timestamp

Returns the current presentation timestamp in microseconds.

###### gtk_media_stream_get_volume

Returns the volume of the audio for the stream.

###### gtk_media_stream_has_audio

Returns whether the stream has audio.

###### gtk_media_stream_has_video

Returns whether the stream has video.

###### gtk_media_stream_is_prepared

Returns whether the stream has finished initializing.

###### gtk_media_stream_is_seekable

Checks if a stream may be seekable.

###### gtk_media_stream_is_seeking

Checks if there is currently a seek operation going on.

###### gtk_media_stream_pause

Pauses playback of the stream.

###### gtk_media_stream_play

Starts playing the stream.

###### gtk_media_stream_prepared

Same as gtk_media_stream_stream_prepared().

deprecated: 4.4

###### gtk_media_stream_realize

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

###### gtk_media_stream_seek

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

###### gtk_media_stream_seek_failed

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

###### gtk_media_stream_seek_success

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

###### gtk_media_stream_set_loop

Sets whether the stream should loop.

###### gtk_media_stream_set_muted

Sets whether the audio stream should be muted.

###### gtk_media_stream_set_playing

Starts or pauses playback of the stream.

###### gtk_media_stream_set_volume

Sets the volume of the audio stream.

###### 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

###### gtk_media_stream_unrealize

Undoes a previous call to gtk_media_stream_realize().

###### gtk_media_stream_update

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

##### 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`.

###### gdk_paintable_get_current_image

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

###### gdk_paintable_get_flags

Get flags for the paintable.

###### gdk_paintable_get_intrinsic_aspect_ratio

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

###### gdk_paintable_get_intrinsic_height

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

###### gdk_paintable_get_intrinsic_width

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

###### gdk_paintable_invalidate_contents

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

###### gdk_paintable_invalidate_size

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

###### gdk_paintable_snapshot

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

#### Properties

###### Gtk.MediaStream:duration

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

###### Gtk.MediaStream:ended

Set when playback has finished.

###### Gtk.MediaStream:error

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

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

Whether the stream contains audio.

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

Whether the stream contains video.

###### Gtk.MediaStream:loop

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

###### Gtk.MediaStream:muted

Whether the audio stream should be muted.

###### Gtk.MediaStream:playing

Whether the stream is currently playing.

###### Gtk.MediaStream:prepared

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

###### Gtk.MediaStream:seekable

Set unless the stream is known to not support seeking.

###### Gtk.MediaStream:seeking

Set while a seek is in progress.

###### Gtk.MediaStream:timestamp

The current presentation timestamp in microseconds.

###### Gtk.MediaStream:volume

Volume of the audio stream.

#### 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.

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

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

Emitted when the contents of the `paintable` change.

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

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

#### 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.

###### Gtk.MediaStreamClass.play

No description available.

###### Gtk.MediaStreamClass.realize

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

###### Gtk.MediaStreamClass.seek

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

###### Gtk.MediaStreamClass.unrealize

Undoes a previous call to gtk_media_stream_realize().

###### Gtk.MediaStreamClass.update_audio

No description available.