Getting the Perl GStreamer api working.

Steve it at sca-uk.com
Fri Apr 29 07:54:48 PDT 2011


Hi Guys, 

I'm trying to get the GStreamer Perl api working on Kubuntu. Does anybody
have it working? The core GStreamer module is currently working on my
installation, which I can test through wxMediaCtrl, but wx has some bugs
which I'm hoping to avoid by going straight to GStreamer. I have installed
the api from cpan and I'm running the 'synopsis' from the top of the doc. 

I get the following error message: 

Stream contains no data. at
/home/image/Documents/Endoscopia/GStreamer_Demo.pl line 28.

Here is the code itself. The print statements give 1 (playable) and 010280
(version), respectively. 

regards 

Steve 

#!/usr/bin/perl

	use strict;

	use warnings;

	use Glib qw(TRUE FALSE);



	use GStreamer -init;



	my $loop = Glib::MainLoop -> new();

	print GStreamer->init_check, "\n";

	print GStreamer->version, "\n";



# set up

	my $play = GStreamer::ElementFactory -> make("playbin", "play");

	$play -> set(uri => Glib::filename_to_uri
"/home/image/Documents/Endoscopia/media/a_100_23_1.avi", "localhost");

	$play -> get_bus() -> add_watch(\&my_bus_callback, $loop);

	$play -> set_state("playing");



# run

	$loop -> run();



# clean up

	$play -> set_state("null");



sub my_bus_callback {

	my ($bus, $message, $loop) = @_;



	if ($message -> type & "error") {

		warn $message -> error;

		$loop -> quit();

	}



	elsif ($message -> type & "eos") {

		$loop -> quit();

	}



# remove message from the queue

	return TRUE;

}




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110429/dc29d763/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 145 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110429/dc29d763/attachment.gif>


More information about the gstreamer-devel mailing list