1 <chapter id="chapter-porting">
2 <title>Porting 0.8 applications to 0.9</title>
4 This section of the appendix will discuss shortly what changes to
5 applications will be needed to quickly and conveniently port most
6 applications from &GStreamer;-0.8 to &GStreamer;-0.9, with references
7 to the relevant sections in this Application Development Manual
8 where needed. With this list, it should be possible to port simple
9 applications to &GStreamer;-0.9 in less than a day.
12 <sect1 id="section-porting-objects">
13 <title>List of changes</title>
17 Most functions returning an object or an object property have
18 been changed to return its own reference rather than a constant
19 reference of the one owned by the object itself. The reason for
20 this change is primarily threadsafety. This means, effectively,
21 that return values of functions such as
22 <function>gst_element_get_pad ()</function>,
23 <function>gst_pad_get_name ()</function> and many more like these
24 have to be free'ed or unreferenced after use. Check the API
25 references of each function to know for sure whether return
26 values should be free'ed or not.
31 Applications should no longer use signal handlers to be notified
32 of errors, end-of-stream and other similar pipeline events.
33 Instead, they should use the <classname>GstBus</classname>, which
34 has been discussed in <xref linkend="chapter-bus"/>. The bus will
35 take care that the messages will be delivered in the context of
36 mainloop, which is almost certainly the application's main thread.
37 The big advantage of this is that applications no longer need to
38 be thread-aware; they don't need to use <function>g_idle_add
39 ()</function> in the signal handler and do the actual real work
40 in the idle-callback. &GStreamer; now does all that internally.
45 Related to this, <function>gst_bin_iterate ()</function> has been
46 removed. Pipelines will iterate in their own thread, and applications
47 can simply run a <classname>GMainLoop</classname> (or call the
48 mainloop of their UI toolkit, such as <function>gtk_main
54 State changes can be delayed; ASYNC.
59 In 0.8, events and queries had to manually be sent to sinks in
60 pipelines (unless you were using playbin). This is no longer
61 the case in 0.9. In 0.9, queries and events can be sent to
62 toplevel pipelines, and the pipeline will do the dispatching
63 internally for you. This means less bookkeeping in your
64 application. For a short code example, see <xref
65 linkend="chapter-queryevents"/>. Related, seeking is now
66 threadsafe, and your video output will show the new video
67 position's frame while seeking, providing a better user
73 The <classname>GstThread</classname> object has been removed.
74 Applications can now simply put elements in a pipeline with
75 optionally some <quote>queue</quote> elements in between for
76 buffering, and &GStreamer; will take care of creating threads
77 internally. It is still possible to have parts of a pipeline
78 run in different threads than others, by using the
79 <quote>queue</quote> element. See <xref linkend="chapter-threads"/>
85 Filtered caps -> caps-filter.
90 libgstgconf-0.9.la does not exist. Use the
91 <quote>gconfvideosink</quote> and <quote>gconfaudiosink</quote>
92 elements instead, which will do live-updates and require no library