mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
32 lines
786 B
JavaScript
32 lines
786 B
JavaScript
const { GLib, Gst } = imports.gi;
|
|
const REQ_GST_VERSION_MINOR = 18;
|
|
|
|
function debug(msg, levelName)
|
|
{
|
|
levelName = levelName || 'LEVEL_DEBUG';
|
|
|
|
if(msg.message) {
|
|
levelName = 'LEVEL_CRITICAL';
|
|
msg = msg.message;
|
|
}
|
|
GLib.log_structured(
|
|
'Clapper', GLib.LogLevelFlags[levelName], {
|
|
MESSAGE: msg,
|
|
SYSLOG_IDENTIFIER: 'clapper'
|
|
});
|
|
}
|
|
|
|
function gstVersionCheck()
|
|
{
|
|
if(Gst.VERSION_MINOR >= REQ_GST_VERSION_MINOR)
|
|
return;
|
|
|
|
debug(
|
|
'Clapper was designed to' +
|
|
` work with GStreamer 1.${REQ_GST_VERSION_MINOR} or later.` +
|
|
` Your version is ${Gst.VERSION_MAJOR}.${Gst.VERSION_MINOR}.` +
|
|
' Please update GStreamer or expect some things to be broken.',
|
|
'LEVEL_WARNING'
|
|
);
|
|
}
|