gst_bin_add_many
gst_bin_remove_many
gst_bin_find_unlinked_pad
-gst_bin_find_unconnected_pad
<SUBSECTION>
GstBinFlags
GST_BUFFER_FLAG_SET
GST_BUFFER_FLAG_UNSET
-GST_BUFFER_DATA
-GST_BUFFER_MALLOCDATA
-GST_BUFFER_FREE_FUNC
-GST_BUFFER_SIZE
+GST_BUFFER_CAPS
+
GST_BUFFER_TIMESTAMP
GST_BUFFER_DURATION
-GST_BUFFER_CAPS
GST_BUFFER_OFFSET
GST_BUFFER_OFFSET_END
GST_BUFFER_OFFSET_NONE
gst_buffer_new
gst_buffer_new_and_alloc
-gst_buffer_try_new_and_alloc
gst_buffer_ref
gst_buffer_unref
-gst_buffer_set_data
-gst_buffer_copy
+gst_buffer_get_size
+gst_buffer_resize
+gst_buffer_set_size
+gst_buffer_n_memory
+gst_buffer_take_memory
+gst_buffer_peek_memory
+gst_buffer_remove_memory
+gst_buffer_remove_memory_range
+
+gst_buffer_map
+gst_buffer_unmap
+
+gst_buffer_extract
+gst_buffer_fill
+
+GST_BUFFER_COPY_METADATA
GST_BUFFER_COPY_ALL
-gst_buffer_copy_metadata
+gst_buffer_copy
+gst_buffer_copy_into
+gst_buffer_copy_region
+
gst_buffer_is_writable
gst_buffer_make_writable
-gst_buffer_is_metadata_writable
-gst_buffer_make_metadata_writable
gst_buffer_replace
gst_buffer_get_caps
gst_buffer_set_caps
-gst_buffer_create_sub
gst_buffer_is_span_fast
gst_buffer_span
-gst_buffer_stamp
-gst_buffer_join
-gst_buffer_merge
+gst_buffer_get_meta
+gst_buffer_add_meta
+gst_buffer_remove_meta
+gst_buffer_iterate_meta
<SUBSECTION Standard>
GstBufferClass
GST_BUFFER
-GST_BUFFER_CLASS
-GST_BUFFER_GET_CLASS
GST_IS_BUFFER
-GST_IS_BUFFER_CLASS
GST_TYPE_BUFFER
GST_TYPE_BUFFER_FLAG
GST_TYPE_BUFFER_COPY_FLAGS
GST_BUFFER_CAST
<SUBSECTION Private>
-gst_buffer_get_type
gst_buffer_flag_get_type
gst_buffer_copy_flags_get_type
</SECTION>
<SECTION>
+<FILE>gstmeta</FILE>
+<TITLE>GstMeta</TITLE>
+GstMeta
+GstMetaInfo
+GST_META_TRACE_NAME
+GstMetaInitFunction
+GstMetaFreeFunction
+GstMetaCopyFunction
+GstMetaSubFunction
+GstMetaSerializeFunction
+GstMetaDeserializeFunction
+gst_meta_register
+gst_meta_get_info
+</SECTION>
+
+
+<SECTION>
+<FILE>gstbufferpool</FILE>
+<TITLE>GstBufferPool</TITLE>
+GstBufferPool
+GstBufferPoolClass
+GstBufferPoolFlags
+GstBufferPoolParams
+gst_buffer_pool_new
+
+gst_buffer_pool_config_get
+gst_buffer_pool_config_set
+
+gst_buffer_pool_get_config
+gst_buffer_pool_set_config
+
+gst_buffer_pool_set_active
+
+gst_buffer_pool_acquire_buffer
+gst_buffer_pool_release_buffer
+<SUBSECTION Standard>
+GST_BUFFER_POOL_CLASS
+GST_BUFFER_POOL_CAST
+GST_BUFFER_POOL_TRACE_NAME
+GstBufferPoolPrivate
+GST_BUFFER_POOL
+GST_IS_BUFFER_POOL
+GST_TYPE_BUFFER_POOL
+gst_buffer_pool_get_type
+gst_buffer_pool_flags_get_type
+GST_IS_BUFFER_POOL_CLASS
+GST_BUFFER_POOL_GET_CLASS
+</SECTION>
+
+<SECTION>
<FILE>gstbufferlist</FILE>
<TITLE>GstBufferList</TITLE>
GstBufferList
-GstBufferListIterator
-GstBufferListDoFunction
gst_buffer_list_new
+gst_buffer_list_sized_new
+gst_buffer_list_len
+gst_buffer_list_add
+gst_buffer_list_insert
+gst_buffer_list_remove
+
gst_buffer_list_ref
gst_buffer_list_unref
gst_buffer_list_copy
gst_buffer_list_is_writable
gst_buffer_list_make_writable
-gst_buffer_list_n_groups
-
-GstBufferListItem
GstBufferListFunc
gst_buffer_list_foreach
gst_buffer_list_get
-gst_buffer_list_iterate
-gst_buffer_list_iterator_free
-gst_buffer_list_iterator_n_buffers
-gst_buffer_list_iterator_add
-gst_buffer_list_iterator_add_group
-gst_buffer_list_iterator_add_list
-gst_buffer_list_iterator_next
-gst_buffer_list_iterator_next_group
-gst_buffer_list_iterator_remove
-gst_buffer_list_iterator_steal
-gst_buffer_list_iterator_take
-gst_buffer_list_iterator_do
-gst_buffer_list_iterator_merge_group
<SUBSECTION Standard>
-GstBufferListClass
GST_BUFFER_LIST
-GST_BUFFER_LIST_CLASS
-GST_BUFFER_LIST_GET_CLASS
GST_IS_BUFFER_LIST
-GST_IS_BUFFER_LIST_CLASS
GST_TYPE_BUFFER_LIST
GST_BUFFER_LIST_CAST
-GST_TYPE_BUFFER_LIST_ITEM
-GST_TYPE_BUFFER_LIST_ITERATOR
<SUBSECTION Private>
-gst_buffer_list_item_get_type
-gst_buffer_list_iterator_get_type
gst_buffer_list_get_type
</SECTION>
GST_STATIC_CAPS_ANY
GST_STATIC_CAPS_NONE
GST_CAPS_IS_SIMPLE
-GST_DEBUG_CAPS
GST_STATIC_CAPS
gst_caps_new_empty
gst_caps_is_equal_fixed
gst_caps_is_always_compatible
gst_caps_is_subset
+ gst_caps_is_subset_structure
gst_caps_can_intersect
gst_caps_intersect
gst_caps_intersect_full
gst_caps_union
gst_caps_normalize
gst_caps_do_simplify
-gst_caps_save_thyself
-gst_caps_load_thyself
gst_caps_replace
gst_caps_to_string
gst_caps_from_string
<FILE>gstcompat</FILE>
<TITLE>GstCompat</TITLE>
<SUBSECTION Standard>
+gst_element_class_set_details_simple
+gst_element_factory_get_author
+gst_element_factory_get_description
+gst_element_factory_get_documentation_uri
+gst_element_factory_get_icon_name
+gst_element_factory_get_klass
+gst_element_factory_get_longname
<SUBSECTION Private>
</SECTION>
gst_element_class_get_pad_template
gst_element_class_get_pad_template_list
gst_element_class_install_std_props
-gst_element_class_set_details
-gst_element_class_set_details_simple
-gst_element_class_set_documentation_uri
-gst_element_class_set_icon_name
+gst_element_class_set_metadata
+gst_element_class_add_metadata
<SUBSECTION element-pads>
gst_element_add_pad
-gst_element_get_pad
gst_element_create_all_pads
gst_element_get_compatible_pad
gst_element_get_compatible_pad_template
<FILE>gstelementfactory</FILE>
<TITLE>GstElementFactory</TITLE>
GstElementFactory
-GstElementDetails
-GST_ELEMENT_DETAILS
-GST_IS_ELEMENT_DETAILS
gst_element_register
gst_element_factory_find
gst_element_factory_get_element_type
-gst_element_factory_get_longname
-gst_element_factory_get_klass
-gst_element_factory_get_description
-gst_element_factory_get_author
-gst_element_factory_get_documentation_uri
-gst_element_factory_get_icon_name
+gst_element_factory_get_metadata
gst_element_factory_get_num_pad_templates
gst_element_factory_get_uri_type
gst_element_factory_get_uri_protocols
gst_event_new_sink_message
gst_event_parse_sink_message
+
+gst_event_new_reconfigure
<SUBSECTION Standard>
GstEventClass
GST_EVENT
gst_proxy_pad_event_default
gst_proxy_pad_query_default
gst_proxy_pad_iterate_internal_links_default
-gst_proxy_pad_bufferalloc_default
gst_proxy_pad_chain_default
gst_proxy_pad_chain_list_default
gst_proxy_pad_getrange_default
GstIteratorItem
GstIteratorResult
-GstIteratorDisposeFunction
+GstIteratorCopyFunction
GstIteratorNextFunction
GstIteratorItemFunction
GstIteratorResyncFunction
GstIteratorFreeFunction
+GstIteratorForeachFunction
GstIteratorFoldFunction
-GstCopyFunction
GST_ITERATOR
GST_ITERATOR_LOCK
gst_iterator_new_list
gst_iterator_new_single
+gst_iterator_copy
+gst_iterator_free
+
gst_iterator_next
gst_iterator_resync
-gst_iterator_free
gst_iterator_push
gst_iterator_filter
gst_iterator_fold
GST_TYPE_ITERATOR_ITEM
GST_TYPE_ITERATOR_RESULT
<SUBSECTION Private>
+gst_iterator_get_type
gst_iterator_item_get_type
gst_iterator_result_get_type
</SECTION>
<SECTION>
+<FILE>gstmemory</FILE>
+<TITLE>GstMemory</TITLE>
+GstMemory
+GstMemoryInfo
+GstMemoryImpl
+GST_MEMORY_IS_WRITABLE
+GstMemoryFlags
+GstMapFlags
+GST_MAP_READWRITE
+GstMemoryGetSizesFunction
+GstMemoryResizeFunction
+GstMemoryMapFunction
+GstMemoryUnmapFunction
+GstMemoryFreeFunction
+GstMemoryCopyFunction
+GstMemoryShareFunction
+GstMemoryIsSpanFunction
+gst_memory_new_wrapped
+gst_memory_new_alloc
+gst_memory_new_copy
+
+gst_memory_ref
+gst_memory_unref
+
+gst_memory_get_sizes
+gst_memory_resize
+
+gst_memory_map
+gst_memory_unmap
+
+gst_memory_copy
+gst_memory_share
+
+gst_memory_is_span
+gst_memory_span
+
+gst_memory_register
+gst_memory_get_info
+<SUBSECTION Standard>
+GST_MEMORY_TRACE_NAME
+gst_map_flags_get_type
+gst_memory_flags_get_type
+</SECTION>
+
+<SECTION>
<FILE>gstmessage</FILE>
<TITLE>GstMessage</TITLE>
GstMessage
GstMiniObject
GstMiniObjectFlags
GstMiniObjectCopyFunction
-GstMiniObjectFinalizeFunction
+GstMiniObjectDisposeFunction
+GstMiniObjectFreeFunction
GstMiniObjectWeakNotify
+GST_MINI_OBJECT_TYPE
GST_MINI_OBJECT_FLAGS
GST_MINI_OBJECT_FLAG_IS_SET
GST_MINI_OBJECT_FLAG_SET
GST_MINI_OBJECT_FLAG_UNSET
GST_MINI_OBJECT_REFCOUNT
GST_MINI_OBJECT_REFCOUNT_VALUE
+GST_MINI_OBJECT_SIZE
+
+gst_mini_object_register
+gst_mini_object_init
-gst_mini_object_new
gst_mini_object_copy
gst_mini_object_is_writable
gst_mini_object_make_writable
gst_mini_object_ref
gst_mini_object_unref
-gst_mini_object_replace
gst_mini_object_weak_ref
gst_mini_object_weak_unref
-GstParamSpecMiniObject
-gst_param_spec_mini_object
-
-gst_value_set_mini_object
-gst_value_take_mini_object
-gst_value_get_mini_object
-gst_value_dup_mini_object
+gst_mini_object_replace
<SUBSECTION Standard>
-GstMiniObjectClass
GST_MINI_OBJECT
-GST_IS_MINI_OBJECT
-GST_MINI_OBJECT_CLASS
-GST_IS_MINI_OBJECT_CLASS
-GST_MINI_OBJECT_GET_CLASS
-GST_TYPE_MINI_OBJECT
+GST_IS_MINI_OBJECT_TYPE
GST_TYPE_MINI_OBJECT_FLAGS
GST_MINI_OBJECT_CAST
GST_MINI_OBJECT_CONST_CAST
-GST_IS_PARAM_SPEC_MINI_OBJECT
-GST_PARAM_SPEC_MINI_OBJECT
-GST_TYPE_PARAM_MINI_OBJECT
<SUBSECTION Private>
-gst_mini_object_get_type
gst_mini_object_flags_get_type
-gst_param_spec_mini_object_get_type
</SECTION>
GST_OBJECT_FLAG_UNSET
GST_OBJECT_NAME
GST_OBJECT_PARENT
-GST_OBJECT_IS_DISPOSING
-GST_OBJECT_IS_FLOATING
GST_OBJECT_REFCOUNT
GST_OBJECT_REFCOUNT_VALUE
-GST_CLASS_GET_LOCK
-GST_CLASS_LOCK
-GST_CLASS_TRYLOCK
-GST_CLASS_UNLOCK
GST_OBJECT_LOCK
GST_OBJECT_TRYLOCK
GST_OBJECT_UNLOCK
gst_object_set_parent
gst_object_get_parent
gst_object_unparent
-gst_object_get_name_prefix
-gst_object_set_name_prefix
gst_object_default_deep_notify
gst_object_default_error
gst_object_check_uniqueness
gst_object_has_ancestor
-gst_object_save_thyself
-gst_object_restore_thyself
gst_object_ref
gst_object_unref
gst_object_ref_sink
-gst_object_sink
gst_object_replace
gst_object_get_path_string
-gst_class_signal_connect
-gst_class_signal_emit_by_name
<SUBSECTION Standard>
GST_OBJECT
GST_IS_OBJECT
<SUBSECTION Private>
gst_object_get_type
gst_object_flags_get_type
-GstXmlNodePtr
</SECTION>
gst_pad_new_from_template
gst_pad_new_from_static_template
-gst_pad_alloc_buffer
-gst_pad_alloc_buffer_and_set_caps
-gst_pad_set_bufferalloc_function
-GstPadBufferAllocFunction
-
gst_pad_set_chain_function
GstPadChainFunction
gst_pad_iterate_internal_links
gst_pad_iterate_internal_links_default
-gst_pad_set_internal_link_function
-GstPadIntLinkFunction
-gst_pad_get_internal_links
-gst_pad_get_internal_links_default
-
-gst_pad_load_and_link
-
gst_pad_dispatcher
GstPadDispatcherFunction
GST_PAD_STREAM_UNLOCK
GST_PAD_STREAM_UNLOCK_FULL
-GST_FLOW_IS_FATAL
-GST_FLOW_IS_SUCCESS
-
<SUBSECTION Standard>
GstPadClass
GstPadPrivate
GST_PAD_ACTIVATEPUSHFUNC
GST_PAD_BUFFERALLOCFUNC
GST_PAD_CHAINFUNC
+GST_PAD_CHAINLISTFUNC
GST_PAD_CHECKGETRANGEFUNC
GST_PAD_EVENTFUNC
GST_PAD_FIXATECAPSFUNC
GST_PAD_GETCAPSFUNC
GST_PAD_GETRANGEFUNC
-GST_PAD_INTLINKFUNC
GST_PAD_ITERINTLINKFUNC
GST_PAD_IS_FLUSHING
GST_PAD_LINKFUNC
gst_pipeline_use_clock
gst_pipeline_auto_clock
-gst_pipeline_set_new_stream_time
-gst_pipeline_get_last_stream_time
-
gst_pipeline_set_auto_flush_bus
gst_pipeline_get_auto_flush_bus
GstPluginInitFunc
GstPluginInitFullFunc
GST_PLUGIN_DEFINE
-GST_PLUGIN_DEFINE_STATIC
GST_LICENSE_UNKNOWN
GstPluginFilter
gst_plugin_get_name
GST_MAGIC_BINARY_VERSION_LEN
gst_registry_get_type
GstRegistryPrivate
-gst_registry_xml_read_cache
-gst_registry_xml_write_cache
</SECTION>
gst_structure_has_field
gst_structure_has_field_typed
gst_structure_is_equal
+ gst_structure_is_subset
gst_structure_can_intersect
gst_structure_intersect
gst_structure_id_has_field
GST_ROUND_DOWN_32
GST_ROUND_DOWN_64
-gst_atomic_int_set
gst_flow_get_name
gst_flow_to_quark
gst_print_element_args
GST_CHECK_VERSION
</SECTION>
-
-<SECTION>
-<FILE>gstxml</FILE>
-<TITLE>GstXML</TITLE>
-GstXML
-
-gst_xml_write
-gst_xml_write_file
-gst_xml_new
-gst_xml_parse_doc
-gst_xml_parse_file
-gst_xml_parse_memory
-gst_xml_get_element
-gst_xml_get_topelements
-gst_xml_make_element
-<SUBSECTION Standard>
-GstXMLClass
-GST_XML
-GST_IS_XML
-GST_XML_CLASS
-GST_IS_XML_CLASS
-GST_XML_GET_CLASS
-GST_TYPE_XML
-<SUBSECTION Private>
-gst_xml_get_type
-</SECTION>
#include <gst/gst.h>
#include <gobject/gvaluecollector.h>
-#ifdef GST_DISABLE_DEPRECATED
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-#include <libxml/parser.h>
-xmlNodePtr gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent);
-GstCaps *gst_caps_load_thyself (xmlNodePtr parent);
-#endif
-#endif
-
#define DEBUG_REFCOUNT
-#define CAPS_POISON(caps) G_STMT_START{ \
- if (caps) { \
- GstCaps *_newcaps = gst_caps_copy (caps); \
- gst_caps_unref(caps); \
- caps = _newcaps; \
- } \
-} G_STMT_END
-#define STRUCTURE_POISON(structure) G_STMT_START{ \
- if (structure) { \
- GstStructure *_newstruct = gst_structure_copy (structure); \
- gst_structure_free(structure); \
- structure = _newstruct; \
- } \
-} G_STMT_END
#define IS_WRITABLE(caps) \
- (g_atomic_int_get (&(caps)->refcount) == 1)
+ (GST_CAPS_REFCOUNT_VALUE (caps) == 1)
/* same as gst_caps_is_any () */
#define CAPS_IS_ANY(caps) \
- ((caps)->flags & GST_CAPS_FLAGS_ANY)
+ (GST_CAPS_FLAGS(caps) & GST_CAPS_FLAGS_ANY)
/* same as gst_caps_is_empty () */
#define CAPS_IS_EMPTY(caps) \
/* quick way to append a structure without checking the args */
#define gst_caps_append_structure_unchecked(caps, structure) G_STMT_START{\
GstStructure *__s=structure; \
- gst_structure_set_parent_refcount (__s, &caps->refcount); \
- g_ptr_array_add (caps->structs, __s); \
+ if (gst_structure_set_parent_refcount (__s, &GST_MINI_OBJECT_REFCOUNT(caps))) \
+ g_ptr_array_add (caps->structs, __s); \
}G_STMT_END
/* lock to protect multiple invocations of static caps to caps conversion */
GValue * dest_value);
static gboolean gst_caps_from_string_inplace (GstCaps * caps,
const gchar * string);
-static GstCaps *gst_caps_copy_conditional (GstCaps * src);
-GType
-gst_caps_get_type (void)
+GType _gst_caps_type = 0;
+
+void
+_gst_caps_initialize (void)
{
- static GType gst_caps_type = 0;
+ _gst_caps_type = gst_mini_object_register ("GstCaps");
+
+ g_value_register_transform_func (_gst_caps_type,
+ G_TYPE_STRING, gst_caps_transform_to_string);
+}
+
+static GstCaps *
+_gst_caps_copy (const GstCaps * caps)
+{
+ GstCaps *newcaps;
+ GstStructure *structure;
+ guint i, n;
+
+ g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
- if (G_UNLIKELY (gst_caps_type == 0)) {
- gst_caps_type = g_boxed_type_register_static ("GstCaps",
- (GBoxedCopyFunc) gst_caps_copy_conditional,
- (GBoxedFreeFunc) gst_caps_unref);
+ newcaps = gst_caps_new_empty ();
+ GST_CAPS_FLAGS (newcaps) = GST_CAPS_FLAGS (caps);
+ n = caps->structs->len;
- g_value_register_transform_func (gst_caps_type,
- G_TYPE_STRING, gst_caps_transform_to_string);
+ for (i = 0; i < n; i++) {
+ structure = gst_caps_get_structure_unchecked (caps, i);
+ gst_caps_append_structure (newcaps, gst_structure_copy (structure));
}
- return gst_caps_type;
+ return newcaps;
}
/* creation/deletion */
+static void
+_gst_caps_free (GstCaps * caps)
+{
+ GstStructure *structure;
+ guint i, len;
+
+ /* The refcount must be 0, but since we're only called by gst_caps_unref,
+ * don't bother testing. */
+ len = caps->structs->len;
+ /* This can be used to get statistics about caps sizes */
+ /*GST_CAT_INFO (GST_CAT_CAPS, "caps size: %d", len); */
+ for (i = 0; i < len; i++) {
+ structure = (GstStructure *) gst_caps_get_structure_unchecked (caps, i);
+ gst_structure_set_parent_refcount (structure, NULL);
+ gst_structure_free (structure);
+ }
+ g_ptr_array_free (caps->structs, TRUE);
+
+#ifdef DEBUG_REFCOUNT
+ GST_CAT_LOG (GST_CAT_CAPS, "freeing caps %p", caps);
+#endif
+ g_slice_free1 (GST_MINI_OBJECT_SIZE (caps), caps);
+}
+
+static void
+gst_caps_init (GstCaps * caps, gsize size)
+{
+ gst_mini_object_init (GST_MINI_OBJECT_CAST (caps), _gst_caps_type, size);
+
+ caps->mini_object.copy = (GstMiniObjectCopyFunction) _gst_caps_copy;
+ caps->mini_object.dispose = NULL;
+ caps->mini_object.free = (GstMiniObjectFreeFunction) _gst_caps_free;
+
+ /* the 32 has been determined by logging caps sizes in _gst_caps_free
+ * but g_ptr_array uses 16 anyway if it expands once, so this does not help
+ * in practise
+ * caps->structs = g_ptr_array_sized_new (32);
+ */
+ caps->structs = g_ptr_array_new ();
+}
/**
* gst_caps_new_empty:
GstCaps *
gst_caps_new_empty (void)
{
- GstCaps *caps = g_slice_new (GstCaps);
+ GstCaps *caps;
- caps->type = GST_TYPE_CAPS;
- caps->refcount = 1;
- caps->flags = 0;
- caps->structs = g_ptr_array_new ();
- /* the 32 has been determined by logging caps sizes in _gst_caps_free
- * but g_ptr_array uses 16 anyway if it expands once, so this does not help
- * in practise
- * caps->structs = g_ptr_array_sized_new (32);
- */
+ caps = g_slice_new (GstCaps);
+
+ gst_caps_init (caps, sizeof (GstCaps));
#ifdef DEBUG_REFCOUNT
GST_CAT_LOG (GST_CAT_CAPS, "created caps %p", caps);
{
GstCaps *caps = gst_caps_new_empty ();
- caps->flags = GST_CAPS_FLAGS_ANY;
+ GST_CAPS_FLAG_SET (caps, GST_CAPS_FLAGS_ANY);
return caps;
}
}
/**
- * gst_caps_copy:
- * @caps: the #GstCaps to copy
- *
- * Creates a new #GstCaps as a copy of the old @caps. The new caps will have a
- * refcount of 1, owned by the caller. The structures are copied as well.
- *
- * Note that this function is the semantic equivalent of a gst_caps_ref()
- * followed by a gst_caps_make_writable(). If you only want to hold on to a
- * reference to the data, you should use gst_caps_ref().
- *
- * When you are finished with the caps, call gst_caps_unref() on it.
- *
- * Returns: (transfer full): the new #GstCaps
- */
-GstCaps *
-gst_caps_copy (const GstCaps * caps)
-{
- GstCaps *newcaps;
- GstStructure *structure;
- guint i, n;
-
- g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
-
- newcaps = gst_caps_new_empty ();
- newcaps->flags = caps->flags;
- n = caps->structs->len;
-
- for (i = 0; i < n; i++) {
- structure = gst_caps_get_structure_unchecked (caps, i);
- gst_caps_append_structure_unchecked (newcaps,
- gst_structure_copy (structure));
- }
-
- return newcaps;
-}
-
-static void
-_gst_caps_free (GstCaps * caps)
-{
- GstStructure *structure;
- guint i, len;
-
- /* The refcount must be 0, but since we're only called by gst_caps_unref,
- * don't bother testing. */
- len = caps->structs->len;
- /* This can be used to get statistics about caps sizes */
- /*GST_CAT_INFO (GST_CAT_CAPS, "caps size: %d", len); */
- for (i = 0; i < len; i++) {
- structure = (GstStructure *) gst_caps_get_structure_unchecked (caps, i);
- gst_structure_set_parent_refcount (structure, NULL);
- gst_structure_free (structure);
- }
- g_ptr_array_free (caps->structs, TRUE);
-#ifdef USE_POISONING
- memset (caps, 0xff, sizeof (GstCaps));
-#endif
-
-#ifdef DEBUG_REFCOUNT
- GST_CAT_LOG (GST_CAT_CAPS, "freeing caps %p", caps);
-#endif
- g_slice_free (GstCaps, caps);
-}
-
-/**
* gst_caps_make_writable:
* @caps: (transfer full): the #GstCaps to make writable
*
/* else copy */
GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy caps");
- copy = gst_caps_copy (caps);
+ copy = _gst_caps_copy (caps);
gst_caps_unref (caps);
return copy;
}
-/**
- * gst_caps_ref:
- * @caps: the #GstCaps to reference
- *
- * Add a reference to a #GstCaps object.
- *
- * From this point on, until the caller calls gst_caps_unref() or
- * gst_caps_make_writable(), it is guaranteed that the caps object will not
- * change. This means its structures won't change, etc. To use a #GstCaps
- * object, you must always have a refcount on it -- either the one made
- * implicitly by e.g. gst_caps_new_simple(), or via taking one explicitly with
- * this function.
- *
- * Returns: (transfer full): the same #GstCaps object.
- */
-GstCaps *
-gst_caps_ref (GstCaps * caps)
-{
- g_return_val_if_fail (caps != NULL, NULL);
-
-#ifdef DEBUG_REFCOUNT
- GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p %d->%d", caps,
- GST_CAPS_REFCOUNT_VALUE (caps), GST_CAPS_REFCOUNT_VALUE (caps) + 1);
-#endif
- g_return_val_if_fail (GST_CAPS_REFCOUNT_VALUE (caps) > 0, NULL);
-
- g_atomic_int_inc (&caps->refcount);
-
- return caps;
-}
-
-/**
- * gst_caps_unref:
- * @caps: (transfer full): the #GstCaps to unref
- *
- * Unref a #GstCaps and and free all its structures and the
- * structures' values when the refcount reaches 0.
- */
-void
-gst_caps_unref (GstCaps * caps)
-{
- g_return_if_fail (caps != NULL);
-
-#ifdef DEBUG_REFCOUNT
- GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p %d->%d", caps,
- GST_CAPS_REFCOUNT_VALUE (caps), GST_CAPS_REFCOUNT_VALUE (caps) - 1);
-#endif
-
- g_return_if_fail (GST_CAPS_REFCOUNT_VALUE (caps) > 0);
-
- /* if we ended up with the refcount at zero, free the caps */
- if (G_UNLIKELY (g_atomic_int_dec_and_test (&caps->refcount)))
- _gst_caps_free (caps);
-}
-
GType
gst_static_caps_get_type (void)
{
caps = (GstCaps *) static_caps;
/* refcount is 0 when we need to convert */
- if (G_UNLIKELY (g_atomic_int_get (&caps->refcount) == 0)) {
+ if (G_UNLIKELY (GST_CAPS_REFCOUNT_VALUE (caps) == 0)) {
const char *string;
GstCaps temp;
G_LOCK (static_caps_lock);
/* check if other thread already updated */
- if (G_UNLIKELY (g_atomic_int_get (&caps->refcount) > 0))
+ if (G_UNLIKELY (GST_CAPS_REFCOUNT_VALUE (caps) > 0))
goto done;
string = static_caps->string;
* real caps, refcount last. We do this because we must leave the refcount
* of the result caps to 0 so that other threads don't run away with the
* caps while we are constructing it. */
- temp.type = GST_TYPE_CAPS;
- temp.flags = 0;
- temp.structs = g_ptr_array_new ();
-
- /* initialize the caps to a refcount of 1 so the caps can be writable for
- * the next statement */
- temp.refcount = 1;
+ gst_caps_init (&temp, sizeof (GstCaps));
/* convert to string */
if (G_UNLIKELY (!gst_caps_from_string_inplace (&temp, string)))
g_critical ("Could not convert static caps \"%s\"", string);
+ gst_caps_init (caps, sizeof (GstCaps));
/* now copy stuff over to the real caps. */
- caps->type = temp.type;
- caps->flags = temp.flags;
+ GST_CAPS_FLAGS (caps) = GST_CAPS_FLAGS (&temp);
caps->structs = temp.structs;
- /* and bump the refcount so other threads can now read */
- g_atomic_int_set (&caps->refcount, 1);
GST_CAT_LOG (GST_CAT_CAPS, "created %p", static_caps);
done:
return gst_caps_remove_and_get_structure (caps, index);
}
- static gboolean
- gst_caps_structure_is_subset_field (GQuark field_id, const GValue * value,
- gpointer user_data)
- {
- GstStructure *subtract_from = user_data;
- GValue subtraction = { 0, };
- const GValue *other;
-
- if (!(other = gst_structure_id_get_value (subtract_from, field_id)))
- /* field is missing in one set */
- return FALSE;
-
- /* equal values are subset */
- if (gst_value_compare (other, value) == GST_VALUE_EQUAL)
- return TRUE;
-
- /*
- * 1 - [1,2] = empty
- * -> !subset
- *
- * [1,2] - 1 = 2
- * -> 1 - [1,2] = empty
- * -> subset
- *
- * [1,3] - [1,2] = 3
- * -> [1,2] - [1,3] = empty
- * -> subset
- *
- * {1,2} - {1,3} = 2
- * -> {1,3} - {1,2} = 3
- * -> !subset
- *
- * First caps subtraction needs to return a non-empty set, second
- * subtractions needs to give en empty set.
- */
- if (gst_value_subtract (&subtraction, other, value)) {
- g_value_unset (&subtraction);
- /* !empty result, swapping must be empty */
- if (!gst_value_subtract (&subtraction, value, other))
- return TRUE;
-
- g_value_unset (&subtraction);
- }
- return FALSE;
- }
-
- static gboolean
- gst_caps_structure_is_subset (const GstStructure * minuend,
- const GstStructure * subtrahend)
- {
- if ((minuend->name != subtrahend->name)
- || (gst_structure_n_fields (minuend) !=
- gst_structure_n_fields (subtrahend))) {
- return FALSE;
- }
-
- return gst_structure_foreach ((GstStructure *) subtrahend,
- gst_caps_structure_is_subset_field, (gpointer) minuend);
- }
-
/**
* gst_caps_append:
* @caps1: the #GstCaps that will be appended to
g_return_if_fail (IS_WRITABLE (caps1));
g_return_if_fail (IS_WRITABLE (caps2));
-#ifdef USE_POISONING
- CAPS_POISON (caps2);
-#endif
if (G_UNLIKELY (CAPS_IS_ANY (caps1) || CAPS_IS_ANY (caps2))) {
/* FIXME: this leaks */
- caps1->flags |= GST_CAPS_FLAGS_ANY;
+ GST_CAPS_FLAGS (caps1) |= GST_CAPS_FLAGS_ANY;
for (i = caps2->structs->len - 1; i >= 0; i--) {
structure = gst_caps_remove_and_get_structure (caps2, i);
gst_structure_free (structure);
g_return_if_fail (IS_WRITABLE (caps1));
g_return_if_fail (IS_WRITABLE (caps2));
-#ifdef USE_POISONING
- CAPS_POISON (caps2);
-#endif
if (G_UNLIKELY (CAPS_IS_ANY (caps1))) {
for (i = caps2->structs->len - 1; i >= 0; i--) {
structure = gst_caps_remove_and_get_structure (caps2, i);
gst_structure_free (structure);
}
} else if (G_UNLIKELY (CAPS_IS_ANY (caps2))) {
- caps1->flags |= GST_CAPS_FLAGS_ANY;
+ GST_CAPS_FLAGS (caps1) |= GST_CAPS_FLAGS_ANY;
for (i = caps1->structs->len - 1; i >= 0; i--) {
structure = gst_caps_remove_and_get_structure (caps1, i);
gst_structure_free (structure);
g_return_if_fail (IS_WRITABLE (caps));
if (G_LIKELY (structure)) {
- g_return_if_fail (structure->parent_refcount == NULL);
-#if 0
-#ifdef USE_POISONING
- STRUCTURE_POISON (structure);
-#endif
-#endif
gst_caps_append_structure_unchecked (caps, structure);
}
}
int i;
gboolean unique = TRUE;
- g_return_if_fail (structure->parent_refcount == NULL);
-#if 0
-#ifdef USE_POISONING
- STRUCTURE_POISON (structure);
-#endif
-#endif
/* check each structure */
for (i = caps->structs->len - 1; i >= 0; i--) {
structure1 = gst_caps_get_structure_unchecked (caps, i);
/* if structure is a subset of structure1, then skip it */
- if (gst_caps_structure_is_subset (structure1, structure)) {
+ if (gst_structure_is_subset (structure, structure1)) {
unique = FALSE;
break;
}
g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
newcaps = gst_caps_new_empty ();
- newcaps->flags = caps->flags;
+ GST_CAPS_FLAGS (newcaps) = GST_CAPS_FLAGS (caps);
if (G_LIKELY (caps->structs->len > nth)) {
structure = gst_caps_get_structure_unchecked (caps, nth);
gboolean
gst_caps_is_subset (const GstCaps * subset, const GstCaps * superset)
{
- GstCaps *caps;
- gboolean ret;
+ GstStructure *s1, *s2;
+ gboolean ret = TRUE;
+ gint i, j;
g_return_val_if_fail (subset != NULL, FALSE);
g_return_val_if_fail (superset != NULL, FALSE);
if (CAPS_IS_ANY (subset) || CAPS_IS_EMPTY (superset))
return FALSE;
- caps = gst_caps_subtract (subset, superset);
- ret = CAPS_IS_EMPTY_SIMPLE (caps);
- gst_caps_unref (caps);
+ for (i = subset->structs->len - 1; i >= 0; i--) {
+ for (j = superset->structs->len - 1; j >= 0; j--) {
+ s1 = gst_caps_get_structure_unchecked (subset, i);
+ s2 = gst_caps_get_structure_unchecked (superset, j);
+ if (gst_structure_is_subset (s1, s2)) {
+ /* If we found a superset, continue with the next
+ * subset structure */
+ break;
+ }
+ }
+ /* If we found no superset for this subset structure
+ * we return FALSE immediately */
+ if (j == -1) {
+ ret = FALSE;
+ break;
+ }
+ }
+
return ret;
}
/**
+ * gst_caps_is_subset_structure:
+ * @caps: a #GstCaps
+ * @structure: a potential #GstStructure subset of @caps
+ *
+ * Checks if @structure is a subset of @caps. See gst_caps_is_subset()
+ * for more information.
+ *
+ * Returns: %TRUE if @structure is a subset of @caps
+ *
+ * Since: 0.10.35
+ */
+ gboolean
+ gst_caps_is_subset_structure (const GstCaps * caps,
+ const GstStructure * structure)
+ {
+ GstStructure *s;
+ gint i;
+
+ g_return_val_if_fail (caps != NULL, FALSE);
+ g_return_val_if_fail (structure != NULL, FALSE);
+
+ if (CAPS_IS_ANY (caps))
+ return TRUE;
+ if (CAPS_IS_EMPTY (caps))
+ return FALSE;
+
+ for (i = caps->structs->len - 1; i >= 0; i--) {
+ s = gst_caps_get_structure_unchecked (caps, i);
+ if (gst_structure_is_subset (structure, s)) {
+ /* If we found a superset return TRUE */
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+ }
+
+ /**
* gst_caps_is_equal:
* @caps1: a #GstCaps
* @caps2: another #GstCaps
/* caps are exactly the same pointers, just copy one caps */
if (G_UNLIKELY (caps1 == caps2))
- return gst_caps_copy (caps1);
+ return _gst_caps_copy (caps1);
/* empty caps on either side, return empty */
if (G_UNLIKELY (CAPS_IS_EMPTY (caps1) || CAPS_IS_EMPTY (caps2)))
/* one of the caps is any, just copy the other caps */
if (G_UNLIKELY (CAPS_IS_ANY (caps1)))
- return gst_caps_copy (caps2);
+ return _gst_caps_copy (caps2);
if (G_UNLIKELY (CAPS_IS_ANY (caps2)))
- return gst_caps_copy (caps1);
+ return _gst_caps_copy (caps1);
dest = gst_caps_new_empty ();
return gst_caps_new_empty ();
}
if (CAPS_IS_EMPTY_SIMPLE (subtrahend))
- return gst_caps_copy (minuend);
+ return _gst_caps_copy (minuend);
/* FIXME: Do we want this here or above?
The reason we need this is that there is no definition about what
sublen = subtrahend->structs->len;
g_assert (sublen > 0);
- src = gst_caps_copy (minuend);
+ src = _gst_caps_copy (minuend);
for (i = 0; i < sublen; i++) {
guint srclen;
g_return_val_if_fail (caps2 != NULL, NULL);
if (CAPS_IS_EMPTY (caps1))
- return gst_caps_copy (caps2);
+ return _gst_caps_copy (caps2);
if (CAPS_IS_EMPTY (caps2))
- return gst_caps_copy (caps1);
+ return _gst_caps_copy (caps1);
if (CAPS_IS_ANY (caps1) || CAPS_IS_ANY (caps2))
return gst_caps_new_any ();
- dest1 = gst_caps_copy (caps1);
- dest2 = gst_caps_copy (caps2);
+ dest1 = _gst_caps_copy (caps1);
+ dest2 = _gst_caps_copy (caps2);
gst_caps_append (dest1, dest2);
gst_caps_do_simplify (dest1);
g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
- newcaps = gst_caps_copy (caps);
+ newcaps = _gst_caps_copy (caps);
nf.caps = newcaps;
for (i = 0; i < gst_caps_get_size (newcaps); i++) {
{
gst_structure_set_parent_refcount (old, NULL);
gst_structure_free (old);
- gst_structure_set_parent_refcount (new, &caps->refcount);
+ gst_structure_set_parent_refcount (new, &GST_CAPS_REFCOUNT (caps));
g_ptr_array_index (caps->structs, i) = new;
}
return TRUE;
}
-/* persistence */
-
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
-/**
- * gst_caps_save_thyself:
- * @caps: a #GstCaps structure
- * @parent: a XML parent node
- *
- * Serializes a #GstCaps to XML and adds it as a child node of @parent.
- *
- * Returns: a XML node pointer
- */
-xmlNodePtr
-gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent)
-{
- char *s = gst_caps_to_string (caps);
-
- xmlNewChild (parent, NULL, (xmlChar *) "caps", (xmlChar *) s);
- g_free (s);
- return parent;
-}
-
-/**
- * gst_caps_load_thyself:
- * @parent: a XML node
- *
- * Creates a #GstCaps from its XML serialization.
- *
- * Returns: a new #GstCaps structure
- */
-GstCaps *
-gst_caps_load_thyself (xmlNodePtr parent)
-{
- if (strcmp ("caps", (char *) parent->name) == 0) {
- return gst_caps_from_string ((gchar *) xmlNodeGetContent (parent));
- }
-
- return NULL;
-}
-#endif
-
/* utility */
/**
gchar *s;
if (strcmp ("ANY", string) == 0) {
- caps->flags = GST_CAPS_FLAGS_ANY;
+ GST_CAPS_FLAGS (caps) = GST_CAPS_FLAGS_ANY;
return TRUE;
}
if (strcmp ("EMPTY", string) == 0) {
dest_value->data[0].v_pointer =
gst_caps_to_string (src_value->data[0].v_pointer);
}
-
-static GstCaps *
-gst_caps_copy_conditional (GstCaps * src)
-{
- if (src) {
- return gst_caps_ref (src);
- } else {
- return NULL;
- }
-}
#define __GST_CAPS_H__
#include <gst/gstconfig.h>
+#include <gst/gstminiobject.h>
#include <gst/gststructure.h>
#include <gst/glib-compat.h>
G_BEGIN_DECLS
-#define GST_TYPE_CAPS (gst_caps_get_type())
-#define GST_CAPS(object) ((GstCaps*)object)
-#define GST_IS_CAPS(object) ((object) && (GST_CAPS(object)->type == GST_TYPE_CAPS))
+extern GType _gst_caps_type;
+
+#define GST_TYPE_CAPS (_gst_caps_type)
+#define GST_IS_CAPS(obj) (GST_IS_MINI_OBJECT_TYPE((obj), GST_TYPE_CAPS))
+#define GST_CAPS_CAST(obj) ((GstCaps*)(obj))
+#define GST_CAPS(obj) (GST_CAPS_CAST(obj))
#define GST_TYPE_STATIC_CAPS (gst_static_caps_get_type())
* Extra flags for a caps.
*/
typedef enum {
- GST_CAPS_FLAGS_ANY = (1 << 0)
+ GST_CAPS_FLAGS_ANY = (GST_MINI_OBJECT_FLAG_LAST << 0)
} GstCapsFlags;
/**
*/
#define GST_CAPS_IS_SIMPLE(caps) (gst_caps_get_size(caps) == 1)
-#ifndef GST_DISABLE_DEPRECATED
-/**
- * GST_DEBUG_CAPS:
- * @string: a string that should be prepended to the caps data.
- * @caps: the #GstCaps instance to print
- *
- * Convenience macro for printing out the contents of caps with GST_DEBUG().
- *
- * Deprecated: do not use anymore
- */
-#define GST_DEBUG_CAPS(string, caps) \
- GST_DEBUG ( string "%s: " GST_PTR_FORMAT, caps)
-
-#endif /* GST_DISABLE_DEPRECATED */
-
/**
* GST_STATIC_CAPS:
* @string: the string describing the caps
*/
#define GST_STATIC_CAPS(string) \
{ \
- /* caps */ { 0, 0, (GstCapsFlags) 0, NULL, GST_PADDING_INIT }, \
+ /* miniobject */ { { 0, 0, 0, 0, NULL, NULL, NULL }, \
+ /* caps */ NULL, GST_PADDING_INIT }, \
/* string */ string, \
GST_PADDING_INIT \
}
typedef struct _GstCaps GstCaps;
typedef struct _GstStaticCaps GstStaticCaps;
+/**
+ * GST_CAPS_FLAGS:
+ * @caps: a #GstCaps.
+ *
+ * A flags word containing #GstCapsFlags flags set on this caps.
+ */
+#define GST_CAPS_FLAGS(caps) GST_MINI_OBJECT_FLAGS(caps)
+
/* refcount */
/**
* GST_CAPS_REFCOUNT:
*
* Get access to the reference count field of the caps
*/
-#define GST_CAPS_REFCOUNT(caps) ((GST_CAPS(caps))->refcount)
+#define GST_CAPS_REFCOUNT(caps) GST_MINI_OBJECT_REFCOUNT(caps)
/**
* GST_CAPS_REFCOUNT_VALUE:
* @caps: a #GstCaps
*
* Get the reference count value of the caps.
*/
-#define GST_CAPS_REFCOUNT_VALUE(caps) (g_atomic_int_get (&(GST_CAPS(caps))->refcount))
+#define GST_CAPS_REFCOUNT_VALUE(caps) GST_MINI_OBJECT_REFCOUNT_VALUE(caps)
+
+/**
+ * GST_CAPS_FLAG_IS_SET:
+ * @caps: a #GstCaps.
+ * @flag: the #GstCapsFlag to check.
+ *
+ * Gives the status of a specific flag on a caps.
+ */
+#define GST_CAPS_FLAG_IS_SET(caps,flag) GST_MINI_OBJECT_FLAG_IS_SET (caps, flag)
+/**
+ * GST_CAPS_FLAG_SET:
+ * @caps: a #GstCaps.
+ * @flag: the #GstCapsFlag to set.
+ *
+ * Sets a caps flag on a caps.
+ */
+#define GST_CAPS_FLAG_SET(caps,flag) GST_MINI_OBJECT_FLAG_SET (caps, flag)
+/**
+ * GST_CAPS_FLAG_UNSET:
+ * @caps: a #GstCaps.
+ * @flag: the #GstCapsFlag to clear.
+ *
+ * Clears a caps flag.
+ */
+#define GST_CAPS_FLAG_UNSET(caps,flag) GST_MINI_OBJECT_FLAG_UNSET (caps, flag)
+
+/* refcounting */
+/**
+ * gst_caps_ref:
+ * @caps: the #GstCaps to reference
+ *
+ * Add a reference to a #GstCaps object.
+ *
+ * From this point on, until the caller calls gst_caps_unref() or
+ * gst_caps_make_writable(), it is guaranteed that the caps object will not
+ * change. This means its structures won't change, etc. To use a #GstCaps
+ * object, you must always have a refcount on it -- either the one made
+ * implicitly by e.g. gst_caps_new_simple(), or via taking one explicitly with
+ * this function.
+ *
+ * Returns: the same #GstCaps object.
+ */
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC GstCaps * gst_caps_ref (GstCaps * caps);
+#endif
+
+static inline GstCaps *
+gst_caps_ref (GstCaps * caps)
+{
+ return (GstCaps *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (caps));
+}
+
+/**
+ * gst_caps_unref:
+ * @caps: a #GstCaps.
+ *
+ * Unref a #GstCaps and and free all its structures and the
+ * structures' values when the refcount reaches 0.
+ */
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC void gst_caps_unref (GstCaps * caps);
+#endif
+
+static inline void
+gst_caps_unref (GstCaps * caps)
+{
+ gst_mini_object_unref (GST_MINI_OBJECT_CAST (caps));
+}
+
+/* copy caps */
+/**
+ * gst_caps_copy:
+ * @caps: a #GstCaps.
+ *
+ * Creates a new #GstCaps as a copy of the old @caps. The new caps will have a
+ * refcount of 1, owned by the caller. The structures are copied as well.
+ *
+ * Note that this function is the semantic equivalent of a gst_caps_ref()
+ * followed by a gst_caps_make_writable(). If you only want to hold on to a
+ * reference to the data, you should use gst_caps_ref().
+ *
+ * When you are finished with the caps, call gst_caps_unref() on it.
+ *
+ * Returns: the new #GstCaps
+ */
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC GstCaps * gst_caps_copy (const GstCaps * caps);
+#endif
+
+static inline GstCaps *
+gst_caps_copy (const GstCaps * caps)
+{
+ return GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)));
+}
+
/**
* GstCaps:
- * @type: GType of the caps
- * @refcount: the atomic refcount value
- * @flags: extra flags for the caps, read only.
+ * @mini_object: the parent type
*
* Object describing media types.
*/
struct _GstCaps {
- GType type;
-
- /*< public >*/ /* with COW */
- /* refcounting */
- gint refcount;
-
- /*< public >*/ /* read only */
- GstCapsFlags flags;
+ GstMiniObject mini_object;
/*< private >*/
GPtrArray *structs;
gpointer _gst_reserved[GST_PADDING];
};
-GType gst_caps_get_type (void);
GstCaps * gst_caps_new_empty (void);
GstCaps * gst_caps_new_any (void);
GstCaps * gst_caps_new_simple (const char *media_type,
va_list var_args);
/* reference counting */
-GstCaps * gst_caps_ref (GstCaps *caps);
-GstCaps * gst_caps_copy (const GstCaps *caps);
GstCaps * gst_caps_make_writable (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
-void gst_caps_unref (GstCaps *caps);
GType gst_static_caps_get_type (void);
GstCaps * gst_static_caps_get (GstStaticCaps *static_caps);
const GstCaps *caps2);
gboolean gst_caps_is_subset (const GstCaps *subset,
const GstCaps *superset);
+ gboolean gst_caps_is_subset_structure (const GstCaps *caps,
+ const GstStructure *structure);
gboolean gst_caps_is_equal (const GstCaps *caps1,
const GstCaps *caps2);
gboolean gst_caps_is_equal_fixed (const GstCaps *caps1,
GstCaps * gst_caps_normalize (const GstCaps *caps);
gboolean gst_caps_do_simplify (GstCaps *caps);
-#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED)
-xmlNodePtr gst_caps_save_thyself (const GstCaps *caps,
- xmlNodePtr parent);
-GstCaps * gst_caps_load_thyself (xmlNodePtr parent);
-#endif
-
/* utility */
void gst_caps_replace (GstCaps **caps,
GstCaps *newcaps);
GValue value;
};
+typedef struct
+{
+ GstStructure s;
+
+ /* owned by parent structure, NULL if no parent */
+ gint *parent_refcount;
+
+ GArray *fields;
+} GstStructureImpl;
+
+#define GST_STRUCTURE_REFCOUNT(s) (((GstStructureImpl*)(s))->parent_refcount)
+#define GST_STRUCTURE_FIELDS(s) (((GstStructureImpl*)(s))->fields)
+
#define GST_STRUCTURE_FIELD(structure, index) \
- &g_array_index((structure)->fields, GstStructureField, (index))
+ &g_array_index(GST_STRUCTURE_FIELDS(structure), GstStructureField, (index))
#define IS_MUTABLE(structure) \
- (!(structure)->parent_refcount || \
- g_atomic_int_get ((structure)->parent_refcount) == 1)
+ (!GST_STRUCTURE_REFCOUNT(structure) || \
+ g_atomic_int_get (GST_STRUCTURE_REFCOUNT(structure)) == 1)
#define IS_TAGLIST(structure) \
(structure->name == GST_QUARK (TAGLIST))
GValue * value, GType default_type);
static gboolean gst_structure_parse_simple_string (gchar * s, gchar ** end);
-GType
-gst_structure_get_type (void)
-{
- static GType gst_structure_type = 0;
-
- if (G_UNLIKELY (gst_structure_type == 0)) {
- gst_structure_type = g_boxed_type_register_static ("GstStructure",
- (GBoxedCopyFunc) gst_structure_copy_conditional,
- (GBoxedFreeFunc) gst_structure_free);
+GType _gst_structure_type = 0;
- g_value_register_transform_func (gst_structure_type, G_TYPE_STRING,
- gst_structure_transform_to_string);
- }
+void
+_gst_structure_initialize (void)
+{
+ _gst_structure_type = g_boxed_type_register_static ("GstStructure",
+ (GBoxedCopyFunc) gst_structure_copy_conditional,
+ (GBoxedFreeFunc) gst_structure_free);
- return gst_structure_type;
+ g_value_register_transform_func (_gst_structure_type, G_TYPE_STRING,
+ gst_structure_transform_to_string);
}
static GstStructure *
gst_structure_id_empty_new_with_size (GQuark quark, guint prealloc)
{
- GstStructure *structure;
+ GstStructureImpl *structure;
- structure = g_slice_new (GstStructure);
- structure->type = gst_structure_get_type ();
- structure->name = quark;
- structure->parent_refcount = NULL;
- structure->fields =
+ structure = g_slice_new (GstStructureImpl);
+ ((GstStructure *) structure)->type = _gst_structure_type;
+ ((GstStructure *) structure)->name = quark;
+ GST_STRUCTURE_REFCOUNT (structure) = NULL;
+ GST_STRUCTURE_FIELDS (structure) =
g_array_sized_new (FALSE, FALSE, sizeof (GstStructureField), prealloc);
- return structure;
+ return GST_STRUCTURE_CAST (structure);
}
/**
* determine whether a structure is mutable or not. This function should only be
* called by code implementing parent objects of #GstStructure, as described in
* the MT Refcounting section of the design documents.
+ *
+ * Returns: %TRUE if the parent refcount could be set.
*/
-void
+gboolean
gst_structure_set_parent_refcount (GstStructure * structure, gint * refcount)
{
- g_return_if_fail (structure != NULL);
+ g_return_val_if_fail (structure != NULL, FALSE);
/* if we have a parent_refcount already, we can only clear
* if with a NULL refcount */
- if (structure->parent_refcount)
- g_return_if_fail (refcount == NULL);
- else
- g_return_if_fail (refcount != NULL);
+ if (GST_STRUCTURE_REFCOUNT (structure)) {
+ if (refcount != NULL) {
+ g_return_val_if_fail (refcount == NULL, FALSE);
+ return FALSE;
+ }
+ } else {
+ if (refcount == NULL) {
+ g_return_val_if_fail (refcount != NULL, FALSE);
+ return FALSE;
+ }
+ }
+
+ GST_STRUCTURE_REFCOUNT (structure) = refcount;
- structure->parent_refcount = refcount;
+ return TRUE;
}
/**
g_return_val_if_fail (structure != NULL, NULL);
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
new_structure = gst_structure_id_empty_new_with_size (structure->name, len);
for (i = 0; i < len; i++) {
new_field.name = field->name;
gst_value_init_and_copy (&new_field.value, &field->value);
- g_array_append_val (new_structure->fields, new_field);
+ g_array_append_val (GST_STRUCTURE_FIELDS (new_structure), new_field);
}
return new_structure;
guint i, len;
g_return_if_fail (structure != NULL);
- g_return_if_fail (structure->parent_refcount == NULL);
+ g_return_if_fail (GST_STRUCTURE_REFCOUNT (structure) == NULL);
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
for (i = 0; i < len; i++) {
field = GST_STRUCTURE_FIELD (structure, i);
g_value_unset (&field->value);
}
}
- g_array_free (structure->fields, TRUE);
+ g_array_free (GST_STRUCTURE_FIELDS (structure), TRUE);
#ifdef USE_POISONING
memset (structure, 0xff, sizeof (GstStructure));
#endif
- g_slice_free (GstStructure, structure);
+ g_slice_free1 (sizeof (GstStructureImpl), structure);
}
/**
gst_structure_set_field (GstStructure * structure, GstStructureField * field)
{
GstStructureField *f;
- guint i, len = structure->fields->len;
+ guint i, len = GST_STRUCTURE_FIELDS (structure)->len;
if (G_UNLIKELY (G_VALUE_HOLDS_STRING (&field->value))) {
const gchar *s;
}
}
- g_array_append_val (structure->fields, *field);
+ g_array_append_val (GST_STRUCTURE_FIELDS (structure), *field);
}
/* If there is no field with the given ID, NULL is returned.
GstStructureField *field;
guint i, len;
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
for (i = 0; i < len; i++) {
field = GST_STRUCTURE_FIELD (structure, i);
g_return_if_fail (IS_MUTABLE (structure));
id = g_quark_from_string (fieldname);
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
for (i = 0; i < len; i++) {
field = GST_STRUCTURE_FIELD (structure, i);
if (G_IS_VALUE (&field->value)) {
g_value_unset (&field->value);
}
- structure->fields = g_array_remove_index (structure->fields, i);
+ GST_STRUCTURE_FIELDS (structure) =
+ g_array_remove_index (GST_STRUCTURE_FIELDS (structure), i);
return;
}
}
g_return_if_fail (structure != NULL);
g_return_if_fail (IS_MUTABLE (structure));
- for (i = structure->fields->len - 1; i >= 0; i--) {
+ for (i = GST_STRUCTURE_FIELDS (structure)->len - 1; i >= 0; i--) {
field = GST_STRUCTURE_FIELD (structure, i);
if (G_IS_VALUE (&field->value)) {
g_value_unset (&field->value);
}
- structure->fields = g_array_remove_index (structure->fields, i);
+ GST_STRUCTURE_FIELDS (structure) =
+ g_array_remove_index (GST_STRUCTURE_FIELDS (structure), i);
}
}
{
g_return_val_if_fail (structure != NULL, 0);
- return structure->fields->len;
+ return GST_STRUCTURE_FIELDS (structure)->len;
}
/**
GstStructureField *field;
g_return_val_if_fail (structure != NULL, NULL);
- g_return_val_if_fail (index < structure->fields->len, NULL);
+ g_return_val_if_fail (index < GST_STRUCTURE_FIELDS (structure)->len, NULL);
field = GST_STRUCTURE_FIELD (structure, index);
g_return_val_if_fail (structure != NULL, FALSE);
g_return_val_if_fail (func != NULL, FALSE);
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
for (i = 0; i < len; i++) {
field = GST_STRUCTURE_FIELD (structure, i);
g_return_val_if_fail (structure != NULL, FALSE);
g_return_val_if_fail (IS_MUTABLE (structure), FALSE);
g_return_val_if_fail (func != NULL, FALSE);
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
for (i = 0; i < len; i++) {
field = GST_STRUCTURE_FIELD (structure, i);
g_return_val_if_fail (s != NULL, FALSE);
g_string_append (s, g_quark_to_string (structure->name));
- len = structure->fields->len;
+ len = GST_STRUCTURE_FIELDS (structure)->len;
for (i = 0; i < len; i++) {
char *t;
GType type;
if (structure1->name != structure2->name) {
return FALSE;
}
- if (structure1->fields->len != structure2->fields->len) {
+ if (GST_STRUCTURE_FIELDS (structure1)->len !=
+ GST_STRUCTURE_FIELDS (structure2)->len) {
return FALSE;
}
return TRUE;
}
+
+ static gboolean
+ gst_caps_structure_is_subset_field (GQuark field_id, const GValue * value,
+ gpointer user_data)
+ {
+ GstStructure *superset = user_data;
+ GValue subtraction = { 0, };
+ const GValue *other;
+
+ if (!(other = gst_structure_id_get_value (superset, field_id)))
+ /* field is missing in the superset => is subset */
+ return TRUE;
+
+ /* equal values are subset */
+ if (gst_value_compare (other, value) == GST_VALUE_EQUAL)
+ return TRUE;
+
+ /*
+ * 1 - [1,2] = empty
+ * -> !subset
+ *
+ * [1,2] - 1 = 2
+ * -> 1 - [1,2] = empty
+ * -> subset
+ *
+ * [1,3] - [1,2] = 3
+ * -> [1,2] - [1,3] = empty
+ * -> subset
+ *
+ * {1,2} - {1,3} = 2
+ * -> {1,3} - {1,2} = 3
+ * -> !subset
+ *
+ * First caps subtraction needs to return a non-empty set, second
+ * subtractions needs to give en empty set.
+ */
+ if (gst_value_subtract (&subtraction, other, value)) {
+ g_value_unset (&subtraction);
+ /* !empty result, swapping must be empty */
+ if (!gst_value_subtract (&subtraction, value, other))
+ return TRUE;
+
+ g_value_unset (&subtraction);
+ }
+ return FALSE;
+ }
+
+ /**
+ * gst_structure_is_subset:
+ * @subset: a #GstStructure
+ * @superset: a potentially greater #GstStructure
+ *
+ * Checks if @subset is a subset of @superset, i.e. has the same
+ * structure name and for all fields that are existing in @superset,
+ * @subset has a value that is a subset of the value in @superset.
+ *
+ * Returns: %TRUE if @subset is a subset of @superset
+ *
+ * Since: 0.10.35
+ */
+ gboolean
+ gst_structure_is_subset (const GstStructure * subset,
+ const GstStructure * superset)
+ {
+ if ((superset->name != subset->name) ||
+ (gst_structure_n_fields (superset) > gst_structure_n_fields (subset)))
+ return FALSE;
+
+ return gst_structure_foreach ((GstStructure *) subset,
+ gst_caps_structure_is_subset_field, (gpointer) superset);
+ }
G_BEGIN_DECLS
-#define GST_TYPE_STRUCTURE (gst_structure_get_type ())
-#define GST_STRUCTURE(object) ((GstStructure *)(object))
-#define GST_IS_STRUCTURE(object) ((object) && (GST_STRUCTURE(object)->type == GST_TYPE_STRUCTURE))
+extern GType _gst_structure_type;
typedef struct _GstStructure GstStructure;
+#define GST_TYPE_STRUCTURE (_gst_structure_type)
+#define GST_IS_STRUCTURE(object) ((object) && (GST_STRUCTURE(object)->type == GST_TYPE_STRUCTURE))
+#define GST_STRUCTURE_CAST(object) ((GstStructure *)(object))
+#define GST_STRUCTURE(object) (GST_STRUCTURE_CAST(object))
+
+
/**
* GstStructureForeachFunc:
* @field_id: the #GQuark of the field name
/*< private >*/
GQuark name;
-
- /* owned by parent structure, NULL if no parent */
- gint *parent_refcount;
-
- GArray *fields;
-
- gpointer _gst_reserved;
};
-GType gst_structure_get_type (void);
-
GstStructure * gst_structure_empty_new (const gchar * name);
GstStructure * gst_structure_id_empty_new (GQuark quark);
GstStructure * gst_structure_new (const gchar * name,
GQuark field_quark,
...);
GstStructure * gst_structure_copy (const GstStructure *structure);
-void gst_structure_set_parent_refcount (GstStructure *structure,
- gint *refcount);
+gboolean gst_structure_set_parent_refcount (GstStructure *structure,
+ gint *refcount);
void gst_structure_free (GstStructure *structure);
G_CONST_RETURN gchar * gst_structure_get_name (const GstStructure *structure);
gboolean gst_structure_is_equal(const GstStructure *structure1,
const GstStructure *structure2);
+ gboolean gst_structure_is_subset(const GstStructure *subset,
+ const GstStructure *superset);
gboolean gst_structure_can_intersect(const GstStructure *struct1,
const GstStructure *struct2);
GstStructure* gst_structure_intersect (const GstStructure *struct1,
gboolean discont;
gboolean flushing;
- /* two segments to be sent in the streaming thread with STREAM_LOCK */
- GstEvent *close_segment;
- GstEvent *start_segment;
- gboolean newsegment_pending;
+ /* if segment should be sent */
+ gboolean segment_pending;
/* if EOS is pending (atomic) */
gint pending_eos;
static GstElementClass *parent_class = NULL;
-static void gst_base_src_base_init (gpointer g_class);
static void gst_base_src_class_init (GstBaseSrcClass * klass);
static void gst_base_src_init (GstBaseSrc * src, gpointer g_class);
static void gst_base_src_finalize (GObject * object);
GType _type;
static const GTypeInfo base_src_info = {
sizeof (GstBaseSrcClass),
- (GBaseInitFunc) gst_base_src_base_init,
+ NULL,
NULL,
(GClassInitFunc) gst_base_src_class_init,
NULL,
return base_src_type;
}
-static GstCaps *gst_base_src_getcaps (GstPad * pad);
-static gboolean gst_base_src_setcaps (GstPad * pad, GstCaps * caps);
+static GstCaps *gst_base_src_getcaps (GstPad * pad, GstCaps * filter);
static void gst_base_src_fixate (GstPad * pad, GstCaps * caps);
+static gboolean gst_base_src_is_random_access (GstBaseSrc * src);
static gboolean gst_base_src_activate_push (GstPad * pad, gboolean active);
static gboolean gst_base_src_activate_pull (GstPad * pad, gboolean active);
static void gst_base_src_set_property (GObject * object, guint prop_id,
GstStateChange transition);
static void gst_base_src_loop (GstPad * pad);
-static gboolean gst_base_src_pad_check_get_range (GstPad * pad);
-static gboolean gst_base_src_default_check_get_range (GstBaseSrc * bsrc);
static GstFlowReturn gst_base_src_pad_get_range (GstPad * pad, guint64 offset,
guint length, GstBuffer ** buf);
static GstFlowReturn gst_base_src_get_range (GstBaseSrc * src, guint64 offset,
guint length, GstBuffer ** buf);
static gboolean gst_base_src_seekable (GstBaseSrc * src);
-
-static void
-gst_base_src_base_init (gpointer g_class)
-{
- GST_DEBUG_CATEGORY_INIT (gst_base_src_debug, "basesrc", 0, "basesrc element");
-}
+static gboolean gst_base_src_negotiate (GstBaseSrc * basesrc);
static void
gst_base_src_class_init (GstBaseSrcClass * klass)
gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
+ GST_DEBUG_CATEGORY_INIT (gst_base_src_debug, "basesrc", 0, "basesrc element");
+
g_type_class_add_private (klass, sizeof (GstBaseSrcPrivate));
parent_class = g_type_class_peek_parent (klass);
klass->event = GST_DEBUG_FUNCPTR (gst_base_src_default_event);
klass->do_seek = GST_DEBUG_FUNCPTR (gst_base_src_default_do_seek);
klass->query = GST_DEBUG_FUNCPTR (gst_base_src_default_query);
- klass->check_get_range =
- GST_DEBUG_FUNCPTR (gst_base_src_default_check_get_range);
klass->prepare_seek_segment =
GST_DEBUG_FUNCPTR (gst_base_src_default_prepare_seek_segment);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_event_handler);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_query);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_pad_get_range);
- GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_pad_check_get_range);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_getcaps);
- GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_setcaps);
GST_DEBUG_REGISTER_FUNCPTR (gst_base_src_fixate);
}
gst_pad_set_activatepull_function (pad, gst_base_src_activate_pull);
gst_pad_set_event_function (pad, gst_base_src_event_handler);
gst_pad_set_query_function (pad, gst_base_src_query);
- gst_pad_set_checkgetrange_function (pad, gst_base_src_pad_check_get_range);
gst_pad_set_getrange_function (pad, gst_base_src_pad_get_range);
gst_pad_set_getcaps_function (pad, gst_base_src_getcaps);
- gst_pad_set_setcaps_function (pad, gst_base_src_setcaps);
gst_pad_set_fixatecaps_function (pad, gst_base_src_fixate);
/* hold pointer to pad */
basesrc->clock_id = NULL;
/* we operate in BYTES by default */
gst_base_src_set_format (basesrc, GST_FORMAT_BYTES);
- basesrc->data.ABI.typefind = DEFAULT_TYPEFIND;
+ basesrc->typefind = DEFAULT_TYPEFIND;
basesrc->priv->do_timestamp = DEFAULT_DO_TIMESTAMP;
g_atomic_int_set (&basesrc->priv->have_events, FALSE);
g_mutex_free (basesrc->live_lock);
g_cond_free (basesrc->live_cond);
- event_p = &basesrc->data.ABI.pending_seek;
+ event_p = &basesrc->pending_seek;
gst_event_replace (event_p, NULL);
if (basesrc->priv->pending_events) {
GST_TIME_ARGS (stop), GST_TIME_ARGS (position));
GST_OBJECT_LOCK (src);
- if (src->data.ABI.running && !src->priv->newsegment_pending) {
- if (src->priv->close_segment)
- gst_event_unref (src->priv->close_segment);
- src->priv->close_segment =
- gst_event_new_new_segment_full (TRUE,
- src->segment.rate, src->segment.applied_rate, src->segment.format,
- src->segment.start, src->segment.last_stop, src->segment.time);
- }
- gst_segment_set_newsegment_full (&src->segment, FALSE, src->segment.rate,
- src->segment.applied_rate, src->segment.format, start, stop, position);
+ src->segment.base = gst_segment_to_running_time (&src->segment,
+ src->segment.format, src->segment.position);
+ src->segment.start = start;
+ src->segment.stop = stop;
+ src->segment.position = position;
- if (src->priv->start_segment)
- gst_event_unref (src->priv->start_segment);
- if (src->segment.rate >= 0.0) {
- /* forward, we send data from last_stop to stop */
- src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
- src->segment.rate, src->segment.applied_rate, src->segment.format,
- src->segment.last_stop, stop, src->segment.time);
- } else {
- /* reverse, we send data from last_stop to start */
- src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
- src->segment.rate, src->segment.applied_rate, src->segment.format,
- src->segment.start, src->segment.last_stop, src->segment.time);
- }
+ /* forward, we send data from position to stop */
+ src->priv->segment_pending = TRUE;
GST_OBJECT_UNLOCK (src);
src->priv->discont = TRUE;
- src->data.ABI.running = TRUE;
+ src->running = TRUE;
return res;
}
static gboolean
-gst_base_src_setcaps (GstPad * pad, GstCaps * caps)
+gst_base_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
{
GstBaseSrcClass *bclass;
- GstBaseSrc *bsrc;
gboolean res = TRUE;
- bsrc = GST_BASE_SRC (GST_PAD_PARENT (pad));
bclass = GST_BASE_SRC_GET_CLASS (bsrc);
+ gst_pad_push_event (bsrc->srcpad, gst_event_new_caps (caps));
+
if (bclass->set_caps)
res = bclass->set_caps (bsrc, caps);
}
static GstCaps *
-gst_base_src_getcaps (GstPad * pad)
+gst_base_src_getcaps (GstPad * pad, GstCaps * filter)
{
GstBaseSrcClass *bclass;
GstBaseSrc *bsrc;
bsrc = GST_BASE_SRC (GST_PAD_PARENT (pad));
bclass = GST_BASE_SRC_GET_CLASS (bsrc);
if (bclass->get_caps)
- caps = bclass->get_caps (bsrc);
+ caps = bclass->get_caps (bsrc, filter);
if (caps == NULL) {
GstPadTemplate *pad_template;
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (bclass), "src");
if (pad_template != NULL) {
- caps = gst_caps_ref (gst_pad_template_get_caps (pad_template));
+ caps = gst_pad_template_get_caps (pad_template);
+
+ if (filter) {
+ GstCaps *intersection;
+
+ intersection =
+ gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (caps);
+ caps = intersection;
+ }
}
}
return caps;
gint64 duration;
GST_OBJECT_LOCK (src);
- position = src->segment.last_stop;
+ position = src->segment.position;
duration = src->segment.duration;
GST_OBJECT_UNLOCK (src);
GST_OBJECT_LOCK (src);
position =
gst_segment_to_stream_time (&src->segment, src->segment.format,
- src->segment.last_stop);
+ src->segment.position);
seg_format = src->segment.format;
GST_OBJECT_UNLOCK (src);
gst_query_set_buffering_range (query, format, start, stop, estimated);
break;
}
+ case GST_QUERY_SCHEDULING:
+ {
+ gboolean random_access;
+
+ random_access = gst_base_src_is_random_access (src);
+
+ /* we can operate in getrange mode if the native format is bytes
+ * and we are seekable, this condition is set in the random_access
+ * flag and is set in the _start() method. */
+ gst_query_set_scheduling (query, random_access, TRUE, FALSE, 1, -1, 1);
+
+ res = TRUE;
+ break;
+ }
default:
res = FALSE;
break;
dest_format = segment->format;
if (seek_format == dest_format) {
- gst_segment_set_seek (segment, rate, seek_format, flags,
+ gst_segment_do_seek (segment, rate, seek_format, flags,
cur_type, cur, stop_type, stop, &update);
return TRUE;
}
}
/* And finally, configure our output segment in the desired format */
- gst_segment_set_seek (segment, rate, dest_format, flags, cur_type, cur,
+ gst_segment_do_seek (segment, rate, dest_format, flags, cur_type, cur,
stop_type, stop, &update);
if (!res)
} else {
/* The seek format matches our processing format, no need to ask the
* the subclass to configure the segment. */
- gst_segment_set_seek (&seeksegment, rate, seek_format, flags,
+ gst_segment_do_seek (&seeksegment, rate, seek_format, flags,
cur_type, cur, stop_type, stop, &update);
}
}
if (res) {
GST_DEBUG_OBJECT (src, "segment configured from %" G_GINT64_FORMAT
" to %" G_GINT64_FORMAT ", position %" G_GINT64_FORMAT,
- seeksegment.start, seeksegment.stop, seeksegment.last_stop);
+ seeksegment.start, seeksegment.stop, seeksegment.position);
- /* do the seek, segment.last_stop contains the new position. */
+ /* do the seek, segment.position contains the new position. */
res = gst_base_src_do_seek (src, &seeksegment);
}
/* send flush stop, peer will accept data and events again. We
* are not yet providing data as we still have the STREAM_LOCK. */
gst_pad_push_event (src->srcpad, tevent);
- } else if (res && src->data.ABI.running) {
- /* we are running the current segment and doing a non-flushing seek,
- * close the segment first based on the last_stop. */
- GST_DEBUG_OBJECT (src, "closing running segment %" G_GINT64_FORMAT
- " to %" G_GINT64_FORMAT, src->segment.start, src->segment.last_stop);
-
- /* queue the segment for sending in the stream thread */
- if (src->priv->close_segment)
- gst_event_unref (src->priv->close_segment);
- src->priv->close_segment =
- gst_event_new_new_segment_full (TRUE,
- src->segment.rate, src->segment.applied_rate, src->segment.format,
- src->segment.start, src->segment.last_stop, src->segment.time);
- gst_event_set_seqnum (src->priv->close_segment, seqnum);
}
/* The subclass must have converted the segment to the processing format
GstMessage *message;
message = gst_message_new_segment_start (GST_OBJECT (src),
- seeksegment.format, seeksegment.last_stop);
+ seeksegment.format, seeksegment.position);
gst_message_set_seqnum (message, seqnum);
gst_element_post_message (GST_ELEMENT (src), message);
if ((stop = seeksegment.stop) == -1)
stop = seeksegment.duration;
- GST_DEBUG_OBJECT (src, "Sending newsegment from %" G_GINT64_FORMAT
- " to %" G_GINT64_FORMAT, seeksegment.start, stop);
-
- /* now replace the old segment so that we send it in the stream thread the
- * next time it is scheduled. */
- if (src->priv->start_segment)
- gst_event_unref (src->priv->start_segment);
- if (seeksegment.rate >= 0.0) {
- /* forward, we send data from last_stop to stop */
- src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
- seeksegment.rate, seeksegment.applied_rate, seeksegment.format,
- seeksegment.last_stop, stop, seeksegment.time);
- } else {
- /* reverse, we send data from last_stop to start */
- src->priv->start_segment =
- gst_event_new_new_segment_full (FALSE,
- seeksegment.rate, seeksegment.applied_rate, seeksegment.format,
- seeksegment.start, seeksegment.last_stop, seeksegment.time);
- }
- gst_event_set_seqnum (src->priv->start_segment, seqnum);
- src->priv->newsegment_pending = TRUE;
+ src->priv->segment_pending = TRUE;
}
src->priv->discont = TRUE;
- src->data.ABI.running = TRUE;
+ src->running = TRUE;
/* and restart the task in case it got paused explicitly or by
* the FLUSH_START event we pushed out. */
tres = gst_pad_start_task (src->srcpad, (GstTaskFunction) gst_base_src_loop,
result = TRUE;
break;
}
- case GST_EVENT_NEWSEGMENT:
- /* sending random NEWSEGMENT downstream can break sync. */
+ case GST_EVENT_SEGMENT:
+ /* sending random SEGMENT downstream can break sync. */
break;
case GST_EVENT_TAG:
case GST_EVENT_CUSTOM_DOWNSTREAM:
* get activated */
GST_OBJECT_LOCK (src);
GST_DEBUG_OBJECT (src, "queueing seek");
- event_p = &src->data.ABI.pending_seek;
+ event_p = &src->pending_seek;
gst_event_replace ((GstEvent **) event_p, event);
GST_OBJECT_UNLOCK (src);
/* assume the seek will work */
GstClockTimeDiff diff;
GstClockTime timestamp;
- gst_event_parse_qos (event, &proportion, &diff, ×tamp);
+ gst_event_parse_qos (event, NULL, &proportion, &diff, ×tamp);
gst_base_src_update_qos (src, proportion, diff, timestamp);
result = TRUE;
break;
src->num_buffers = g_value_get_int (value);
break;
case PROP_TYPEFIND:
- src->data.ABI.typefind = g_value_get_boolean (value);
+ src->typefind = g_value_get_boolean (value);
break;
case PROP_DO_TIMESTAMP:
gst_base_src_set_do_timestamp (src, g_value_get_boolean (value));
g_value_set_int (value, src->num_buffers);
break;
case PROP_TYPEFIND:
- g_value_set_boolean (value, src->data.ABI.typefind);
+ g_value_set_boolean (value, src->typefind);
break;
case PROP_DO_TIMESTAMP:
g_value_set_boolean (value, gst_base_src_get_do_timestamp (src));
GstBaseSrcClass *bclass;
GstFormat format;
gint64 stop;
+ gboolean updated = FALSE;
bclass = GST_BASE_SRC_GET_CLASS (src);
/* keep track of current position and update duration.
* segment is in bytes, we checked that above. */
GST_OBJECT_LOCK (src);
- gst_segment_set_duration (&src->segment, GST_FORMAT_BYTES, size);
- gst_segment_set_last_stop (&src->segment, GST_FORMAT_BYTES, offset);
+ updated = (src->segment.duration != size);
+ src->segment.duration = size;
+ src->segment.position = offset;
GST_OBJECT_UNLOCK (src);
+ /* If we updated the duration and doing forward playback, we
+ * have to update the downstream segments to update the stop
+ * position */
+ if (updated && src->segment.rate >= 0.0) {
+ gint64 stop;
+ GstEvent *event;
+
+ /* for deriving a stop position for the playback segment from the seek
+ * segment, we must take the duration when the stop is not set */
+ if ((stop = src->segment.stop) == -1)
+ stop = src->segment.duration;
+
+ GST_DEBUG_OBJECT (src, "Sending update newsegment from %" G_GINT64_FORMAT
+ " to %" G_GINT64_FORMAT, src->segment.start, stop);
+
+ event =
+ gst_event_new_new_segment_full (TRUE,
+ src->segment.rate, src->segment.applied_rate, src->segment.format,
+ src->segment.start, stop, src->segment.time);
+ gst_pad_push_event (src->srcpad, event);
+ }
+
return TRUE;
/* ERRORS */
/* no timestamp set and we are at offset 0, we can timestamp with 0 */
if (offset == 0 && src->segment.time == 0
&& GST_BUFFER_TIMESTAMP (*buf) == -1 && !src->is_live) {
- *buf = gst_buffer_make_metadata_writable (*buf);
+ *buf = gst_buffer_make_writable (*buf);
GST_BUFFER_TIMESTAMP (*buf) = 0;
}
- /* set pad caps on the buffer if the buffer had no caps */
- if (GST_BUFFER_CAPS (*buf) == NULL) {
- *buf = gst_buffer_make_metadata_writable (*buf);
- gst_buffer_set_caps (*buf, GST_PAD_CAPS (src->srcpad));
- }
-
/* now sync before pushing the buffer */
status = gst_base_src_do_sync (src, *buf);
}
static gboolean
-gst_base_src_default_check_get_range (GstBaseSrc * src)
+gst_base_src_is_random_access (GstBaseSrc * src)
{
- gboolean res;
-
+ /* we need to start the basesrc to check random access */
if (!GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED)) {
GST_LOG_OBJECT (src, "doing start/stop to check get_range support");
if (G_LIKELY (gst_base_src_start (src)))
gst_base_src_stop (src);
}
- /* we can operate in getrange mode if the native format is bytes
- * and we are seekable, this condition is set in the random_access
- * flag and is set in the _start() method. */
- res = src->random_access;
-
- return res;
-}
-
-static gboolean
-gst_base_src_check_get_range (GstBaseSrc * src)
-{
- GstBaseSrcClass *bclass;
- gboolean res;
-
- bclass = GST_BASE_SRC_GET_CLASS (src);
-
- if (bclass->check_get_range == NULL)
- goto no_function;
-
- res = bclass->check_get_range (src);
- GST_LOG_OBJECT (src, "%s() returned %d",
- GST_DEBUG_FUNCPTR_NAME (bclass->check_get_range), (gint) res);
-
- return res;
-
- /* ERRORS */
-no_function:
- {
- GST_WARNING_OBJECT (src, "no check_get_range function set");
- return FALSE;
- }
-}
-
-static gboolean
-gst_base_src_pad_check_get_range (GstPad * pad)
-{
- GstBaseSrc *src;
- gboolean res;
-
- src = GST_BASE_SRC (GST_OBJECT_PARENT (pad));
-
- res = gst_base_src_check_get_range (src);
-
- return res;
+ return src->random_access;
}
static void
gboolean eos;
gulong blocksize;
GList *pending_events = NULL, *tmp;
+ gboolean reconfigure;
eos = FALSE;
src = GST_BASE_SRC (GST_OBJECT_PARENT (pad));
+ GST_OBJECT_LOCK (pad);
+ reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
+ GST_OBJECT_FLAG_UNSET (pad, GST_PAD_NEED_RECONFIGURE);
+ GST_OBJECT_UNLOCK (pad);
+
+ /* check if we need to renegotiate */
+ if (reconfigure) {
+ if (!gst_base_src_negotiate (src))
+ GST_DEBUG_OBJECT (src, "Failed to renegotiate");
+ }
+
GST_LIVE_LOCK (src);
if (G_UNLIKELY (src->priv->flushing))
/* if we operate in bytes, we can calculate an offset */
if (src->segment.format == GST_FORMAT_BYTES) {
- position = src->segment.last_stop;
+ position = src->segment.position;
/* for negative rates, start with subtracting the blocksize */
if (src->segment.rate < 0.0) {
/* we cannot go below segment.start */
goto null_buffer;
/* push events to close/start our segment before we push the buffer. */
- if (G_UNLIKELY (src->priv->close_segment)) {
- gst_pad_push_event (pad, src->priv->close_segment);
- src->priv->close_segment = NULL;
- }
- if (G_UNLIKELY (src->priv->start_segment)) {
- gst_pad_push_event (pad, src->priv->start_segment);
- src->priv->start_segment = NULL;
+ if (G_UNLIKELY (src->priv->segment_pending)) {
+ gst_pad_push_event (pad, gst_event_new_segment (&src->segment));
+ src->priv->segment_pending = FALSE;
}
- src->priv->newsegment_pending = FALSE;
if (g_atomic_int_get (&src->priv->have_events)) {
GST_OBJECT_LOCK (src);
switch (src->segment.format) {
case GST_FORMAT_BYTES:
{
- guint bufsize = GST_BUFFER_SIZE (buf);
+ guint bufsize = gst_buffer_get_size (buf);
/* we subtracted above for negative rates */
if (src->segment.rate >= 0.0)
if (GST_CLOCK_TIME_IS_VALID (start))
position = start;
else
- position = src->segment.last_stop;
+ position = src->segment.position;
if (GST_CLOCK_TIME_IS_VALID (duration)) {
if (src->segment.rate >= 0.0)
src->priv->discont = TRUE;
}
GST_OBJECT_LOCK (src);
- gst_segment_set_last_stop (&src->segment, src->segment.format, position);
+ src->segment.position = position;
GST_OBJECT_UNLOCK (src);
}
if (G_UNLIKELY (src->priv->discont)) {
- buf = gst_buffer_make_metadata_writable (buf);
+ buf = gst_buffer_make_writable (buf);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
src->priv->discont = FALSE;
}
GstEvent *event;
GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
- src->data.ABI.running = FALSE;
+ src->running = FALSE;
gst_pad_pause_task (pad);
if (ret == GST_FLOW_UNEXPECTED) {
gboolean flag_segment;
GstFormat format;
- gint64 last_stop;
+ gint64 position;
/* perform EOS logic */
flag_segment = (src->segment.flags & GST_SEEK_FLAG_SEGMENT) != 0;
format = src->segment.format;
- last_stop = src->segment.last_stop;
+ position = src->segment.position;
if (flag_segment) {
GstMessage *message;
message = gst_message_new_segment_done (GST_OBJECT_CAST (src),
- format, last_stop);
+ format, position);
gst_message_set_seqnum (message, src->priv->seqnum);
gst_element_post_message (GST_ELEMENT_CAST (src), message);
} else {
gboolean result = FALSE;
/* first see what is possible on our source pad */
- thiscaps = gst_pad_get_caps_reffed (GST_BASE_SRC_PAD (basesrc));
+ thiscaps = gst_pad_get_caps (GST_BASE_SRC_PAD (basesrc), NULL);
GST_DEBUG_OBJECT (basesrc, "caps of src: %" GST_PTR_FORMAT, thiscaps);
/* nothing or anything is allowed, we're done */
if (thiscaps == NULL || gst_caps_is_any (thiscaps))
goto no_caps;
/* get the peer caps */
- peercaps = gst_pad_peer_get_caps_reffed (GST_BASE_SRC_PAD (basesrc));
+ peercaps = gst_pad_peer_get_caps (GST_BASE_SRC_PAD (basesrc), thiscaps);
GST_DEBUG_OBJECT (basesrc, "caps of peer: %" GST_PTR_FORMAT, peercaps);
if (peercaps) {
- /* get intersection */
- caps =
- gst_caps_intersect_full (peercaps, thiscaps, GST_CAPS_INTERSECT_FIRST);
- GST_DEBUG_OBJECT (basesrc, "intersect: %" GST_PTR_FORMAT, caps);
- gst_caps_unref (peercaps);
+ /* The result is already a subset of our caps */
+ caps = peercaps;
+ gst_caps_unref (thiscaps);
} else {
/* no peer, work with our own caps then */
- caps = gst_caps_copy (thiscaps);
+ caps = thiscaps;
}
- gst_caps_unref (thiscaps);
- if (caps) {
+ if (caps && !gst_caps_is_empty (caps)) {
+ caps = gst_caps_make_writable (caps);
+
/* take first (and best, since they are sorted) possibility */
gst_caps_truncate (caps);
/* now fixate */
- if (!gst_caps_is_empty (caps)) {
+ GST_DEBUG_OBJECT (basesrc, "have caps: %" GST_PTR_FORMAT, caps);
+ if (gst_caps_is_any (caps)) {
+ /* hmm, still anything, so element can do anything and
+ * nego is not needed */
+ result = TRUE;
+ } else {
gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps);
GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps);
-
- if (gst_caps_is_any (caps)) {
- /* hmm, still anything, so element can do anything and
- * nego is not needed */
- result = TRUE;
- } else if (gst_caps_is_fixed (caps)) {
+ if (gst_caps_is_fixed (caps)) {
/* yay, fixed caps, use those then, it's possible that the subclass does
* not accept this caps after all and we have to fail. */
- result = gst_pad_set_caps (GST_BASE_SRC_PAD (basesrc), caps);
+ result = gst_base_src_setcaps (basesrc, caps);
}
}
gst_caps_unref (caps);
gst_segment_init (&basesrc->segment, basesrc->segment.format);
GST_OBJECT_UNLOCK (basesrc);
- basesrc->data.ABI.running = FALSE;
- basesrc->priv->newsegment_pending = FALSE;
+ basesrc->running = FALSE;
+ basesrc->priv->segment_pending = FALSE;
bclass = GST_BASE_SRC_GET_CLASS (basesrc);
if (bclass->start)
/* only update the size when operating in bytes, subclass is supposed
* to set duration in the start method for other formats */
GST_OBJECT_LOCK (basesrc);
- gst_segment_set_duration (&basesrc->segment, GST_FORMAT_BYTES, size);
+ basesrc->segment.duration = size;
GST_OBJECT_UNLOCK (basesrc);
} else {
size = -1;
GST_DEBUG_OBJECT (basesrc, "is random_access: %d", basesrc->random_access);
/* run typefind if we are random_access and the typefinding is enabled. */
- if (basesrc->random_access && basesrc->data.ABI.typefind && size != -1) {
+ if (basesrc->random_access && basesrc->typefind && size != -1) {
GstCaps *caps;
if (!(caps = gst_type_find_helper (basesrc->srcpad, size)))
goto typefind_failed;
- result = gst_pad_set_caps (basesrc->srcpad, caps);
+ result = gst_base_src_setcaps (basesrc, caps);
gst_caps_unref (caps);
} else {
/* use class or default negotiate function */
/* do initial seek, which will start the task */
GST_OBJECT_LOCK (basesrc);
- event = basesrc->data.ABI.pending_seek;
- basesrc->data.ABI.pending_seek = NULL;
+ event = basesrc->pending_seek;
+ basesrc->pending_seek = NULL;
GST_OBJECT_UNLOCK (basesrc);
/* no need to unlock anything, the task is certainly
goto error_start;
/* if not random_access, we cannot operate in pull mode for now */
- if (G_UNLIKELY (!gst_base_src_check_get_range (basesrc)))
+ if (G_UNLIKELY (!gst_base_src_is_random_access (basesrc)))
goto no_get_range;
/* stop flushing now but for live sources, still block in the LIVE lock when
basesrc->priv->last_sent_eos = TRUE;
}
g_atomic_int_set (&basesrc->priv->pending_eos, FALSE);
- event_p = &basesrc->data.ABI.pending_seek;
- gst_event_replace (event_p, NULL);
- event_p = &basesrc->priv->close_segment;
- gst_event_replace (event_p, NULL);
- event_p = &basesrc->priv->start_segment;
+ event_p = &basesrc->pending_seek;
gst_event_replace (event_p, NULL);
break;
}
GST_END_TEST;
-GST_START_TEST (test_buffer)
-{
- GstCaps *c1;
- GstBuffer *buffer;
-
- buffer = gst_buffer_new_and_alloc (1000);
- c1 = gst_caps_new_simple ("audio/x-raw-int",
- "buffer", GST_TYPE_BUFFER, buffer, NULL);
-
- GST_DEBUG ("caps: %" GST_PTR_FORMAT, c1);
- gst_buffer_unref (buffer);
-
- buffer = gst_buffer_new_and_alloc (1000);
- gst_buffer_set_caps (buffer, c1); /* doesn't give away our c1 ref */
-
- gst_caps_unref (c1);
- gst_buffer_unref (buffer); /* Should now drop both references */
-}
-
-GST_END_TEST;
-
GST_START_TEST (test_double_append)
{
GstStructure *s1;
GST_END_TEST;
+ GST_START_TEST (test_subset)
+ {
+ GstCaps *c1, *c2;
+
+ c1 = gst_caps_from_string ("video/x-raw-yuv; video/x-raw-rgb");
+ c2 = gst_caps_from_string ("video/x-raw-yuv, format=(fourcc)YUY2");
+ fail_unless (gst_caps_is_subset (c2, c1));
+ fail_if (gst_caps_is_subset (c1, c2));
+ gst_caps_unref (c1);
+ gst_caps_unref (c2);
+
+ c1 = gst_caps_from_string
+ ("audio/x-raw-int, channels=(int)[ 1, 2 ], rate=(int)44100");
+ c2 = gst_caps_from_string
+ ("audio/x-raw-int, channels=(int)1, rate=(int)44100");
+ fail_unless (gst_caps_is_subset (c2, c1));
+ fail_if (gst_caps_is_subset (c1, c2));
+ gst_caps_unref (c1);
+ gst_caps_unref (c2);
+ }
+
+ GST_END_TEST;
+
GST_START_TEST (test_merge_fundamental)
{
GstCaps *c1, *c2;
fail_unless (gst_caps_is_subset (test, c2));
gst_caps_unref (test);
gst_caps_unref (c2);
+
+ c2 = gst_caps_from_string ("audio/x-raw-int");
+ c1 = gst_caps_from_string ("audio/x-raw-int,channels=1");
+ gst_caps_merge (c2, c1);
+ GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2);
+ fail_unless (gst_caps_get_size (c2) == 1, NULL);
+ test = gst_caps_from_string ("audio/x-raw-int");
+ fail_unless (gst_caps_is_equal (c2, test));
+ gst_caps_unref (c2);
+ gst_caps_unref (test);
+
+ c2 = gst_caps_from_string ("audio/x-raw-int,channels=1");
+ c1 = gst_caps_from_string ("audio/x-raw-int");
+ gst_caps_merge (c2, c1);
+ GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2);
+ fail_unless (gst_caps_get_size (c2) == 2, NULL);
+ test = gst_caps_from_string ("audio/x-raw-int,channels=1; audio/x-raw-int");
+ fail_unless (gst_caps_is_equal (c2, test));
+ gst_caps_unref (c2);
+ gst_caps_unref (test);
}
GST_END_TEST;
tcase_add_test (tc_chain, test_from_string);
tcase_add_test (tc_chain, test_double_append);
tcase_add_test (tc_chain, test_mutability);
- tcase_add_test (tc_chain, test_buffer);
tcase_add_test (tc_chain, test_static_caps);
tcase_add_test (tc_chain, test_simplify);
tcase_add_test (tc_chain, test_truncate);
+ tcase_add_test (tc_chain, test_subset);
tcase_add_test (tc_chain, test_merge_fundamental);
tcase_add_test (tc_chain, test_merge_same);
tcase_add_test (tc_chain, test_merge_subset);
__gst_debug_min DATA
_gst_alloc_trace_register
_gst_buffer_list_initialize
+ _gst_buffer_list_type DATA
+ _gst_buffer_type DATA
+ _gst_caps_type DATA
_gst_debug_bin_to_dot_file
_gst_debug_bin_to_dot_file_with_ts
_gst_debug_category_new
_gst_disable_registry_cache DATA
_gst_element_error_printf
_gst_elementclass_factory DATA
+ _gst_event_type DATA
_gst_plugin_loader_client_run
- _gst_plugin_register_static
+ _gst_structure_type DATA
_gst_trace_add_entry
_gst_trace_mutex DATA
_gst_trace_on DATA
gst_alloc_trace_set_flags
gst_alloc_trace_set_flags_all
gst_assoc_flags_get_type
- gst_atomic_int_set
gst_atomic_queue_length
gst_atomic_queue_new
gst_atomic_queue_peek
gst_atomic_queue_unref
gst_bin_add
gst_bin_add_many
- gst_bin_find_unconnected_pad
gst_bin_find_unlinked_pad
gst_bin_flags_get_type
gst_bin_get_by_interface
gst_bin_recalculate_latency
gst_bin_remove
gst_bin_remove_many
+ gst_buffer_add_meta
gst_buffer_copy_flags_get_type
- gst_buffer_copy_metadata
- gst_buffer_create_sub
+ gst_buffer_copy_into
+ gst_buffer_copy_region
+ gst_buffer_extract
+ gst_buffer_fill
gst_buffer_flag_get_type
- gst_buffer_get_caps
- gst_buffer_get_type
- gst_buffer_is_metadata_writable
+ gst_buffer_get_meta
+ gst_buffer_get_size
gst_buffer_is_span_fast
+ gst_buffer_iterate_meta
gst_buffer_join
gst_buffer_list_foreach
gst_buffer_list_get
- gst_buffer_list_get_type
- gst_buffer_list_item_get_type
- gst_buffer_list_iterate
- gst_buffer_list_iterator_add
- gst_buffer_list_iterator_add_group
- gst_buffer_list_iterator_add_list
- gst_buffer_list_iterator_do
- gst_buffer_list_iterator_free
- gst_buffer_list_iterator_get_type
- gst_buffer_list_iterator_merge_group
- gst_buffer_list_iterator_n_buffers
- gst_buffer_list_iterator_next
- gst_buffer_list_iterator_next_group
- gst_buffer_list_iterator_remove
- gst_buffer_list_iterator_steal
- gst_buffer_list_iterator_take
- gst_buffer_list_n_groups
+ gst_buffer_list_insert
+ gst_buffer_list_len
gst_buffer_list_new
- gst_buffer_make_metadata_writable
+ gst_buffer_list_remove
+ gst_buffer_list_sized_new
+ gst_buffer_map
+ gst_buffer_memcmp
gst_buffer_merge
+ gst_buffer_n_memory
gst_buffer_new
gst_buffer_new_and_alloc
- gst_buffer_set_caps
+ gst_buffer_peek_memory
+ gst_buffer_pool_acquire_buffer
+ gst_buffer_pool_config_get
+ gst_buffer_pool_config_set
+ gst_buffer_pool_flags_get_type
+ gst_buffer_pool_get_config
+ gst_buffer_pool_get_type
+ gst_buffer_pool_new
+ gst_buffer_pool_release_buffer
+ gst_buffer_pool_set_active
+ gst_buffer_pool_set_config
+ gst_buffer_remove_memory_range
+ gst_buffer_remove_meta
+ gst_buffer_resize
gst_buffer_span
- gst_buffer_stamp
- gst_buffer_try_new_and_alloc
+ gst_buffer_take_memory
+ gst_buffer_unmap
gst_buffering_mode_get_type
gst_bus_add_signal_watch
gst_bus_add_signal_watch_full
gst_caps_append
gst_caps_append_structure
gst_caps_can_intersect
- gst_caps_copy
gst_caps_copy_nth
gst_caps_do_simplify
gst_caps_flags_get_type
gst_caps_from_string
gst_caps_get_size
gst_caps_get_structure
- gst_caps_get_type
gst_caps_intersect
gst_caps_intersect_full
gst_caps_intersect_mode_get_type
gst_caps_is_equal_fixed
gst_caps_is_fixed
gst_caps_is_subset
- gst_caps_load_thyself
+ gst_caps_is_subset_structure
gst_caps_make_writable
gst_caps_merge
gst_caps_merge_structure
gst_caps_new_full_valist
gst_caps_new_simple
gst_caps_normalize
- gst_caps_ref
gst_caps_remove_structure
gst_caps_replace
- gst_caps_save_thyself
gst_caps_set_simple
gst_caps_set_simple_valist
gst_caps_set_value
gst_caps_to_string
gst_caps_truncate
gst_caps_union
- gst_caps_unref
gst_child_proxy_child_added
gst_child_proxy_child_removed
gst_child_proxy_get
gst_child_proxy_set
gst_child_proxy_set_property
gst_child_proxy_set_valist
- gst_class_signal_connect
- gst_class_signal_emit_by_name
gst_clock_add_observation
gst_clock_adjust_unlocked
gst_clock_entry_type_get_type
gst_element_abort_state
gst_element_add_pad
gst_element_change_state
+ gst_element_class_add_metadata
gst_element_class_add_pad_template
gst_element_class_get_pad_template
gst_element_class_get_pad_template_list
gst_element_class_install_std_props
- gst_element_class_set_details
- gst_element_class_set_details_simple
- gst_element_class_set_documentation_uri
- gst_element_class_set_icon_name
+ gst_element_class_set_metadata
gst_element_continue_state
gst_element_create_all_pads
gst_element_factory_can_sink_all_caps
gst_element_factory_can_sink_any_caps
- gst_element_factory_can_sink_caps
gst_element_factory_can_src_all_caps
gst_element_factory_can_src_any_caps
- gst_element_factory_can_src_caps
gst_element_factory_create
gst_element_factory_find
- gst_element_factory_get_author
- gst_element_factory_get_description
- gst_element_factory_get_documentation_uri
gst_element_factory_get_element_type
- gst_element_factory_get_icon_name
- gst_element_factory_get_klass
- gst_element_factory_get_longname
+ gst_element_factory_get_metadata
gst_element_factory_get_num_pad_templates
gst_element_factory_get_static_pad_templates
gst_element_factory_get_type
gst_element_link_pads_filtered
gst_element_link_pads_full
gst_element_lost_state
- gst_element_lost_state_full
gst_element_make_from_uri
gst_element_message_full
gst_element_no_more_pads
gst_element_unlink_many
gst_element_unlink_pads
gst_error_get_message
+ gst_event_copy_segment
gst_event_get_seqnum
gst_event_get_structure
- gst_event_get_type
gst_event_has_name
gst_event_new_buffer_size
+ gst_event_new_caps
gst_event_new_custom
gst_event_new_eos
gst_event_new_flush_start
gst_event_new_flush_stop
gst_event_new_latency
gst_event_new_navigation
- gst_event_new_new_segment
- gst_event_new_new_segment_full
gst_event_new_qos
- gst_event_new_qos_full
+ gst_event_new_reconfigure
gst_event_new_seek
+ gst_event_new_segment
gst_event_new_sink_message
gst_event_new_step
gst_event_new_tag
gst_event_parse_buffer_size
+ gst_event_parse_caps
gst_event_parse_latency
- gst_event_parse_new_segment
- gst_event_parse_new_segment_full
gst_event_parse_qos
- gst_event_parse_qos_full
gst_event_parse_seek
+ gst_event_parse_segment
gst_event_parse_sink_message
gst_event_parse_step
gst_event_parse_tag
gst_event_type_get_name
gst_event_type_get_type
gst_event_type_to_quark
+ gst_event_writable_structure
gst_filename_to_uri
gst_filter_run
gst_flow_get_name
gst_int_range_get_type
gst_is_initialized
gst_is_tag_list
+ gst_iterator_copy
gst_iterator_filter
gst_iterator_find_custom
gst_iterator_fold
gst_iterator_foreach
gst_iterator_free
+ gst_iterator_get_type
gst_iterator_item_get_type
gst_iterator_new
gst_iterator_new_list
gst_iterator_resync
gst_library_error_get_type
gst_library_error_quark
+ gst_map_flags_get_type
+ gst_marshal_BOOLEAN__BOXED
gst_marshal_BOOLEAN__POINTER
gst_marshal_BOOLEAN__VOID
gst_marshal_BOXED__BOXED
gst_marshal_VOID__OBJECT_STRING
gst_marshal_VOID__POINTER_OBJECT
gst_marshal_VOID__UINT_BOXED
+ gst_memory_copy
+ gst_memory_flags_get_type
+ gst_memory_get_sizes
+ gst_memory_is_span
+ gst_memory_map
+ gst_memory_new_alloc
+ gst_memory_new_wrapped
+ gst_memory_ref
+ gst_memory_register
+ gst_memory_resize
+ gst_memory_share
+ gst_memory_unmap
+ gst_memory_unref
gst_message_get_seqnum
gst_message_get_stream_status_object
gst_message_get_structure
gst_message_get_type
+ gst_message_has_name
gst_message_new_application
gst_message_new_async_done
gst_message_new_async_start
gst_message_type_get_name
gst_message_type_get_type
gst_message_type_to_quark
+ gst_meta_get_info
+ gst_meta_register
+ gst_meta_timing_get_info
gst_mini_object_copy
gst_mini_object_flags_get_type
- gst_mini_object_get_type
+ gst_mini_object_init
gst_mini_object_is_writable
gst_mini_object_make_writable
- gst_mini_object_new
gst_mini_object_ref
+ gst_mini_object_register
gst_mini_object_replace
gst_mini_object_unref
gst_mini_object_weak_ref
gst_object_default_error
gst_object_flags_get_type
gst_object_get_name
- gst_object_get_name_prefix
gst_object_get_parent
gst_object_get_path_string
gst_object_get_type
gst_object_ref
gst_object_ref_sink
gst_object_replace
- gst_object_restore_thyself
- gst_object_save_thyself
gst_object_set_name
- gst_object_set_name_prefix
gst_object_set_parent
- gst_object_sink
gst_object_unparent
gst_object_unref
gst_pad_accept_caps
gst_pad_add_data_probe_full
gst_pad_add_event_probe
gst_pad_add_event_probe_full
- gst_pad_alloc_buffer
- gst_pad_alloc_buffer_and_set_caps
gst_pad_can_link
gst_pad_chain
gst_pad_chain_list
gst_pad_flags_get_type
gst_pad_get_allowed_caps
gst_pad_get_caps
- gst_pad_get_caps_reffed
+ gst_pad_get_current_caps
gst_pad_get_direction
gst_pad_get_element_private
- gst_pad_get_fixed_caps_func
- gst_pad_get_internal_links
- gst_pad_get_internal_links_default
gst_pad_get_negotiated_caps
gst_pad_get_pad_template
gst_pad_get_pad_template_caps
gst_pad_get_query_types
gst_pad_get_query_types_default
gst_pad_get_range
+ gst_pad_get_sticky_event
gst_pad_get_type
+ gst_pad_has_current_caps
gst_pad_is_active
gst_pad_is_blocked
gst_pad_is_blocking
gst_pad_link_check_get_type
gst_pad_link_full
gst_pad_link_return_get_type
- gst_pad_load_and_link
gst_pad_new
gst_pad_new_from_static_template
gst_pad_new_from_template
gst_pad_pause_task
gst_pad_peer_accept_caps
gst_pad_peer_get_caps
- gst_pad_peer_get_caps_reffed
gst_pad_peer_query
gst_pad_presence_get_type
gst_pad_proxy_getcaps
gst_pad_set_blocked
gst_pad_set_blocked_async
gst_pad_set_blocked_async_full
- gst_pad_set_bufferalloc_function
gst_pad_set_caps
gst_pad_set_chain_function
gst_pad_set_chain_list_function
gst_pad_set_fixatecaps_function
gst_pad_set_getcaps_function
gst_pad_set_getrange_function
- gst_pad_set_internal_link_function
gst_pad_set_iterate_internal_links_function
gst_pad_set_link_function
gst_pad_set_query_function
gst_pad_use_fixed_caps
gst_param_spec_fraction
gst_param_spec_fraction_get_type
- gst_param_spec_mini_object
- gst_param_spec_mini_object_get_type
gst_parse_bin_from_description
gst_parse_bin_from_description_full
gst_parse_context_free
gst_pipeline_get_bus
gst_pipeline_get_clock
gst_pipeline_get_delay
- gst_pipeline_get_last_stream_time
gst_pipeline_get_type
gst_pipeline_new
gst_pipeline_set_auto_flush_bus
gst_pipeline_set_clock
gst_pipeline_set_delay
- gst_pipeline_set_new_stream_time
gst_pipeline_use_clock
gst_plugin_add_dependency
gst_plugin_add_dependency_simple
gst_print_pad_caps
gst_progress_type_get_type
gst_proxy_pad_acceptcaps_default
- gst_proxy_pad_bufferalloc_default
gst_proxy_pad_chain_default
gst_proxy_pad_chain_list_default
gst_proxy_pad_checkgetrange_default
gst_proxy_pad_setcaps_default
gst_proxy_pad_unlink_default
gst_qos_type_get_type
+ gst_query_add_allocation_meta
gst_query_add_buffering_range
+ gst_query_get_n_allocation_metas
gst_query_get_n_buffering_ranges
gst_query_get_structure
gst_query_get_type
- gst_query_new_application
+ gst_query_new_allocation
gst_query_new_buffering
gst_query_new_convert
+ gst_query_new_custom
gst_query_new_duration
gst_query_new_formats
gst_query_new_latency
gst_query_new_seeking
gst_query_new_segment
gst_query_new_uri
+ gst_query_parse_allocation
+ gst_query_parse_allocation_params
gst_query_parse_buffering_percent
gst_query_parse_buffering_range
gst_query_parse_buffering_stats
gst_query_parse_convert
gst_query_parse_duration
- gst_query_parse_formats_length
- gst_query_parse_formats_nth
gst_query_parse_latency
+ gst_query_parse_n_formats
+ gst_query_parse_nth_allocation_meta
gst_query_parse_nth_buffering_range
+ gst_query_parse_nth_format
gst_query_parse_position
gst_query_parse_seeking
gst_query_parse_segment
gst_query_parse_uri
+ gst_query_set_allocation_params
gst_query_set_buffering_percent
gst_query_set_buffering_range
gst_query_set_buffering_stats
gst_query_type_register
gst_query_type_to_quark
gst_query_types_contains
+ gst_query_writable_structure
gst_rank_get_type
gst_registry_add_feature
gst_registry_add_path
gst_registry_remove_feature
gst_registry_remove_plugin
gst_registry_scan_path
- gst_registry_xml_read_cache
- gst_registry_xml_write_cache
gst_resource_error_get_type
gst_resource_error_quark
gst_search_mode_get_type
gst_seek_type_get_type
gst_segment_clip
gst_segment_copy
+ gst_segment_copy_into
+ gst_segment_do_seek
gst_segment_free
gst_segment_get_type
gst_segment_init
gst_segment_new
- gst_segment_set_duration
- gst_segment_set_last_stop
- gst_segment_set_newsegment
- gst_segment_set_newsegment_full
gst_segment_set_running_time
- gst_segment_set_seek
gst_segment_to_position
gst_segment_to_running_time
gst_segment_to_stream_time
gst_structure_get_name
gst_structure_get_name_id
gst_structure_get_string
- gst_structure_get_type
gst_structure_get_uint
gst_structure_get_valist
gst_structure_get_value
gst_structure_id_take_value
gst_structure_intersect
gst_structure_is_equal
+ gst_structure_is_subset
gst_structure_map_in_place
gst_structure_n_fields
gst_structure_new
gst_value_can_union
gst_value_compare
gst_value_deserialize
- gst_value_dup_mini_object
gst_value_fraction_multiply
gst_value_fraction_subtract
gst_value_get_caps
gst_value_get_int64_range_min
gst_value_get_int_range_max
gst_value_get_int_range_min
- gst_value_get_mini_object
gst_value_get_structure
gst_value_init_and_copy
gst_value_intersect
gst_value_set_fraction_range_full
gst_value_set_int64_range
gst_value_set_int_range
- gst_value_set_mini_object
gst_value_set_structure
gst_value_subtract
- gst_value_take_mini_object
gst_value_union
gst_version
gst_version_string
- gst_xml_get_element
- gst_xml_get_topelements
- gst_xml_get_type
- gst_xml_make_element
- gst_xml_new
- gst_xml_parse_doc
- gst_xml_parse_file
- gst_xml_parse_memory
- gst_xml_write
- gst_xml_write_file