mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 00:11:59 +02:00
clapper-app: Apply "adaptive-start-bitrate" on startup
Watch for "adaptive-bandwidth" changes during adaptive streaming, use these to set "adaptive-start-bitrate" player property, so we do not always start streaming from some constant bitrate value which might not be the best for everyone. Additionally, store last value in GSettings on app exit and also add a command line arg to set this too.
This commit is contained in:
@@ -151,6 +151,15 @@ _queue_current_item_changed_cb (ClapperQueue *queue,
|
||||
gst_clear_object (¤t_item);
|
||||
}
|
||||
|
||||
static void
|
||||
_player_adaptive_bandwidth_changed_cb (ClapperPlayer *player,
|
||||
GParamSpec *pspec G_GNUC_UNUSED, gpointer *user_data G_GNUC_UNUSED)
|
||||
{
|
||||
/* Do not take whole bandwidth */
|
||||
clapper_player_set_adaptive_start_bitrate (player,
|
||||
clapper_player_get_adaptive_bandwidth (player) * 0.8);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_get_seek_method_mapping (GValue *value,
|
||||
GVariant *variant, gpointer user_data G_GNUC_UNUSED)
|
||||
@@ -1280,10 +1289,12 @@ clapper_app_window_constructed (GObject *object)
|
||||
|
||||
clapper_player_set_autoplay (player, TRUE);
|
||||
|
||||
/* No need to also call this here, as item is selected
|
||||
/* No need to also call these here, as they only change
|
||||
* after application window is contructed */
|
||||
g_signal_connect (queue, "notify::current-item",
|
||||
G_CALLBACK (_queue_current_item_changed_cb), self);
|
||||
g_signal_connect (player, "notify::adaptive-bandwidth",
|
||||
G_CALLBACK (_player_adaptive_bandwidth_changed_cb), NULL);
|
||||
|
||||
g_settings_bind (self->settings, "audio-offset",
|
||||
player, "audio-offset", G_SETTINGS_BIND_GET);
|
||||
|
Reference in New Issue
Block a user