mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Remove player config options that were changed/fixed in API
This commit is contained in:
@@ -30,13 +30,7 @@ class ClapperPlayerBase extends GstClapper.Clapper
|
|||||||
const glsinkbin = Gst.ElementFactory.make('glsinkbin', null);
|
const glsinkbin = Gst.ElementFactory.make('glsinkbin', null);
|
||||||
glsinkbin.sink = gtk4glsink;
|
glsinkbin.sink = gtk4glsink;
|
||||||
|
|
||||||
const context = GLib.MainContext.ref_thread_default();
|
const dispatcher = new GstClapper.ClapperGMainContextSignalDispatcher();
|
||||||
const acquired = context.acquire();
|
|
||||||
debug(`default context acquired: ${acquired}`);
|
|
||||||
|
|
||||||
const dispatcher = new GstClapper.ClapperGMainContextSignalDispatcher({
|
|
||||||
application_context: context,
|
|
||||||
});
|
|
||||||
const renderer = new GstClapper.ClapperVideoOverlayVideoRenderer({
|
const renderer = new GstClapper.ClapperVideoOverlayVideoRenderer({
|
||||||
video_sink: glsinkbin
|
video_sink: glsinkbin
|
||||||
});
|
});
|
||||||
@@ -62,10 +56,6 @@ class ClapperPlayerBase extends GstClapper.Clapper
|
|||||||
this.set_and_bind_settings();
|
this.set_and_bind_settings();
|
||||||
|
|
||||||
settings.connect('changed', this._onSettingsKeyChanged.bind(this));
|
settings.connect('changed', this._onSettingsKeyChanged.bind(this));
|
||||||
|
|
||||||
/* FIXME: additional reference for working around GstPlayer
|
|
||||||
* buggy signal dispatcher on self. Remove when ported to BUS API */
|
|
||||||
this.ref();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_and_bind_settings()
|
set_and_bind_settings()
|
||||||
@@ -87,14 +77,6 @@ class ClapperPlayerBase extends GstClapper.Clapper
|
|||||||
|
|
||||||
set_initial_config()
|
set_initial_config()
|
||||||
{
|
{
|
||||||
const gstClapperConfig = {
|
|
||||||
position_update_interval: 1000,
|
|
||||||
user_agent: 'clapper',
|
|
||||||
};
|
|
||||||
|
|
||||||
for(let option of Object.keys(gstClapperConfig))
|
|
||||||
this.set_config_option(option, gstClapperConfig[option]);
|
|
||||||
|
|
||||||
this.set_mute(false);
|
this.set_mute(false);
|
||||||
|
|
||||||
/* FIXME: change into option in preferences */
|
/* FIXME: change into option in preferences */
|
||||||
@@ -102,20 +84,6 @@ class ClapperPlayerBase extends GstClapper.Clapper
|
|||||||
pipeline.ring_buffer_max_size = 8 * 1024 * 1024;
|
pipeline.ring_buffer_max_size = 8 * 1024 * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_config_option(option, value)
|
|
||||||
{
|
|
||||||
const setOption = GstClapper.Clapper[`config_set_${option}`];
|
|
||||||
if(!setOption)
|
|
||||||
return debug(`unsupported option: ${option}`, 'LEVEL_WARNING');
|
|
||||||
|
|
||||||
const config = this.get_config();
|
|
||||||
setOption(config, value);
|
|
||||||
const success = this.set_config(config);
|
|
||||||
|
|
||||||
if(!success)
|
|
||||||
debug(`could not change option: ${option}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
set_all_plugins_ranks()
|
set_all_plugins_ranks()
|
||||||
{
|
{
|
||||||
let data = [];
|
let data = [];
|
||||||
@@ -181,30 +149,16 @@ class ClapperPlayerBase extends GstClapper.Clapper
|
|||||||
|
|
||||||
switch(key) {
|
switch(key) {
|
||||||
case 'seeking-mode':
|
case 'seeking-mode':
|
||||||
const isSeekMode = (typeof this.set_seek_mode !== 'undefined');
|
|
||||||
this.seekingMode = settings.get_string('seeking-mode');
|
this.seekingMode = settings.get_string('seeking-mode');
|
||||||
switch(this.seekingMode) {
|
switch(this.seekingMode) {
|
||||||
case 'fast':
|
case 'fast':
|
||||||
if(isSeekMode)
|
this.set_seek_mode(GstClapper.ClapperSeekMode.FAST);
|
||||||
this.set_seek_mode(GstClapper.ClapperSeekMode.FAST);
|
|
||||||
else
|
|
||||||
this.set_config_option('seek_fast', true);
|
|
||||||
break;
|
break;
|
||||||
case 'accurate':
|
case 'accurate':
|
||||||
if(isSeekMode)
|
this.set_seek_mode(GstClapper.ClapperSeekMode.ACCURATE);
|
||||||
this.set_seek_mode(GstClapper.ClapperSeekMode.ACCURATE);
|
|
||||||
else {
|
|
||||||
this.set_config_option('seek_fast', false);
|
|
||||||
this.set_config_option('seek_accurate', true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(isSeekMode)
|
this.set_seek_mode(GstClapper.ClapperSeekMode.DEFAULT);
|
||||||
this.set_seek_mode(GstClapper.ClapperSeekMode.DEFAULT);
|
|
||||||
else {
|
|
||||||
this.set_config_option('seek_fast', false);
|
|
||||||
this.set_config_option('seek_accurate', false);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user