1GStreamer(3) User Contributed Perl Documentation GStreamer(3)
2
3
4
6 GStreamer - Perl interface to the GStreamer library
7
9 use GStreamer -init;
10
11 my $loop = Glib::MainLoop -> new();
12
13 # set up
14 my $play = GStreamer::ElementFactory -> make("playbin", "play");
15 $play -> set(uri => Glib::filename_to_uri $file, "localhost");
16 $play -> get_bus() -> add_watch(\&my_bus_callback, $loop);
17 $play -> set_state("playing");
18
19 # run
20 $loop -> run();
21
22 # clean up
23 $play -> set_state("null");
24
25 sub my_bus_callback {
26 my ($bus, $message, $loop) = @_;
27
28 if ($message -> type & "error") {
29 warn $message -> error;
30 $loop -> quit();
31 }
32
33 elsif ($message -> type & "eos") {
34 $loop -> quit();
35 }
36
37 # remove message from the queue
38 return TRUE;
39 }
40
42 GStreamer makes everybody dance like crazy. It provides the means to
43 play, stream, and convert nearly any type of media -- be it audio or
44 video. GStreamer wraps the GStreamer library in a nice and Perlish
45 way, freeing the programmer from any memory management and object cast‐
46 ing hassles.
47
49 GStreamer->init
50 Initializes GStreamer. Automatically parses @ARGV, stripping any
51 options known to GStreamer.
52
53 boolean = GStreamer->init_check
54 Checks if initialization is possible. Returns TRUE if so.
55
56 When importing GStreamer, you can pass the "-init" option to have
57 GStreamer->init automatically called for you. If you need to know if
58 initialization is possible without actually doing it, use
59 GStreamer->init_check.
60
62 boolean = GStreamer->CHECK_VERSION (major, minor, micro)
63 * major (integer)
64 * minor (integer)
65 * micro (integer)
66
67 Returns TRUE if the GStreamer library version GStreamer was com‐
68 piled against is newer than the one specified by the three argu‐
69 ments.
70
71 (major, minor, micro) = GStreamer->GET_VERSION_INFO
72 Returns the version information of the GStreamer library GStreamer
73 was compiled against.
74
75 (major, minor, micro) = GStreamer->version
76 Returns the version information of the GStreamer library GStreamer
77 is currently running against.
78
80 GStreamer::index
81 Lists the automatically generated API documentation pages.
82
83 <http://gstreamer.freedesktop.org/>
84 GStreamer's website has much useful information, including a good
85 tutorial and of course the API reference, which is canonical for
86 GStreamer as well.
87
88 Gtk2::api
89 Just like Gtk2, GStreamer tries to stick closely to the C API,
90 deviating from it only when it makes things easier and/or more
91 Perlish. Gtk2::api gives general rules for how to map from the C
92 API to Perl, most of which also apply to GStreamer.
93
94 Glib
95 Glib is the foundation this binding is built upon. If you look for
96 information on basic stuff like signals or object properties, this
97 is what you should read.
98
100 Torsten Schoenfeld <kaffeetisch at gmx dot de>
101 Brett Kosinski <brettk at frodo.dyn.gno dot org>
102
104 Copyright (C) 2005-2006 by the gtk2-perl team
105
106
107
108perl v5.8.8 2007-02-20 GStreamer(3)