[gtk/rerename-mediastream] mediastream: Rename apis one more time
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/rerename-mediastream] mediastream: Rename apis one more time
- Date: Sat, 3 Jul 2021 13:06:40 +0000 (UTC)
commit 3227aa2c45fa24f195f81fcc8cd56c1059c1869c
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 3 09:05:33 2021 -0400
mediastream: Rename apis one more time
Before we end up with names that we are unhappy with,
rename things one more time, and update all callers.
demos/gtk-demo/paintable_mediastream.c | 12 +++++-----
gtk/gtkmediafile.c | 2 +-
gtk/gtkmediastream.c | 44 +++++++++++++++++-----------------
gtk/gtkmediastream.h | 12 +++++-----
modules/media/gtkffmediafile.c | 18 +++++++-------
modules/media/gtkgstmediafile.c | 22 ++++++++---------
6 files changed, 55 insertions(+), 55 deletions(-)
---
diff --git a/demos/gtk-demo/paintable_mediastream.c b/demos/gtk-demo/paintable_mediastream.c
index c142cdd6c0..54d805c206 100644
--- a/demos/gtk-demo/paintable_mediastream.c
+++ b/demos/gtk-demo/paintable_mediastream.c
@@ -150,7 +150,7 @@ gtk_nuclear_media_stream_step (gpointer data)
* call our pause function to pause the stream.
*/
if (nuclear->progress >= DURATION)
- gtk_media_stream_set_ended (GTK_MEDIA_STREAM (nuclear));
+ gtk_media_stream_stream_ended (GTK_MEDIA_STREAM (nuclear));
/* The timeout function is removed by the pause function,
* so we can just always return this value.
@@ -267,11 +267,11 @@ gtk_nuclear_media_stream_init (GtkNuclearMediaStream *nuclear)
* However, media streams need to tell GTK once they are initialized,
* so we do that here.
*/
- gtk_media_stream_set_prepared (GTK_MEDIA_STREAM (nuclear),
- FALSE,
- TRUE,
- TRUE,
- DURATION);
+ gtk_media_stream_stream_prepared (GTK_MEDIA_STREAM (nuclear),
+ FALSE,
+ TRUE,
+ TRUE,
+ DURATION);
}
/* And finally, we add the simple constructor we declared in the header. */
diff --git a/gtk/gtkmediafile.c b/gtk/gtkmediafile.c
index 53b4e5b3fc..33b56a2cf5 100644
--- a/gtk/gtkmediafile.c
+++ b/gtk/gtkmediafile.c
@@ -72,7 +72,7 @@ gtk_media_file_default_open (GtkMediaFile *self)
static void
gtk_media_file_default_close (GtkMediaFile *self)
{
- gtk_media_stream_unset_prepared (GTK_MEDIA_STREAM (self));
+ gtk_media_stream_stream_unprepared (GTK_MEDIA_STREAM (self));
}
static void
diff --git a/gtk/gtkmediastream.c b/gtk/gtkmediastream.c
index 8e33814d1e..5b7df25cca 100644
--- a/gtk/gtkmediastream.c
+++ b/gtk/gtkmediastream.c
@@ -1012,7 +1012,7 @@ gtk_media_stream_unrealize (GtkMediaStream *self,
}
/**
- * gtk_media_stream_set_prepared:
+ * gtk_media_stream_stream_prepared:
* @self: a `GtkMediaStream`
* @has_audio: %TRUE if the stream should advertise audio support
* @has_video: %TRUE if the stream should advertise video support
@@ -1028,16 +1028,16 @@ gtk_media_stream_unrealize (GtkMediaStream *self,
* values to determine what controls to show.
*
* This function may not be called again until the stream has been
- * reset via [method@Gtk.MediaStream.unprepared].
+ * reset via [method@Gtk.MediaStream.stream_unprepared].
*
* Since: 4.4
*/
void
-gtk_media_stream_set_prepared (GtkMediaStream *self,
- gboolean has_audio,
- gboolean has_video,
- gboolean seekable,
- gint64 duration)
+gtk_media_stream_stream_prepared (GtkMediaStream *self,
+ gboolean has_audio,
+ gboolean has_video,
+ gboolean seekable,
+ gint64 duration)
{
GtkMediaStreamPrivate *priv = gtk_media_stream_get_instance_private (self);
@@ -1074,19 +1074,19 @@ gtk_media_stream_set_prepared (GtkMediaStream *self,
}
/**
- * gtk_media_stream_unset_prepared:
+ * gtk_media_stream_stream_unprepared:
* @self: a `GtkMediaStream`
*
* Resets a given media stream implementation.
*
- * [method@Gtk.MediaStream.prepared] can then be called again.
+ * [method@Gtk.MediaStream.stream_prepared] can then be called again.
*
* This function will also reset any error state the stream was in.
*
* Since: 4.4
*/
void
-gtk_media_stream_unset_prepared (GtkMediaStream *self)
+gtk_media_stream_stream_unprepared (GtkMediaStream *self)
{
GtkMediaStreamPrivate *priv = gtk_media_stream_get_instance_private (self);
@@ -1147,9 +1147,9 @@ gtk_media_stream_unset_prepared (GtkMediaStream *self)
* @seekable: %TRUE if the stream should advertise seekability
* @duration: The duration of the stream or 0 if unknown
*
- * Same as gtk_media_stream_set_prepared().
+ * Same as gtk_media_stream_stream_prepared().
*
- * Deprecated: 4.4: Use [method@Gtk.MediaStream.set_prepared] instead.
+ * Deprecated: 4.4: Use [method@Gtk.MediaStream.stream_prepared] instead.
*/
void
gtk_media_stream_prepared (GtkMediaStream *self,
@@ -1158,21 +1158,21 @@ gtk_media_stream_prepared (GtkMediaStream *self,
gboolean seekable,
gint64 duration)
{
- gtk_media_stream_set_prepared (self, has_audio, has_video, seekable, duration);
+ gtk_media_stream_stream_prepared (self, has_audio, has_video, seekable, duration);
}
/**
* gtk_media_stream_unprepared: (skip)
* @self: a `GtkMediaStream`
*
- * Same as gtk_media_stream_unset_prepared().
+ * Same as gtk_media_stream_stream_unprepared().
*
- * Deprecated: 4.4: Use [method@Gtk.MediaStream.unset_prepared] instead.
+ * Deprecated: 4.4: Use [method@Gtk.MediaStream.stream_unprepared] instead.
*/
void
gtk_media_stream_unprepared (GtkMediaStream *self)
{
- gtk_media_stream_unset_prepared (self);
+ gtk_media_stream_stream_unprepared (self);
}
/**
@@ -1337,12 +1337,12 @@ gtk_media_stream_update (GtkMediaStream *self,
}
/**
- * gtk_media_stream_set_ended:
+ * gtk_media_stream_stream_ended:
* @self: a `GtkMediaStream`
*
* Pauses the media stream and marks it as ended.
*
- * This is a hint only, calls to GtkMediaStream.play()
+ * 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.
@@ -1350,7 +1350,7 @@ gtk_media_stream_update (GtkMediaStream *self,
* Since: 4.4
*/
void
-gtk_media_stream_set_ended (GtkMediaStream *self)
+gtk_media_stream_stream_ended (GtkMediaStream *self)
{
GtkMediaStreamPrivate *priv = gtk_media_stream_get_instance_private (self);
@@ -1374,17 +1374,17 @@ gtk_media_stream_set_ended (GtkMediaStream *self)
*
* Pauses the media stream and marks it as ended.
*
- * This is a hint only, calls to GtkMediaStream.play()
+ * 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.
*
- * Deprecated: 4.4: Use [method@Gtk.MediaStream.set_ended] instead
+ * Deprecated: 4.4: Use [method@Gtk.MediaStream.stream_ended] instead
*/
void
gtk_media_stream_ended (GtkMediaStream *self)
{
- gtk_media_stream_set_ended (self);
+ gtk_media_stream_stream_ended (self);
}
/**
diff --git a/gtk/gtkmediastream.h b/gtk/gtkmediastream.h
index ed892ccccf..8956c00237 100644
--- a/gtk/gtkmediastream.h
+++ b/gtk/gtkmediastream.h
@@ -116,31 +116,31 @@ void gtk_media_stream_unrealize (GtkMediaStream
GdkSurface *surface);
/* for implementations only */
-GDK_DEPRECATED_IN_4_4_FOR(gtk_media_stream_set_prepared)
+GDK_DEPRECATED_IN_4_4_FOR(gtk_media_stream_stream_prepared)
void gtk_media_stream_prepared (GtkMediaStream *self,
gboolean has_audio,
gboolean has_video,
gboolean seekable,
gint64 duration);
-GDK_DEPRECATED_IN_4_4_FOR(gtk_media_stream_unset_prepared)
+GDK_DEPRECATED_IN_4_4_FOR(gtk_media_stream_stream_unprepared)
void gtk_media_stream_unprepared (GtkMediaStream *self);
GDK_AVAILABLE_IN_4_4
-void gtk_media_stream_set_prepared (GtkMediaStream *self,
+void gtk_media_stream_stream_prepared (GtkMediaStream *self,
gboolean has_audio,
gboolean has_video,
gboolean seekable,
gint64 duration);
GDK_AVAILABLE_IN_4_4
-void gtk_media_stream_unset_prepared (GtkMediaStream *self);
+void gtk_media_stream_stream_unprepared (GtkMediaStream *self);
GDK_AVAILABLE_IN_ALL
void gtk_media_stream_update (GtkMediaStream *self,
gint64 timestamp);
-GDK_DEPRECATED_IN_4_4_FOR(gtk_media_stream_set_ended)
+GDK_DEPRECATED_IN_4_4_FOR(gtk_media_stream_stream_ended)
void gtk_media_stream_ended (GtkMediaStream *self);
GDK_AVAILABLE_IN_4_4
-void gtk_media_stream_set_ended (GtkMediaStream *self);
+void gtk_media_stream_stream_ended (GtkMediaStream *self);
GDK_AVAILABLE_IN_ALL
void gtk_media_stream_seek_success (GtkMediaStream *self);
GDK_AVAILABLE_IN_ALL
diff --git a/modules/media/gtkffmediafile.c b/modules/media/gtkffmediafile.c
index 4964b58886..ff5225e845 100644
--- a/modules/media/gtkffmediafile.c
+++ b/modules/media/gtkffmediafile.c
@@ -553,13 +553,13 @@ gtk_ff_media_file_open (GtkMediaFile *file)
return;
}
- gtk_media_stream_set_prepared (GTK_MEDIA_STREAM (video),
- FALSE,
- video->codec_ctx != NULL,
- TRUE,
- video->format_ctx->duration != AV_NOPTS_VALUE
- ? av_rescale (video->format_ctx->duration, G_USEC_PER_SEC, AV_TIME_BASE)
- : 0);
+ gtk_media_stream_stream_prepared (GTK_MEDIA_STREAM (video),
+ FALSE,
+ video->codec_ctx != NULL,
+ TRUE,
+ video->format_ctx->duration != AV_NOPTS_VALUE
+ ? av_rescale (video->format_ctx->duration, G_USEC_PER_SEC,
AV_TIME_BASE)
+ : 0);
gdk_paintable_invalidate_size (GDK_PAINTABLE (video));
@@ -632,7 +632,7 @@ gtk_ff_media_file_next_frame_cb (gpointer data)
if (!gtk_media_stream_get_loop (GTK_MEDIA_STREAM (video)) ||
!gtk_ff_media_file_restart (video))
{
- gtk_media_stream_set_ended (GTK_MEDIA_STREAM (video));
+ gtk_media_stream_stream_ended (GTK_MEDIA_STREAM (video));
return G_SOURCE_REMOVE;
}
@@ -733,7 +733,7 @@ gtk_ff_media_file_seek (GtkMediaStream *stream,
{
gtk_ff_media_file_pause (stream);
if (!gtk_ff_media_file_play (stream))
- gtk_media_stream_set_ended (stream);
+ gtk_media_stream_stream_ended (stream);
}
}
diff --git a/modules/media/gtkgstmediafile.c b/modules/media/gtkgstmediafile.c
index d1ebab1506..6f09d1dbc8 100644
--- a/modules/media/gtkgstmediafile.c
+++ b/modules/media/gtkgstmediafile.c
@@ -137,11 +137,11 @@ gtk_gst_media_file_ensure_prepared (GtkGstMediaFile *self)
media_info = gst_player_get_media_info (self->player);
if (media_info)
{
- gtk_media_stream_set_prepared (GTK_MEDIA_STREAM (self),
- gst_player_media_info_get_audio_streams (media_info) != NULL,
- gst_player_media_info_get_video_streams (media_info) != NULL,
- gst_player_media_info_is_seekable (media_info),
- FROM_GST_TIME (gst_player_media_info_get_duration (media_info)));
+ gtk_media_stream_stream_prepared (GTK_MEDIA_STREAM (self),
+ gst_player_media_info_get_audio_streams (media_info) != NULL,
+ gst_player_media_info_get_video_streams (media_info) != NULL,
+ gst_player_media_info_is_seekable (media_info),
+ FROM_GST_TIME (gst_player_media_info_get_duration (media_info)));
g_object_unref (media_info);
}
@@ -152,11 +152,11 @@ gtk_gst_media_file_ensure_prepared (GtkGstMediaFile *self)
*
* Only for seeking we can't do a thing, because with 0 duration we can't seek anywhere.
*/
- gtk_media_stream_set_prepared (GTK_MEDIA_STREAM (self),
- TRUE,
- TRUE,
- FALSE,
- 0);
+ gtk_media_stream_stream_prepared (GTK_MEDIA_STREAM (self),
+ TRUE,
+ TRUE,
+ FALSE,
+ 0);
}
}
@@ -208,7 +208,7 @@ gtk_gst_media_file_end_of_stream_cb (GstPlayer *player,
return;
}
- gtk_media_stream_set_ended (GTK_MEDIA_STREAM (self));
+ gtk_media_stream_stream_ended (GTK_MEDIA_STREAM (self));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]