diff --git a/clapper_src/player.js b/clapper_src/player.js index 32ece64a..82d28640 100644 --- a/clapper_src/player.js +++ b/clapper_src/player.js @@ -38,6 +38,8 @@ class ClapperPlayer extends GstPlayer.Player this.dispatcher = dispatcher; this.renderer = renderer; + this.gstRegistry = Gst.Registry.get(); + this._playerSignals = []; this._widgetSignals = []; @@ -172,6 +174,20 @@ class ClapperPlayer extends GstPlayer.Player pipeline.subtitle_font_desc = desc; } + set_codec_rank(codec, rank) + { + debug(`changing rank of codec: ${codec}`); + + let feature = this.gstRegistry.lookup_feature(codec); + if(!feature) + return debug(`codec unavailable: ${codec}`); + + let oldRank = feature.get_rank(); + feature.set_rank(rank); + + debug(`changed rank: ${oldRank} -> ${rank} for ${codec}`); + } + connect(signal, fn) { this._playerSignals.push(super.connect(signal, fn));