387
382
G_TYPE_STRING, _("application name"),
388
383
_("Application used to create the media"), NULL);
389
384
gst_tag_register_static (GST_TAG_APPLICATION_DATA, GST_TAG_FLAG_META,
390
GST_TYPE_BUFFER, _("application data"),
385
GST_TYPE_SAMPLE, _("application data"),
391
386
_("Arbitrary application data to be serialized into the media"), NULL);
392
387
gst_tag_register_static (GST_TAG_IMAGE_ORIENTATION, GST_TAG_FLAG_META,
393
388
G_TYPE_STRING, _("image orientation"),
684
668
tag_list = (GstTagList *) g_slice_new (GstTagListImpl);
686
gst_tag_list_init (tag_list, sizeof (GstTagListImpl));
670
gst_mini_object_init (GST_MINI_OBJECT_CAST (tag_list), 0, GST_TYPE_TAG_LIST,
671
(GstMiniObjectCopyFunction) __gst_tag_list_copy, NULL,
672
(GstMiniObjectFreeFunction) __gst_tag_list_free);
688
674
GST_TAG_LIST_STRUCTURE (tag_list) = s;
675
GST_TAG_LIST_SCOPE (tag_list) = GST_TAG_SCOPE_STREAM;
690
677
#ifdef DEBUG_REFCOUNT
691
678
GST_CAT_TRACE (GST_CAT_TAGS, "created taglist %p", tag_list);
790
* gst_tag_list_set_scope:
791
* @list: a #GstTagList
792
* @scope: new scope for @list
794
* Sets the scope of @list to @scope. By default the scope
795
* of a taglist is #GST_TAG_SCOPE_STREAM.
799
gst_tag_list_set_scope (GstTagList * list, GstTagScope scope)
801
g_return_if_fail (GST_IS_TAG_LIST (list));
802
g_return_if_fail (gst_tag_list_is_writable (list));
804
GST_TAG_LIST_SCOPE (list) = scope;
808
* gst_tag_list_get_scope:
809
* @list: a #GstTagList
811
* Gets the scope of @list.
813
* Returns: The scope of @list
816
gst_tag_list_get_scope (const GstTagList * list)
818
g_return_val_if_fail (GST_IS_TAG_LIST (list), GST_TAG_SCOPE_STREAM);
820
return GST_TAG_LIST_SCOPE (list);
808
824
* gst_tag_list_to_string:
809
825
* @list: a #GstTagList
1923
* gst_tag_list_get_buffer:
1933
* gst_tag_list_get_sample:
1924
1934
* @list: a #GstTagList to get the tag from
1925
1935
* @tag: tag to read out
1926
* @value: (out callee-allocates) (transfer full): address of a GstBuffer
1936
* @sample: (out callee-allocates) (transfer full): address of a GstSample
1927
1937
* pointer variable to store the result into
1929
* Copies the first buffer for the given tag in the taglist into the variable
1930
* pointed to by @value. Free the buffer with gst_buffer_unref() when it is
1933
* Free-function: gst_buffer_unref
1935
* Returns: TRUE, if a buffer was copied, FALSE if the tag didn't exist in the
1936
* given list or if it was #NULL.
1939
* Copies the first sample for the given tag in the taglist into the variable
1940
* pointed to by @sample. Free the sample with gst_sample_unref() when it is
1941
* no longer needed. You can retrieve the buffer from the sample using
1942
* gst_sample_get_buffer() and the associated caps (if any) with
1943
* gst_sample_get_caps().
1945
* Free-function: gst_sample_unref
1947
* Returns: TRUE, if a sample was returned, FALSE if the tag didn't exist in
1948
* the given list or if it was #NULL.
1941
gst_tag_list_get_buffer (const GstTagList * list, const gchar * tag,
1951
gst_tag_list_get_sample (const GstTagList * list, const gchar * tag,
1952
GstSample ** sample)
1944
1954
GValue v = { 0, };
1946
1956
g_return_val_if_fail (GST_IS_TAG_LIST (list), FALSE);
1947
1957
g_return_val_if_fail (tag != NULL, FALSE);
1948
g_return_val_if_fail (value != NULL, FALSE);
1958
g_return_val_if_fail (sample != NULL, FALSE);
1950
1960
if (!gst_tag_list_copy_value (&v, list, tag))
1952
*value = g_value_dup_boxed (&v);
1962
*sample = g_value_dup_boxed (&v);
1953
1963
g_value_unset (&v);
1954
return (*value != NULL);
1964
return (*sample != NULL);
1958
* gst_tag_list_get_buffer_index:
1968
* gst_tag_list_get_sample_index:
1959
1969
* @list: a #GstTagList to get the tag from
1960
1970
* @tag: tag to read out
1961
1971
* @index: number of entry to read out
1962
* @value: (out callee-allocates) (transfer full): address of a GstBuffer
1972
* @sample: (out callee-allocates) (transfer full): address of a GstSample
1963
1973
* pointer variable to store the result into
1965
* Gets the buffer that is at the given index for the given tag in the given
1966
* list and copies it into the variable pointed to by @value. Free the buffer
1967
* with gst_buffer_unref() when it is no longer needed.
1969
* Free-function: gst_buffer_unref
1971
* Returns: TRUE, if a buffer was copied, FALSE if the tag didn't exist in the
1975
* Gets the sample that is at the given index for the given tag in the given
1976
* list and copies it into the variable pointed to by @smple. Free the sample
1977
* with gst_sample_unref() when it is no longer needed. You can retrieve the
1978
* buffer from the sample using gst_sample_get_buffer() and the associated
1979
* caps (if any) with gst_sample_get_caps().
1981
* Free-function: gst_sample_unref
1983
* Returns: TRUE, if a sample was copied, FALSE if the tag didn't exist in the
1972
1984
* given list or if it was #NULL.
1977
gst_tag_list_get_buffer_index (const GstTagList * list,
1978
const gchar * tag, guint index, GstBuffer ** value)
1987
gst_tag_list_get_sample_index (const GstTagList * list,
1988
const gchar * tag, guint index, GstSample ** sample)
1980
1990
const GValue *v;
1982
1992
g_return_val_if_fail (GST_IS_TAG_LIST (list), FALSE);
1983
1993
g_return_val_if_fail (tag != NULL, FALSE);
1984
g_return_val_if_fail (value != NULL, FALSE);
1994
g_return_val_if_fail (sample != NULL, FALSE);
1986
1996
if ((v = gst_tag_list_get_value_index (list, tag, index)) == NULL)
1988
*value = g_value_dup_boxed (v);
1989
return (*value != NULL);
1998
*sample = g_value_dup_boxed (v);
1999
return (*sample != NULL);