From: Sebastian Dröge Date: Tue, 23 Aug 2016 11:32:24 +0000 (+0300) Subject: player: Move subtitle URI setter next to the uri setter X-Git-Tag: 1.19.3~507^2~6174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0f6105204f3fa75c8d693635d8dc3b8ffc26ab6;p=platform%2Fupstream%2Fgstreamer.git player: Move subtitle URI setter next to the uri setter It's confusing to have them a couple of hundred lines apart. --- diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c index ddd982f..a4fa976 100644 --- a/gst-libs/gst/player/gstplayer.c +++ b/gst-libs/gst/player/gstplayer.c @@ -3170,6 +3170,46 @@ gst_player_set_uri (GstPlayer * self, const gchar * val) } /** + * gst_player_set_subtitle_uri: + * @player: #GstPlayer instance + * @uri: subtitle URI + * + * Returns: %TRUE or %FALSE + * + * Sets the external subtitle URI. + */ +gboolean +gst_player_set_subtitle_uri (GstPlayer * self, const gchar * suburi) +{ + g_return_val_if_fail (GST_IS_PLAYER (self), FALSE); + + g_object_set (self, "suburi", suburi, NULL); + + return TRUE; +} + +/** + * gst_player_get_subtitle_uri: + * @player: #GstPlayer instance + * + * current subtitle URI + * + * Returns: (transfer full): URI of the current external subtitle. + * g_free() after usage. + */ +gchar * +gst_player_get_subtitle_uri (GstPlayer * self) +{ + gchar *val = NULL; + + g_return_val_if_fail (GST_IS_PLAYER (self), NULL); + + g_object_get (self, "suburi", &val, NULL); + + return val; +} + +/** * gst_player_get_position: * @player: #GstPlayer instance * @@ -3549,46 +3589,6 @@ gst_player_set_subtitle_track_enabled (GstPlayer * self, gboolean enabled) } /** - * gst_player_set_subtitle_uri: - * @player: #GstPlayer instance - * @uri: subtitle URI - * - * Returns: %TRUE or %FALSE - * - * Sets the external subtitle URI. - */ -gboolean -gst_player_set_subtitle_uri (GstPlayer * self, const gchar * suburi) -{ - g_return_val_if_fail (GST_IS_PLAYER (self), FALSE); - - g_object_set (self, "suburi", suburi, NULL); - - return TRUE; -} - -/** - * gst_player_get_subtitle_uri: - * @player: #GstPlayer instance - * - * current subtitle URI - * - * Returns: (transfer full): URI of the current external subtitle. - * g_free() after usage. - */ -gchar * -gst_player_get_subtitle_uri (GstPlayer * self) -{ - gchar *val = NULL; - - g_return_val_if_fail (GST_IS_PLAYER (self), NULL); - - g_object_get (self, "suburi", &val, NULL); - - return val; -} - -/** * gst_player_set_visualization: * @player: #GstPlayer instance * @name: visualization element obtained from diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h index 41fe267..e51d8c5 100644 --- a/gst-libs/gst/player/gstplayer.h +++ b/gst-libs/gst/player/gstplayer.h @@ -118,6 +118,10 @@ gchar * gst_player_get_uri (GstPlayer * player); void gst_player_set_uri (GstPlayer * player, const gchar * uri); +gchar * gst_player_get_subtitle_uri (GstPlayer * player); +gboolean gst_player_set_subtitle_uri (GstPlayer * player, + const gchar *uri); + GstClockTime gst_player_get_position (GstPlayer * player); GstClockTime gst_player_get_duration (GstPlayer * player); @@ -160,10 +164,6 @@ GstPlayerVideoInfo * gst_player_get_current_video_track GstPlayerSubtitleInfo * gst_player_get_current_subtitle_track (GstPlayer * player); -gboolean gst_player_set_subtitle_uri (GstPlayer * player, - const gchar *uri); -gchar * gst_player_get_subtitle_uri (GstPlayer * player); - gboolean gst_player_set_visualization (GstPlayer * player, const gchar *name);