* the APIC frame (0 = unknown/other)
*
* Adds an image from an ID3 APIC frame (or similar, such as used in FLAC)
- * to the given tag list. Also see gst_tag_image_data_to_image_buffer() for
+ * to the given tag list. Also see gst_tag_image_data_to_image_sample() for
* more information on image tags in GStreamer.
*
* Returns: %TRUE if the image was processed, otherwise %FALSE
{
GstTagImageType tag_image_type;
const gchar *tag_name;
- GstBuffer *image;
+ GstSample *image;
g_return_val_if_fail (GST_IS_TAG_LIST (tag_list), FALSE);
g_return_val_if_fail (image_data != NULL, FALSE);
tag_image_type = GST_TAG_IMAGE_TYPE_UNDEFINED;
}
- image = gst_tag_image_data_to_image_buffer (image_data, image_data_len,
+ image = gst_tag_image_data_to_image_sample (image_data, image_data_len,
tag_image_type);
if (image == NULL)
return FALSE;
gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND, tag_name, image, NULL);
- gst_buffer_unref (image);
+ gst_sample_unref (image);
return TRUE;
}
gst_vorbis_tag_add_coverart (GstTagList * tags, gchar * img_data_base64,
gint base64_len)
{
- GstBuffer *img;
+ GstSample *img;
gsize img_len;
if (base64_len < 2)
goto decode_failed;
img =
- gst_tag_image_data_to_image_buffer ((const guint8 *) img_data_base64,
+ gst_tag_image_data_to_image_sample ((const guint8 *) img_data_base64,
img_len, GST_TAG_IMAGE_TYPE_NONE);
if (img == NULL)
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
GST_TAG_PREVIEW_IMAGE, img, NULL);
- gst_buffer_unref (img);
+ gst_sample_unref (img);
return;
/* ERRORS */
*/
#define GST_TAG_MUSICBRAINZ_TRMID "musicbrainz-trmid"
-/* FIXME 0.11: remove GST_TAG_MUSICBRAINZ_SORTNAME */
-#ifndef GST_DISABLE_DEPRECATED
-/**
- * GST_TAG_MUSICBRAINZ_SORTNAME
- *
- * MusicBrainz artist sort name
- *
- * Deprecated. Use GST_TAG_ARTIST_SORTNAME instead.
- */
-#define GST_TAG_MUSICBRAINZ_SORTNAME GST_TAG_ARTIST_SORTNAME
-#endif
-
/**
* GST_TAG_CMML_STREAM
*
/**
* GstTagImageType:
* @GST_TAG_IMAGE_TYPE_NONE : No image type. Can be used to
- * tell functions such as gst_tag_image_data_to_image_buffer() that no
+ * tell functions such as gst_tag_image_data_to_image_sample() that no
* image type should be set. (Since: 0.10.20)
* @GST_TAG_IMAGE_TYPE_UNDEFINED : Undefined/other image type
* @GST_TAG_IMAGE_TYPE_FRONT_COVER : Cover (front)
gint size,
const gchar ** env_vars);
-GstBuffer * gst_tag_image_data_to_image_buffer (const guint8 * image_data,
+GstSample * gst_tag_image_data_to_image_sample (const guint8 * image_data,
guint image_data_len,
GstTagImageType image_type);
}
/**
- * gst_tag_image_data_to_image_buffer:
+ * gst_tag_image_data_to_image_sample:
* @image_data: the (encoded) image
* @image_data_len: the length of the encoded image data at @image_data
* @image_type: type of the image, or #GST_TAG_IMAGE_TYPE_UNDEFINED. Pass
* #GST_TAG_IMAGE_TYPE_NONE if no image type should be set at all (e.g.
* for preview images)
*
- * Helper function for tag-reading plugins to create a #GstBuffer suitable to
+ * Helper function for tag-reading plugins to create a #GstSample suitable to
* add to a #GstTagList as an image tag (such as #GST_TAG_IMAGE or
* #GST_TAG_PREVIEW_IMAGE) from the encoded image data and an (optional) image
* type.
* back cover, artist, etc.). The image data may also be an URI to the image
* rather than the image itself.
*
- * In GStreamer, image tags are #GstBuffer<!-- -->s containing the raw image
- * data, with the buffer caps describing the content type of the image
- * (e.g. image/jpeg, image/png, text/uri-list). The buffer caps may contain
+ * In GStreamer, image tags are #GstSample<!-- -->s containing the raw image
+ * data, with the sample caps describing the content type of the image
+ * (e.g. image/jpeg, image/png, text/uri-list). The sample info may contain
* an additional 'image-type' field of #GST_TYPE_TAG_IMAGE_TYPE to describe
* the type of image (front cover, back cover etc.). #GST_TAG_PREVIEW_IMAGE
* tags should not carry an image type, their type is already indicated via
* This function will do various checks and typefind the encoded image
* data (we can't trust the declared mime type).
*
- * Returns: a newly-allocated image buffer for use in tag lists, or NULL
+ * Returns: a newly-allocated image sample for use in tag lists, or NULL
*
* Since: 0.10.20
*/
-GstBuffer *
-gst_tag_image_data_to_image_buffer (const guint8 * image_data,
+GstSample *
+gst_tag_image_data_to_image_sample (const guint8 * image_data,
guint image_data_len, GstTagImageType image_type)
{
const gchar *name;
GstBuffer *image;
+ GstSample *sample;
GstCaps *caps;
guint8 *data;
+ GstStructure *info = NULL;
g_return_val_if_fail (image_data != NULL, NULL);
g_return_val_if_fail (image_data_len > 0, NULL);
if (image_type != GST_TAG_IMAGE_TYPE_NONE) {
GST_LOG ("Setting image type: %d", image_type);
- caps = gst_caps_make_writable (caps);
- gst_caps_set_simple (caps, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
- image_type, NULL);
+ info = gst_structure_new ("GstTagImageInfo",
+ "image-type", GST_TYPE_TAG_IMAGE_TYPE, image_type, NULL);
}
-
- g_warning ("extra image data can't be set");
+ sample = gst_sample_new (image, caps, NULL, info);
+ gst_buffer_unref (image);
gst_caps_unref (caps);
- return image;
+ return sample;
/* ERRORS */
no_type: