GStreamer
view release on metacpan or search on metacpan
lib/GStreamer.pm view on Meta::CPAN
# set up
my $play = GStreamer::ElementFactory -> make("playbin", "play");
$play -> set(uri => Glib::filename_to_uri $file, "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;
}
=head1 ABSTRACT
B<DEPRECATED> GStreamer wraps version 0.10.x of the GStreamer C libraries in a
nice and Perlish way, freeing the programmer from any memory management and
object casting hassles.
=head1 DESCRIPTION
B<NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE>
This module has been deprecated by the Gtk-Perl project. This means that the
module will no longer be updated with security patches, bug fixes, or when
changes are made in the Perl ABI. The Git repo for this module has been
archived (made read-only), it will no longer possible to submit new commits to
it. You are more than welcome to ask about this module on the Gtk-Perl
mailing list, but our priorities going forward will be maintaining Gtk-Perl
modules that are supported and maintained upstream; this module is neither.
Since this module is licensed under the LGPL v2.1, you may also fork this
module, if you wish, but you will need to use a different name for it on CPAN,
and the Gtk-Perl team requests that you use your own resources (mailing list,
Git repos, bug trackers, etc.) to maintain your fork going forward.
=over
=item *
Perl URL: https://gitlab.gnome.org/GNOME/perl-gstreamer
=item *
Upstream URL: https://gitlab.freedesktop.org/gstreamer/gstreamer
=item *
Last upstream version: 0.10.35
=item *
Last upstream release date: 2011-06-15
=item *
Migration path for this module: G:O:I
=item *
Migration module URL: https://metacpan.org/pod/Glib::Object::Introspection
=back
B<NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE>
This module only works with the 0.10.x series of the GStreamer C libraries.
There is another Perl module, L<GStreamer1>, that is intended for the 1.x
series of the GStreamer C libraries. L<GStreamer1> is located at
L<https://metacpan.org/pod/GStreamer1>.
The two C libraries, as well as their associated Perl modules, can be installed
concurrently on the same host.
See the POD for L<GStreamer1> (L<https://metacpan.org/pod/GStreamer1>) for
more information about that module.
B<NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE>
GStreamer makes everybody dance like crazy. It provides the means to play,
stream, and convert nearly any type of media -- be it audio or video.
=head1 INITIALIZATION
=over
=item B<GStreamer-E<gt>init>
Initializes GStreamer. Automatically parses I<@ARGV>, stripping any options
known to GStreamer.
=item B<boolean = GStreamer-E<gt>init_check>
Checks if initialization is possible. Returns TRUE if so.
=back
When importing GStreamer, you can pass the C<-init> option to have
I<GStreamer-E<gt>init> automatically called for you. If you need to know if
initialization is possible without actually doing it, use
I<GStreamer-E<gt>init_check>.
=head1 VERSION CHECKING
=over
=item B<boolean = GStreamer-E<gt>CHECK_VERSION (major, minor, micro)>
=over
=item * major (integer)
=item * minor (integer)
=item * micro (integer)
=back
Returns TRUE if the GStreamer library version GStreamer was compiled against is
newer than the one specified by the three arguments.
=item B<(major, minor, micro) = GStreamer-E<gt>GET_VERSION_INFO>
Returns the version information of the GStreamer library GStreamer was compiled
against.
=item B<(major, minor, micro) = GStreamer-E<gt>version>
Returns the version information of the GStreamer library GStreamer is currently
running against.
=back
=head1 SEE ALSO
=over
=item L<GStreamer::index>
Lists the automatically generated API documentation pages.
=item L<http://gstreamer.freedesktop.org/>
GStreamer's website has much useful information, including a good tutorial and
of course the API reference, which is canonical for GStreamer as well.
=item L<Gtk2::api>
Just like Gtk2, GStreamer tries to stick closely to the C API, deviating from
it only when it makes things easier and/or more Perlish. L<Gtk2::api> gives
general rules for how to map from the C API to Perl, most of which also apply
to GStreamer.
=item L<Glib>
Glib is the foundation this binding is built upon. If you look for information
on basic stuff like signals or object properties, this is what you should read.
=item L<GStreamer1>
Perl bindings for version 1.x of the GStreamer C libraries. The two C
libraries, as well as their associated Perl modules, can be installed
concurrently on the same host.
=back
=head1 AUTHORS
=over
=item Torsten Schoenfeld E<lt>kaffeetisch at gmx dot deE<gt>
=item Brett Kosinski E<lt>brettk at frodo.dyn.gno dot orgE<gt>
=back
=head1 COPYRIGHT
Copyright (C) 2005-2011, 2013 by the gtk2-perl team
=cut
( run in 0.527 second using v1.01-cache-2.11-cpan-13bb782fe5a )