<FILE>gsttoc</FILE>
<TITLE>GstToc</TITLE>
GstToc
+GstTocScope
GstTocEntry
GstTocEntryType
gst_toc_new
gst_toc_unref
gst_toc_copy
gst_toc_make_writable
+gst_toc_get_scope
gst_toc_get_entries
gst_toc_append_entry
gst_toc_get_tags
g_type_class_ref (gst_scheduling_flags_get_type ());
g_type_class_ref (gst_meta_flags_get_type ());
g_type_class_ref (gst_toc_entry_type_get_type ());
-
+ g_type_class_ref (gst_toc_scope_get_type ());
g_type_class_ref (gst_control_binding_get_type ());
g_type_class_ref (gst_control_source_get_type ());
g_type_class_ref (gst_lock_flags_get_type ());
g_type_class_unref (g_type_class_peek (gst_tag_flag_get_type ()));
g_type_class_unref (g_type_class_peek (gst_task_state_get_type ()));
g_type_class_unref (g_type_class_peek (gst_toc_entry_type_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_toc_scope_get_type ()));
g_type_class_unref (g_type_class_peek (gst_type_find_probability_get_type
()));
g_type_class_unref (g_type_class_peek (gst_uri_type_get_type ()));
{
GstMiniObject mini_object;
+ GstTocScope scope;
GList *entries;
GstTagList *tags;
};
/**
* gst_toc_new:
+ * @scope: scope of this TOC
*
* Create a new #GstToc structure.
*
* with gst_toc_unref().
*/
GstToc *
-gst_toc_new (void)
+gst_toc_new (GstTocScope scope)
{
GstToc *toc;
+ g_return_val_if_fail (scope == GST_TOC_SCOPE_GLOBAL ||
+ scope == GST_TOC_SCOPE_CURRENT, NULL);
+
toc = g_slice_new0 (GstToc);
gst_mini_object_init (GST_MINI_OBJECT_CAST (toc), 0, GST_TYPE_TOC,
(GstMiniObjectCopyFunction) gst_toc_copy, NULL,
(GstMiniObjectFreeFunction) gst_toc_free);
+ toc->scope = scope;
toc->tags = gst_tag_list_new_empty ();
return toc;
}
/**
+ * gst_toc_get_scope:
+ * @toc: a #GstToc instance
+ *
+ * Returns: scope of @toc
+ */
+GstTocScope
+gst_toc_get_scope (const GstToc * toc)
+{
+ g_return_val_if_fail (toc != NULL, GST_TOC_SCOPE_GLOBAL);
+
+ return toc->scope;
+}
+
+/**
* gst_toc_set_tags:
* @toc: A #GstToc instance
* @tags: (allow-none) (transfer full): A #GstTagList or %NULL
g_return_val_if_fail (toc != NULL, NULL);
- ret = gst_toc_new ();
+ ret = gst_toc_new (toc->scope);
if (GST_IS_TAG_LIST (toc->tags)) {
list = gst_tag_list_copy (toc->tags);
cur = cur->next;
}
ret->entries = g_list_reverse (ret->entries);
-
return ret;
}
gst_toc_dump (GstToc * toc)
{
#ifndef GST_DISABLE_GST_DEBUG
- GST_TRACE (" Toc %p, tags: %" GST_PTR_FORMAT, toc, toc->tags);
+ GST_TRACE (" Toc %p, scope: %s, tags: %" GST_PTR_FORMAT, toc,
+ (toc->scope == GST_TOC_SCOPE_GLOBAL) ? "global" : "current", toc->tags);
gst_toc_dump_entries (toc->entries, 2);
#endif
}
typedef struct _GstToc GstToc;
/**
+ * GstTocScope:
+ * @GST_TOC_SCOPE_GLOBAL: global TOC representing all selectable options
+ * (this is what applications are usually interested in)
+ * @GST_TOC_SCOPE_CURRENT: TOC for the currently active/selected stream
+ * (this is a TOC representing the current stream from start to EOS,
+ * and is what a TOC writer / muxer is usually interested in; it will
+ * usually be a subset of the global TOC, e.g. just the chapters of
+ * the current title, or the chapters selected for playback from the
+ * current title)
+ *
+ * The scope of a TOC.
+ */
+typedef enum {
+ GST_TOC_SCOPE_GLOBAL = 1,
+ GST_TOC_SCOPE_CURRENT = 2
+} GstTocScope;
+
+/**
* GstTocEntryType:
* @GST_TOC_ENTRY_TYPE_ANGLE: entry is an angle (i.e. an alternative)
* @GST_TOC_ENTRY_TYPE_VERSION: entry is a version (i.e. alternative)
GType gst_toc_entry_get_type (void);
/* functions to create, ref and unref/free TOCs */
-GstToc * gst_toc_new (void);
+GstToc * gst_toc_new (GstTocScope scope);
+
+GstTocScope gst_toc_get_scope (const GstToc *toc);
void gst_toc_set_tags (GstToc *toc, GstTagList * tags);
void gst_toc_merge_tags (GstToc *toc, GstTagList *tags, GstTagMergeMode mode);
gchar *uid;
gint64 start = -1, stop = -1;
- toc = gst_toc_new ();
+ toc = gst_toc_new (GST_TOC_SCOPE_GLOBAL);
+ fail_unless_equals_int (gst_toc_get_scope (toc), GST_TOC_SCOPE_GLOBAL);
fail_if (toc == NULL);
tags = gst_tag_list_new (GST_TAG_TITLE, TOC_TAG, NULL);
gst_toc_set_tags (toc, tags);
GstTocEntry *ed, *ch, *subch;
GstTagList *tags;
- toc = gst_toc_new ();
+ toc = gst_toc_new (GST_TOC_SCOPE_GLOBAL);
tags = gst_tag_list_new_empty ();
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, TOC_TAG, NULL);
gst_toc_set_tags (toc, tags);
gst_toc_entry_type_get_type
gst_toc_find_entry
gst_toc_get_entries
+ gst_toc_get_scope
gst_toc_get_tags
gst_toc_get_type
gst_toc_merge_tags
gst_toc_new
+ gst_toc_scope_get_type
gst_toc_set_tags
gst_toc_setter_get_toc
gst_toc_setter_get_type