Merge branch 'rerename-mediastream' into 'master'

mediastream: Rename apis one more time

See merge request GNOME/gtk!3720
This commit is contained in:
Benjamin Otte 2021-07-03 13:28:35 +00:00
commit 390447862a
6 changed files with 55 additions and 55 deletions

View File

@ -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. */

View File

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

View File

@ -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);
}
/**

View File

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

View File

@ -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);
}
}

View File

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