gst: Add a filter caps parameter to all get_caps() functions
[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 * Presets and plugins moved to $XDG_DATA_HOME/gstreamer-0.11/ root
16   directory. Registry moved to $XDG_CACHE_HOME/gstreamer-0.11/.
17   XDG_CACHE_HOME usually points to $HOME/.cache and XDG_DATA_HOME
18   usually is $HOME/.local/share/.
19
20 * GstObject:
21     GST_OBJECT_DISPOSING flag removed
22     GST_OBJECT_IS_DISPOSING removed
23     GST_OBJECT_FLOATING flag remove, GstObject is now GInitiallyUnowned
24     GST_OBJECT_IS_FLOATING removed, use g_object_is_floating()
25
26     GST_CLASS_GET_LOCK, GST_CLASS_LOCK, GST_CLASS_TRYLOCK, GST_CLASS_UNLOCK,
27     used to be a workaround for thread-unsafe glib < 2.8
28
29     gst_object_ref_sink() has gpointer as result to make it more like the
30     GObject version.
31
32     gst_object_sink() removed, use gst_object_ref_sink() instead.
33
34     gst_class_signal_connect() removed, was only used for XML
35
36     parent-set and parent-unset signals removed. Use notify:parent. Currently
37     still disabled because of deep notify locking issues.
38
39 * GstElement:
40     GstElementDetails is removed and replaced with more generic metadata.
41
42     gst_element_class_set_details_simple() -> gst_element_class_set_metadata()
43     gst_element_class_set_documentation_uri -> gst_element_class_add_metadata
44     gst_element_class_set_icon_name -> gst_element_class_add_metadata
45
46     gst_element_factory_get_longname -> gst_element_factory_get_metadata
47     gst_element_factory_get_klass -> gst_element_factory_get_metadata
48     gst_element_factory_get_description -> gst_element_factory_get_metadata
49     gst_element_factory_get_author -> gst_element_factory_get_metadata
50     gst_element_factory_get_documentation_uri -> gst_element_factory_get_metadata
51     gst_element_factory_get_icon_name -> gst_element_factory_get_metadata
52
53     gstelementmetadata.h contains the keys for all standard metadata.
54
55     Element metadata and pad templates are inherited from parent classes and
56     should be added in class_init instead of base_init.
57
58     gst_element_class_add_pad_template() takes ownership of the template
59
60     Elements that change the duration must post DURATION messages on the
61     bus when the duration changes in PAUSED or PLAYING.
62
63     gst_element_lost_state_full() -> gst_element_lost_state()
64     gst_element_lost_state() -> gst_element_lost_state(, TRUE)
65
66     request_new_pad_full() -> request_new_pad()
67
68 * GstPad:
69     gst_pad_get_caps() does not return writable caps anymore and an explicit
70     gst_caps_make_writable() needs to be performed. This was the functionality
71     of gst_pad_get_caps_reffed(), which is removed now.
72
73     A similar change was done for gst_pad_peer_get_caps() and
74     gst_pad_peer_get_caps_reffed()
75
76     gst_pad_set_bufferalloc_function(), gst_pad_alloc_buffer() and
77     gst_pad_alloc_buffer_and_set_caps() are removed. Use the ALLOCATION query
78     now to obtain a reference to a bufferpool object that can be used to
79     allocate buffers.
80
81     removed sched_private, it should not be used, use g_object_set_qdata() or
82     use element_private.
83
84     Removed GST_PAD_CAPS() use gst_pad_get_current_caps() to get a handle to the
85     currently configured caps.
86
87     GstPadGetCapsFunction, gst_pad_get_caps(), gst_pad_peer_get_caps(),
88     gst_pad_proxy_getcaps() now takes a GstCaps* parameter to inform
89     the other side about the possible caps and preferences.
90
91 * GstMiniObject
92     A miniobject is now a simple refcounted structure holding the information
93     common to buffers, events, messages, queries and caps.
94
95     There is no more GST_TYPE_MINIOBJECT as the type for subclasses.
96     G_TYPE_BOXED can be used as the type of all GstMiniObject based types such
97     as buffers, events, messages, caps, etc. Signals, for example, would use the
98     boxed type if the argument include GstMiniObject derived types.
99
100     gst_mini_object_new() is removed. You would allocate memory with the the
101     methods specific for the derived type.
102
103     GstParamSpecMiniObject is removed, use boxed param spec now with the GType
104     of the specific GstMiniObject derived type. Also
105     gst_param_spec_mini_object().
106
107     gst_param_spec_mini_object() -> g_param_spec_boxed()
108
109     The specific gst_value_*_mini_object() methods are removed, used the generic
110     boxed methods instead.
111
112     gst_value_set_mini_object() -> g_value_set_boxed()
113     gst_value_take_mini_object() -> g_value_take_boxed()
114     gst_value_take_get_object() -> g_value_get_boxed()
115     gst_value_take_dup_object() -> g_value_dup_boxed()
116
117     The GST_MINI_OBJECT_READONLY flag was removed as it used to mark the
118     memory in buffers as READONLY. Marking memory READONLY can now be done
119     with the GstMemory API. Writability of miniobjects is now only done by using
120     the refcount.
121
122 * GstBuffer
123     A GstBuffer is now a simple boxed type this means that subclassing is not
124     possible anymore. 
125
126     To add data to the buffer you would now use gst_buffer_take_memory() with
127     a GstMemory object containing the data. Multiple memory blocks can added to
128     a GstBuffer that can then be retrieved with gst_buffer_peek_memory().
129
130     GST_BUFFER_DATA(), GST_BUFFER_MALLOCDATA(), GST_BUFFER_FREE_FUNC() and
131     GST_BUFFER_SIZE() are gone, along with the fields in GstBuffer. Use the
132     memory API to get access to the buffer data. GST_BUFFER_SIZE() can be
133     replaced with gst_buffer_get_size() but if also access to the data is
134     required, gst_buffer_map() can return both the size and data in one go.
135
136     The most common way to access all the data in a buffer is by using
137     gst_buffer_map() and gst_buffer_unmap(). These calls require you to specify
138     the access mode required to the data and will automatically merge and return
139     a writable copy of the data.
140
141     The buffer must be writable (gst_buffer_is_writable()) in order to modify
142     the fields, metadata or buffer memory. gst_buffer_make_writable() will not
143     automatically make a writable copy of the memory but will instead increase
144     the refcount of the memory. The _map() and _peek_memory() methods will
145     automatically create writable copies when needed.
146     
147     gst_buffer_make_metadata_writable() is gone, you can replace this safely
148     with gst_buffer_make_writable().
149
150     gst_buffer_create_sub() is gone and can be safely replaced with
151     gst_buffer_copy_region(). 
152
153     Changing the size of the buffer data can be done with gst_buffer_resize(),
154     which will also update the metadata fields correctly. gst_buffer_set_size()
155     is #defined to a special case of gst_buffer_resize() with a 0 offset.
156
157     gst_buffer_try_new_and_alloc() is replaced with gst_buffer_new_and_alloc(),
158     which now returns NULL when memory allocation fails.
159
160     GST_BUFFER_CAPS() is gone, caps are not set on buffers anymore but are set
161     on the pads where the buffer is pushed on. Likewise GST_BUFFER_COPY_CAPS is
162     not needed anymore. gst_buffer_get/set_caps() are gone too.
163
164 * GstBufferList
165     The GstBufferList object is much simplified because most of the
166     functionality in the groups is now part of the GstMemory in buffers.
167     
168     The object is reduced to encapsulating an array of buffers that you can send
169     with the regular gst_pad_push_list. The iterator is not needed anymore
170     because you can simply use gst_buffer_list_len() and gst_buffer_list_get()
171     to iterate the array.
172
173     For dealing with the groups, it's now needed to add the memory blocks to
174     GstBuffer and use the normal buffer API to get and merge the groups.
175
176 * GstEvent
177     GST_EVENT_SRC is removed. Don't use this anymore.
178
179     gst_event_new_new_segment_full() -> gst_event_new_new_segment()
180     gst_event_parse_new_segment_full() -> gst_event_parse_new_segment()
181
182     gst_event_new_qos_full() -> gst_event_new_qos()
183     gst_event_parse_qos_full() -> gst_event_parse_qos()
184
185     The GstStructure is removed from the public API, use the getters to get
186     a handle to a GstStructure.
187
188 * GstQuery
189     Boxed types derived from GstMiniObject.
190
191     The GstStructure is removed from the public API, use the getters to get
192     a handle to a GstStructure.
193
194 * GstBufferList
195     Is now a boxed type derived from GstMiniObject.
196
197 * GstMessage
198     Is now a boxed type derived from GstMiniObject
199
200     The GstStructure is removed from the public API, use the getters to get
201     a handle to a GstStructure.
202
203 * GstCaps
204     Is now a boxed type derived from GstMiniObject. 
205
206 * GstSegment
207     abs_rate was removed from the public fields, it can be trivially calculated
208     from the rate field.
209
210 * GstTypeFind
211     gst_type_find_peek() returns a const guin8 * now.
212
213 * GstAdapter
214     gst_adapter_peek() is removed, use gst_adapter_map() and gst_adapter_unmap()
215     to get access to raw data from the adapter.
216
217     Arguments renamed from guint to gsize.
218
219 * GstBitReader, GstByteReader, GstByteWriter
220     gst_*_reader_new_from_buffer(), gst_*_reader_init_from_buffer() removed, get
221     access to the buffer data with _map() and then use the _new() functions.
222
223     gst_byte_reader_new_from_buffer() and gst_byte_reader_init_from_buffer()
224     removed, get access to the buffer data and then use the _new() functions.
225
226 * GstCollectPads
227     gst_collect_pads_read() removed, use _read_buffer() or _take_buffer() and
228     then use the memory API to get to the memory.
229
230
231  
232