<commit_before>------------------------------------------------------------------------------
--
--  LGI Gst override module.
--
--  Copyright (c) 2010 <NAME>
--  Licensed under the MIT license:
--  http://www.opensource.org/licenses/mit-license.php
--
------------------------------------------------------------------------------

local lgi = require 'lgi'
local gi = require('lgi._core').gi
local Gst = lgi.Gst

-- GstObject has special ref_sink mechanism, make sure that lgi core
-- is aware of it, otherwise refcounting is screwed.
Gst.Object._sink = gi.Gst.Object.methods.ref_sink

-- Load additional Gst modules.
local GstInterfaces = lgi.GstInterfaces<commit_msg>Add some Gst helper overrides.<commit_after>------------------------------------------------------------------------------
--
--  LGI Gst override module.
--
--  Copyright (c) 2010 <NAME>
--  Licensed under the MIT license:
--  http://www.opensource.org/licenses/mit-license.php
--
------------------------------------------------------------------------------

local lgi = require 'lgi'
local gi = require('lgi._core').gi
local GLib = lgi.GLib
local Gst = lgi.Gst

-- GstObject has special ref_sink mechanism, make sure that lgi core
-- is aware of it, otherwise refcounting is screwed.
Gst.Object._sink = gi.Gst.Object.methods.ref_sink

function Gst.Bus:add_watch(callback)
   return self:add_watch_full(GLib.PRIORITY_DEFAULT, callback)
end

function Gst.Bin:add_many(...)
   local args = {...}
   for i = 1, #args do self:add(args[i]) end
end

-- Load additional Gst modules.
local GstInterfaces = lgi.GstInterfaces

-- Initialize gstreamer.
Gst.init()
{'fraction_non_alphanumeric': 0.2933579335793358, 'fraction_numerical': 0.005535055350553505, 'mean_word_length': 1.6981757877280266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2720070', 'n_tokens_mistral': 478, 'n_tokens_neox': 466, 'n_words': 131}