Re: "Not a CODE reference" error with Gtk::Bus::add_watch

On Sun, Nov 20, 2016 at 07:56:06PM +0100, Torsten Schönfeld wrote:
On 20.11.2016 14:30, Wouter Verhelst wrote:
my $pipeline = Gst::parse_launch("...");

my $bus = $pipeline->get_bus();
$bus->add_watch(\&buswatch, $mainloop);


Since gst_bus_add_watch is not introspectable directly, the GStreamer
authors marked gst_bus_add_watch_full as its replacement.

Ah, that explains it! Thanks.

("perli11ndoc Gst::Bus::add_watch" says "[NOT INTROSPECTABLE, shadowed
by add_watch_full]".)  Unfortunately, its calling syntax is slightly
different.  See "perli11ndoc Gst::Bus::add_watch_full".  So, try this:

I didn't know about "perli11ndoc", thanks!

      use Glib qw/G_PRIORITY_DEFAULT/;
      $bus->add_watch(G_PRIORITY_DEFAULT, \&buswatch, $mainloop);

I also needed to add this before entering the main loop:


Right, sorry -- my actual code is much longer, I just distilled the
relevant bits. Apparently I missed that part.

Thanks again.

Wouter Verhelst
M: +32 486 836 198

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]