Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / docs / random / porting-to-0.11.txt
1 The 0.11 porting guide
2 ----------------------
3
4 * All deprecated methods were removed. Recompile against 0.10 with
5   DISABLE_DEPRECATED and fix issues before attempting to port to 0.11.
6
7 * GST_BOILERPLATE is gone, use G_DEFINE_TYPE instead.
8
9 * various methods take a gsize instead of a guint when talking about memory
10   sizes.
11
12 * multifdsink, tcpclientsink, tcpclientsrc, tcpserversrc the protocol property
13   is removed, use gdppay and gdpdepay.
14
15 * GstObject:
16     GST_OBJECT_DISPOSING flag removed
17     GST_OBJECT_IS_DISPOSING removed
18     GST_OBJECT_FLOATING flag remove, GstObject is now GInitiallyUnowned
19     GST_OBJECT_IS_FLOATING removed, use g_object_is_floating()
20
21     GST_CLASS_GET_LOCK, GST_CLASS_LOCK, GST_CLASS_TRYLOCK, GST_CLASS_UNLOCK,
22     used to be a workaround for thread-unsafe glib < 2.8
23
24     gst_object_ref_sink() has gpointer as result to make it more like the
25     GObject version.
26
27     gst_object_sink() removed, use gst_object_ref_sink() instead.
28
29     gst_class_signal_connect() removed, was only used for XML
30
31     parent-set and parent-unset signals removed. Use notify:parent. Currently
32     still disabled because of deep notify locking issues.
33
34 * GstElement:
35     GstElementDetails is removed and replaced with more generic metadata.
36
37     gst_element_class_set_details_simple() -> gst_element_class_set_metadata()
38     gst_element_class_set_documentation_uri -> gst_element_class_add_metadata
39     gst_element_class_set_icon_name -> gst_element_class_add_metadata
40
41     gst_element_factory_get_longname -> gst_element_factory_get_metadata
42     gst_element_factory_get_klass -> gst_element_factory_get_metadata
43     gst_element_factory_get_description -> gst_element_factory_get_metadata
44     gst_element_factory_get_author -> gst_element_factory_get_metadata
45     gst_element_factory_get_documentation_uri -> gst_element_factory_get_metadata
46     gst_element_factory_get_icon_name -> gst_element_factory_get_metadata
47
48     gstelementmetadata.h contains the keys for all standard metadata.
49
50     Element metadata and pad templates are inherited from parent classes and
51     should be added in class_init instead of base_init.
52
53     gst_element_class_add_pad_template() takes ownership of the template
54
55     Elements that change the duration must post DURATION messages on the
56     bus when the duration changes in PAUSED or PLAYING.
57
58 * GstPad:
59     gst_pad_get_caps() does not return writable caps anymore and an explicit
60     gst_caps_make_writable() needs to be performed. This was the functionality
61     of gst_pad_get_caps_reffed(), which is removed now.
62
63     A similar change was done for gst_pad_peer_get_caps() and
64     gst_pad_peer_get_caps_reffed()
65
66 * GstMiniObject
67     A miniobject is now a simple refcounted structure holding the information
68     common to buffers, events, messages, queries and caps.
69
70     There is no more GST_TYPE_MINIOBJECT as the type for subclasses.
71     G_TYPE_BOXED can be used as the type of all GstMiniObject based types such
72     as buffers, events, messages, caps, etc. Signals, for example, would use the
73     boxed type if the argument include GstMiniObject derived types.
74
75     gst_mini_object_new() is removed. You would allocate memory with the the
76     methods specific for the derived type.
77
78     GstParamSpecMiniObject is removed, use boxed param spec now with the GType
79     of the specific GstMiniObject derived type. Also
80     gst_param_spec_mini_object().
81
82     gst_param_spec_mini_object() -> g_param_spec_boxed()
83
84     The specific gst_value_*_mini_object() methods are removed, used the generic
85     boxed methods instead.
86
87     gst_value_set_mini_object() -> g_value_set_boxed()
88     gst_value_take_mini_object() -> g_value_take_boxed()
89     gst_value_take_get_object() -> g_value_get_boxed()
90     gst_value_take_dup_object() -> g_value_dup_boxed()
91
92     The GST_MINI_OBJECT_READONLY flag was removed as it used to mark the
93     memory in buffers as READONLY. Marking memory READONLY can now be done
94     with the GstMemory API. Writability of miniobjects is now only done by using
95     the refcount.
96
97 * GstBuffer
98     A GstBuffer is now a simple boxed type this means that subclassing is not
99     possible anymore. 
100
101     To add data to the buffer you would now use gst_buffer_take_memory() with
102     a GstMemory object containing the data. Multiple memory blocks can added to
103     a GstBuffer that can then be retrieved with gst_buffer_peek_memory().
104
105     GST_BUFFER_DATA(), GST_BUFFER_MALLOCDATA(), GST_BUFFER_FREE_FUNC() and
106     GST_BUFFER_SIZE() are gone, along with the fields in GstBuffer. Use the
107     memory API to get access to the buffer data. GST_BUFFER_SIZE() can be
108     replaced with gst_buffer_get_size() but if also access to the data is
109     required, gst_buffer_map() can return both the size and data in one go.
110
111     The most common way to access all the data in a buffer is by using
112     gst_buffer_map() and gst_buffer_unmap(). These calls require you to specify
113     the access mode required to the data and will automatically merge and return
114     a writable copy of the data.
115
116     The buffer must be writable (gst_buffer_is_writable()) in order to modify
117     the fields, metadata or buffer memory. gst_buffer_make_writable() will not
118     automatically make a writable copy of the memory but will instead increase
119     the refcount of the memory. The _map() and _peek_memory() methods will
120     automatically create writable copies when needed.
121     
122     gst_buffer_make_metadata_writable() is gone, you can replace this safely
123     with gst_buffer_make_writable().
124
125     gst_buffer_create_sub() is gone and can be safely replaced with
126     gst_buffer_copy_region(). 
127
128     Changing the size of the buffer data can be done with gst_buffer_resize(),
129     which will also update the metadata fields correctly. gst_buffer_set_size()
130     is #defined to a special case of gst_buffer_resize() with a 0 offset.
131
132     gst_buffer_try_new_and_alloc() is replaced with gst_buffer_new_and_alloc(),
133     which now returns NULL when memory allocation fails.
134
135 * GstBufferList
136     The GstBufferList object is much simplified because most of the
137     functionality in the groups is now part of the GstMemory in buffers.
138     
139     The object is reduced to encapsulating an array of buffers that you can send
140     with the regular gst_pad_push_list. The iterator is not needed anymore
141     because you can simply use gst_buffer_list_len() and gst_buffer_list_get()
142     to iterate the array.
143
144     For dealing with the groups, it's now needed to add the memory blocks to
145     GstBuffer and use the normal buffer API to get and merge the groups.
146
147 * GstEvent
148 * GstQuery
149     Boxed types derived from GstMiniObject.
150
151 * GstBufferList
152     Is now a boxed type derived from GstMiniObject.
153
154 * GstMessage
155     Is now a boxed type derived from GstMiniObject
156
157 * GstCaps
158     Is now a boxed type derived from GstMiniObject. 
159
160 * GstTypeFind
161     gst_type_find_peek() returns a const guin8 * now.
162
163 * GstAdapter
164     gst_adapter_peek() is removed, use gst_adapter_map() and gst_adapter_unmap()
165     to get access to raw data from the adapter.
166
167     Arguments renamed from guint to gsize.
168
169 * GstBitReader, GstByteReader, GstByteWriter
170     gst_*_reader_new_from_buffer(), gst_*_reader_init_from_buffer() removed, get
171     access to the buffer data with _map() and then use the _new() functions.
172
173     gst_byte_reader_new_from_buffer() and gst_byte_reader_init_from_buffer()
174     removed, get access to the buffer data and then use the _new() functions.
175
176 * GstCollectPads
177     gst_collect_pads_read() removed, use _read_buffer() or _take_buffer() and
178     then use the memory API to get to the memory.
179
180
181  
182