mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
vorbistag: Read image-type from the GstSample info struct
But for backwards compatibility keep reading it from the caps and only use the info struct if the caps don't contain the image-type.
This commit is contained in:
parent
b5d26f3907
commit
5a48fb7cdb
1 changed files with 13 additions and 0 deletions
|
@ -568,10 +568,23 @@ gst_tag_to_metadata_block_picture (const gchar * tag,
|
||||||
mime_type = "-->";
|
mime_type = "-->";
|
||||||
mime_type_len = strlen (mime_type);
|
mime_type_len = strlen (mime_type);
|
||||||
|
|
||||||
|
/* FIXME 2.0: Remove the image-type reading from the caps, this was
|
||||||
|
* a bug until 1.2.2. The image-type is only supposed to be in the
|
||||||
|
* info structure */
|
||||||
gst_structure_get (mime_struct, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
|
gst_structure_get (mime_struct, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
|
||||||
&image_type, "width", G_TYPE_INT, &width, "height", G_TYPE_INT, &height,
|
&image_type, "width", G_TYPE_INT, &width, "height", G_TYPE_INT, &height,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
if (image_type == GST_TAG_IMAGE_TYPE_NONE) {
|
||||||
|
const GstStructure *info_struct;
|
||||||
|
|
||||||
|
info_struct = gst_sample_get_info (sample);
|
||||||
|
if (info_struct && gst_structure_has_name (info_struct, "GstTagImageInfo")) {
|
||||||
|
gst_structure_get (info_struct, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
|
||||||
|
&image_type, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
metadata_block_len = 32 + mime_type_len + gst_buffer_get_size (buffer);
|
metadata_block_len = 32 + mime_type_len + gst_buffer_get_size (buffer);
|
||||||
gst_byte_writer_init_with_size (&writer, metadata_block_len, TRUE);
|
gst_byte_writer_init_with_size (&writer, metadata_block_len, TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue