1GStreamer(3) User Contributed Perl Documentation GStreamer(3)
2
3
4
6 GStreamer - Perl interface to version 0.10.x of 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 NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
43
44 This module only works with the 0.10.x series of the GStreamer C
45 libraries. There is another Perl module, GStreamer1, that is intended
46 for the 1.x series of the GStreamer C libraries. GStreamer1 is located
47 at <https://metacpan.org/pod/GStreamer1>.
48
49 The two C libraries, as well as their associated Perl modules, can be
50 installed concurrently on the same host.
51
52 See the POD for GStreamer1 (<https://metacpan.org/pod/GStreamer1>) for
53 more information about that module.
54
55 NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
56
57 GStreamer makes everybody dance like crazy. It provides the means to
58 play, stream, and convert nearly any type of media -- be it audio or
59 video. GStreamer wraps version 0.10.x of the GStreamer C libraries in
60 a nice and Perlish way, freeing the programmer from any memory
61 management and object casting hassles.
62
64 GStreamer->init
65 Initializes GStreamer. Automatically parses @ARGV, stripping any
66 options known to GStreamer.
67
68 boolean = GStreamer->init_check
69 Checks if initialization is possible. Returns TRUE if so.
70
71 When importing GStreamer, you can pass the "-init" option to have
72 GStreamer->init automatically called for you. If you need to know if
73 initialization is possible without actually doing it, use
74 GStreamer->init_check.
75
77 boolean = GStreamer->CHECK_VERSION (major, minor, micro)
78 · major (integer)
79
80 · minor (integer)
81
82 · micro (integer)
83
84 Returns TRUE if the GStreamer library version GStreamer was
85 compiled against is newer than the one specified by the three
86 arguments.
87
88 (major, minor, micro) = GStreamer->GET_VERSION_INFO
89 Returns the version information of the GStreamer library GStreamer
90 was compiled against.
91
92 (major, minor, micro) = GStreamer->version
93 Returns the version information of the GStreamer library GStreamer
94 is currently running against.
95
97 GStreamer::index
98 Lists the automatically generated API documentation pages.
99
100 <http://gstreamer.freedesktop.org/>
101 GStreamer's website has much useful information, including a good
102 tutorial and of course the API reference, which is canonical for
103 GStreamer as well.
104
105 Gtk2::api
106 Just like Gtk2, GStreamer tries to stick closely to the C API,
107 deviating from it only when it makes things easier and/or more
108 Perlish. Gtk2::api gives general rules for how to map from the C
109 API to Perl, most of which also apply to GStreamer.
110
111 Glib
112 Glib is the foundation this binding is built upon. If you look for
113 information on basic stuff like signals or object properties, this
114 is what you should read.
115
116 GStreamer1
117 Perl bindings for version 1.x of the GStreamer C libraries. The
118 two C libraries, as well as their associated Perl modules, can be
119 installed concurrently on the same host.
120
122 Torsten Schoenfeld <kaffeetisch at gmx dot de>
123 Brett Kosinski <brettk at frodo.dyn.gno dot org>
124
126 Copyright (C) 2005-2011, 2013 by the gtk2-perl team
127
128
129
130perl v5.30.0 2019-09-19 GStreamer(3)