<commit_before>#! /usr/bin/env lua

--
-- Sample GStreamer application, port of public Vala GStreamer Audio
-- Stream Example (http://live.gnome.org/Vala/GStreamerSample)
--

require 'lgi'
local GLib = require 'lgi.GLib'
local Gtk = require 'lgi.Gtk'
local Gst = require 'lgi.Gst'

Gtk.init()
Gst.init()

local function bus_callback(bus, message)
   if message.type == Gst.MessageType.ERROR then
      print 'error'
      Gtk.main_quit()
   elseif message.type == Gst.MessageType.EOS then
      print 'end of stream'
   elseif message.type == Gst.MessageType.STATE_CHANGED then
      local old, new, pending = message:parse_state_changed()
      print(string.format('state changed: %s->%s:%s',
			  Gst.State[old] or tostring(old),
			  Gst.State[new] or tostring(new),
			  Gst.State[pending] or tostring(pending)))
   elseif message.type == Gst.MessageType.TAG then
      print('taglist found')
   end

   return true
end

local play = Gst.ElementFactory.make('playbin', 'play')
play.uri = 'http://streamer-dtc-aa02.somafm.com:80/stream/1018'
local bus = play.bus
bus:add_watch_full(GLib.PRIORITY_DEFAULT, bus_callback)
play:set_state(Gst.State.PLAYING)

-- Run the loop.
Gtk.main()
play:set_state(Gst.State.NULL)<commit_msg>Remove sample workaround for broken caller-alloc marshalling.<commit_after>#! /usr/bin/env lua

--
-- Sample GStreamer application, port of public Vala GStreamer Audio
-- Stream Example (http://live.gnome.org/Vala/GStreamerSample)
--

require 'lgi'
local GLib = require 'lgi.GLib'
local Gtk = require 'lgi.Gtk'
local Gst = require 'lgi.Gst'

Gtk.init()
Gst.init()

local function bus_callback(bus, message)
   if message.type == Gst.MessageType.ERROR then
      print 'error'
      Gtk.main_quit()
   elseif message.type == Gst.MessageType.EOS then
      print 'end of stream'
   elseif message.type == Gst.MessageType.STATE_CHANGED then
      local old, new, pending = message:parse_state_changed()
      print(string.format('state changed: %s->%s:%s',
			  Gst.State[old], Gst.State[new], Gst.State[pending]))
   elseif message.type == Gst.MessageType.TAG then
      print('taglist found')
   end

   return true
end

local play = Gst.ElementFactory.make('playbin', 'play')
play.uri = 'http://streamer-dtc-aa02.somafm.com:80/stream/1018'
local bus = play.bus
bus:add_watch_full(GLib.PRIORITY_DEFAULT, bus_callback)
play:set_state(Gst.State.PLAYING)

-- Run the loop.
Gtk.main()
play:set_state(Gst.State.NULL)
{'fraction_non_alphanumeric': 0.13377102995486254, 'fraction_numerical': 0.006565449322938038, 'mean_word_length': 3.945233265720081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4245145', 'n_tokens_mistral': 892, 'n_tokens_neox': 866, 'n_words': 195}