gstreamer/docs/random/porting-to-0.11.txt
Sebastian Dröge 7295f3e2f6 basetransform: Pass the complete caps to transform_caps
Instead of passing it structure by structure. This allows
better optimized transform_caps functions and allows better
transformation decisions.

See bug #619844.
2011-05-27 11:37:24 +02:00

255 lines
10 KiB
Text

The 0.11 porting guide
----------------------
* All deprecated methods were removed. Recompile against 0.10 with
DISABLE_DEPRECATED and fix issues before attempting to port to 0.11.
* GST_BOILERPLATE is gone, use G_DEFINE_TYPE instead.
* various methods take a gsize instead of a guint when talking about memory
sizes.
* multifdsink, tcpclientsink, tcpclientsrc, tcpserversrc the protocol property
is removed, use gdppay and gdpdepay.
* Presets and plugins moved to $XDG_DATA_HOME/gstreamer-0.11/ root
directory. Registry moved to $XDG_CACHE_HOME/gstreamer-0.11/.
XDG_CACHE_HOME usually points to $HOME/.cache and XDG_DATA_HOME
usually is $HOME/.local/share/.
* GstObject:
GST_OBJECT_DISPOSING flag removed
GST_OBJECT_IS_DISPOSING removed
GST_OBJECT_FLOATING flag remove, GstObject is now GInitiallyUnowned
GST_OBJECT_IS_FLOATING removed, use g_object_is_floating()
GST_CLASS_GET_LOCK, GST_CLASS_LOCK, GST_CLASS_TRYLOCK, GST_CLASS_UNLOCK,
used to be a workaround for thread-unsafe glib < 2.8
gst_object_ref_sink() has gpointer as result to make it more like the
GObject version.
gst_object_sink() removed, use gst_object_ref_sink() instead.
gst_class_signal_connect() removed, was only used for XML
parent-set and parent-unset signals removed. Use notify:parent. Currently
still disabled because of deep notify locking issues.
* GstElement:
GstElementDetails is removed and replaced with more generic metadata.
gst_element_class_set_details_simple() -> gst_element_class_set_metadata()
gst_element_class_set_documentation_uri -> gst_element_class_add_metadata
gst_element_class_set_icon_name -> gst_element_class_add_metadata
gst_element_factory_get_longname -> gst_element_factory_get_metadata
gst_element_factory_get_klass -> gst_element_factory_get_metadata
gst_element_factory_get_description -> gst_element_factory_get_metadata
gst_element_factory_get_author -> gst_element_factory_get_metadata
gst_element_factory_get_documentation_uri -> gst_element_factory_get_metadata
gst_element_factory_get_icon_name -> gst_element_factory_get_metadata
gstelementmetadata.h contains the keys for all standard metadata.
Element metadata and pad templates are inherited from parent classes and
should be added in class_init instead of base_init.
gst_element_class_add_pad_template() takes ownership of the template
Elements that change the duration must post DURATION messages on the
bus when the duration changes in PAUSED or PLAYING.
gst_element_lost_state_full() -> gst_element_lost_state()
gst_element_lost_state() -> gst_element_lost_state(, TRUE)
request_new_pad_full() -> request_new_pad()
* GstPad:
gst_pad_get_caps() does not return writable caps anymore and an explicit
gst_caps_make_writable() needs to be performed. This was the functionality
of gst_pad_get_caps_reffed(), which is removed now.
A similar change was done for gst_pad_peer_get_caps() and
gst_pad_peer_get_caps_reffed()
gst_pad_set_bufferalloc_function(), gst_pad_alloc_buffer() and
gst_pad_alloc_buffer_and_set_caps() are removed. Use the ALLOCATION query
now to obtain a reference to a bufferpool object that can be used to
allocate buffers.
removed sched_private, it should not be used, use g_object_set_qdata() or
use element_private.
Removed GST_PAD_CAPS() use gst_pad_get_current_caps() to get a handle to the
currently configured caps.
GstPadGetCapsFunction, gst_pad_get_caps(), gst_pad_peer_get_caps(),
gst_pad_proxy_getcaps() now takes a GstCaps* parameter to inform
the other side about the possible caps and preferences.
gst_pad_get_pad_template_caps() and gst_pad_get_pad_template()
return a new reference of the caps or template now and the return
value needs to be unreffed after usage.
* GstPadTemplate
gst_pad_template_get_caps() returns a new reference of the caps
and the return value needs to be unreffed after usage.
gst_pad_template_new() does not take ownership of the caps anymore.
GstPadTemplate is now created with a floating ref and
gst_element_class_add_pad_template() takes ownership of this floating ref.
GstPadTemplate instances are considered immutable and must not be
changed.
* GstMiniObject
A miniobject is now a simple refcounted structure holding the information
common to buffers, events, messages, queries and caps.
There is no more GST_TYPE_MINIOBJECT as the type for subclasses.
G_TYPE_BOXED can be used as the type of all GstMiniObject based types such
as buffers, events, messages, caps, etc. Signals, for example, would use the
boxed type if the argument include GstMiniObject derived types.
gst_mini_object_new() is removed. You would allocate memory with the the
methods specific for the derived type.
GstParamSpecMiniObject is removed, use boxed param spec now with the GType
of the specific GstMiniObject derived type. Also
gst_param_spec_mini_object().
gst_param_spec_mini_object() -> g_param_spec_boxed()
The specific gst_value_*_mini_object() methods are removed, used the generic
boxed methods instead.
gst_value_set_mini_object() -> g_value_set_boxed()
gst_value_take_mini_object() -> g_value_take_boxed()
gst_value_take_get_object() -> g_value_get_boxed()
gst_value_take_dup_object() -> g_value_dup_boxed()
The GST_MINI_OBJECT_READONLY flag was removed as it used to mark the
memory in buffers as READONLY. Marking memory READONLY can now be done
with the GstMemory API. Writability of miniobjects is now only done by using
the refcount.
* GstBuffer
A GstBuffer is now a simple boxed type this means that subclassing is not
possible anymore.
To add data to the buffer you would now use gst_buffer_take_memory() with
a GstMemory object containing the data. Multiple memory blocks can added to
a GstBuffer that can then be retrieved with gst_buffer_peek_memory().
GST_BUFFER_DATA(), GST_BUFFER_MALLOCDATA(), GST_BUFFER_FREE_FUNC() and
GST_BUFFER_SIZE() are gone, along with the fields in GstBuffer. Use the
memory API to get access to the buffer data. GST_BUFFER_SIZE() can be
replaced with gst_buffer_get_size() but if also access to the data is
required, gst_buffer_map() can return both the size and data in one go.
The most common way to access all the data in a buffer is by using
gst_buffer_map() and gst_buffer_unmap(). These calls require you to specify
the access mode required to the data and will automatically merge and return
a writable copy of the data.
The buffer must be writable (gst_buffer_is_writable()) in order to modify
the fields, metadata or buffer memory. gst_buffer_make_writable() will not
automatically make a writable copy of the memory but will instead increase
the refcount of the memory. The _map() and _peek_memory() methods will
automatically create writable copies when needed.
gst_buffer_make_metadata_writable() is gone, you can replace this safely
with gst_buffer_make_writable().
gst_buffer_create_sub() is gone and can be safely replaced with
gst_buffer_copy_region().
Changing the size of the buffer data can be done with gst_buffer_resize(),
which will also update the metadata fields correctly. gst_buffer_set_size()
is #defined to a special case of gst_buffer_resize() with a 0 offset.
gst_buffer_try_new_and_alloc() is replaced with gst_buffer_new_and_alloc(),
which now returns NULL when memory allocation fails.
GST_BUFFER_CAPS() is gone, caps are not set on buffers anymore but are set
on the pads where the buffer is pushed on. Likewise GST_BUFFER_COPY_CAPS is
not needed anymore. gst_buffer_get/set_caps() are gone too.
* GstBufferList
The GstBufferList object is much simplified because most of the
functionality in the groups is now part of the GstMemory in buffers.
The object is reduced to encapsulating an array of buffers that you can send
with the regular gst_pad_push_list. The iterator is not needed anymore
because you can simply use gst_buffer_list_len() and gst_buffer_list_get()
to iterate the array.
For dealing with the groups, it's now needed to add the memory blocks to
GstBuffer and use the normal buffer API to get and merge the groups.
* GstEvent
GST_EVENT_SRC is removed. Don't use this anymore.
gst_event_new_new_segment_full() -> gst_event_new_new_segment()
gst_event_parse_new_segment_full() -> gst_event_parse_new_segment()
gst_event_new_qos_full() -> gst_event_new_qos()
gst_event_parse_qos_full() -> gst_event_parse_qos()
The GstStructure is removed from the public API, use the getters to get
a handle to a GstStructure.
* GstQuery
Boxed types derived from GstMiniObject.
The GstStructure is removed from the public API, use the getters to get
a handle to a GstStructure.
* GstBufferList
Is now a boxed type derived from GstMiniObject.
* GstMessage
Is now a boxed type derived from GstMiniObject
The GstStructure is removed from the public API, use the getters to get
a handle to a GstStructure.
* GstCaps
Is now a boxed type derived from GstMiniObject.
* GstSegment
abs_rate was removed from the public fields, it can be trivially calculated
from the rate field.
* GstTypeFind
gst_type_find_peek() returns a const guin8 * now.
* GstAdapter
gst_adapter_peek() is removed, use gst_adapter_map() and gst_adapter_unmap()
to get access to raw data from the adapter.
Arguments renamed from guint to gsize.
* GstBitReader, GstByteReader, GstByteWriter
gst_*_reader_new_from_buffer(), gst_*_reader_init_from_buffer() removed, get
access to the buffer data with _map() and then use the _new() functions.
gst_byte_reader_new_from_buffer() and gst_byte_reader_init_from_buffer()
removed, get access to the buffer data and then use the _new() functions.
* GstCollectPads
gst_collect_pads_read() removed, use _read_buffer() or _take_buffer() and
then use the memory API to get to the memory.
* GstBaseSrc, GstBaseTransform, GstBaseSink
GstBaseSrc::get_caps(), GstBaseTransform::transform_caps() and
GstBaseSink::get_caps() now take a filter GstCaps* parameter to
filter the caps and allow better negotiation decisions.
* GstBaseTransform
GstBaseTransform::transform_caps() now gets the complete caps passed
instead of getting it passed structure by structure.