gst/matroska/: Add some more tags, improve debugging a bit and make sure that

Original commit message from CVS:
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_parse_metadata_id_simple_tag):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c: (gst_matroska_mux_write_simple_tag):
Add some more tags, improve debugging a bit and make sure that
GValue transformation has succeeded before using the result
as a tag.
This commit is contained in:
Sebastian Dröge 2008-06-11 11:18:23 +00:00
parent 86c4b045ea
commit 4c46ceb4cb
4 changed files with 55 additions and 26 deletions

View file

@ -1,3 +1,13 @@
2008-06-11 Sebastian Dröge <slomo@circular-chaos.org>
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_parse_metadata_id_simple_tag):
* gst/matroska/matroska-ids.h:
* gst/matroska/matroska-mux.c: (gst_matroska_mux_write_simple_tag):
Add some more tags, improve debugging a bit and make sure that
GValue transformation has succeeded before using the result
as a tag.
2008-06-11 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: Olivier Crete <tester at tester dot ca>

View file

@ -2168,10 +2168,16 @@ gst_matroska_demux_parse_metadata_id_simple_tag (GstMatroskaDemux * demux,
GST_MATROSKA_TAG_ID_ALBUM, GST_TAG_ALBUM}, {
GST_MATROSKA_TAG_ID_COMMENTS, GST_TAG_COMMENT}, {
GST_MATROSKA_TAG_ID_BITSPS, GST_TAG_BITRATE}, {
GST_MATROSKA_TAG_ID_BPS, GST_TAG_BITRATE}, {
GST_MATROSKA_TAG_ID_ENCODER, GST_TAG_ENCODER}, {
GST_MATROSKA_TAG_ID_DATE, GST_TAG_DATE}, {
GST_MATROSKA_TAG_ID_ISRC, GST_TAG_ISRC}, {
GST_MATROSKA_TAG_ID_COPYRIGHT, GST_TAG_COPYRIGHT}
GST_MATROSKA_TAG_ID_COPYRIGHT, GST_TAG_COPYRIGHT}, {
GST_MATROSKA_TAG_ID_BPM, GST_TAG_BEATS_PER_MINUTE}, {
GST_MATROSKA_TAG_ID_TERMS_OF_USE, GST_TAG_LICENSE}, {
GST_MATROSKA_TAG_ID_COMPOSER, GST_TAG_COMPOSER}, {
GST_MATROSKA_TAG_ID_LEAD_PERFORMER, GST_TAG_PERFORMER}, {
GST_MATROSKA_TAG_ID_GENRE, GST_TAG_GENRE}
};
GstEbmlRead *ebml = GST_EBML_READ (demux);
@ -2246,9 +2252,13 @@ gst_matroska_demux_parse_metadata_id_simple_tag (GstMatroskaDemux * demux,
g_value_init (&src, G_TYPE_STRING);
g_value_set_string (&src, value);
g_value_init (&dest, dest_type);
if (g_value_transform (&src, &dest))
if (g_value_transform (&src, &dest)) {
gst_tag_list_add_values (*p_taglist, GST_TAG_MERGE_APPEND,
tagname_gst, &dest, NULL);
} else {
GST_WARNING_OBJECT (demux, "Can't transform tag '%s' with"
"value '%s' to target type", tag, value);
}
g_value_unset (&src);
g_value_unset (&dest);
break;

View file

@ -380,40 +380,38 @@
* Matroska tags. Strings.
*/
/* TODO: check for other tags */
#define GST_MATROSKA_TAG_ID_TITLE "TITLE"
#define GST_MATROSKA_TAG_ID_AUTHOR "AUTHOR"
#define GST_MATROSKA_TAG_ID_ALBUM "ALBUM"
#define GST_MATROSKA_TAG_ID_COMMENTS "COMMENTS"
#define GST_MATROSKA_TAG_ID_BITSPS "BITSPS"
#define GST_MATROSKA_TAG_ID_BPS "BPS"
#define GST_MATROSKA_TAG_ID_ENCODER "ENCODER"
#define GST_MATROSKA_TAG_ID_DATE "DATE"
#define GST_MATROSKA_TAG_ID_ISRC "ISRC"
#define GST_MATROSKA_TAG_ID_COPYRIGHT "COPYRIGHT"
#define GST_MATROSKA_TAG_ID_BPM "BPM"
#define GST_MATROSKA_TAG_ID_TERMS_OF_USE "TERMS_OF_USE"
#define GST_MATROSKA_TAG_ID_DATE "DATE"
#define GST_MATROSKA_TAG_ID_COMPOSER "COMPOSER"
#define GST_MATROSKA_TAG_ID_LEAD_PERFORMER "LEAD_PERFOMER"
#define GST_MATROSKA_TAG_ID_GENRE "GENRE"
/*
* TODO: add this tag & mappings
* "URL" -> GST_TAG_LOCATION
* "BPS" -> GST_TAG_BITRATE
* "BPM" -> GST_TAG_BEATS_PER_MINUTE
* "REPLAYGAIN_GAIN" -> GST_TAG_*_GAIN see http://replaygain.hydrogenaudio.org/rg_data_format.html
* "REPLAYGAIN_PEAK" -> GST_TAG_*_PEAK see http://replaygain.hydrogenaudio.org/peak_data_format.html
* "TERMS_OF_USE" -> GST_TAG_LICENSE
* "DATE_RECORDED" -> GST_TAG_DATE
* "COMPOSER" -> GST_TAG_COMPOSER
* "LEAD_PERFORMER" -> GST_TAG_PERFORMER
* "GENRE" -> GST_TAG_GENRE
* both are depending on the target (track, album?)
*
* "TOTAL_PARTS" -> GST_TAG_TRACK_COUNT depending on target
* "PART_NUMBER" -> GST_TAG_TRACK_NUMBER depending on target
*
* "EMAIL" ->
* "ADDRESS" ->
* "FAX" -> GST_TAG_CONTACT
* "PHONE" ->
* "SORT_WITH" -> nested in other elements, GST_TAG_TITLE_SORTNAME, etc
*
* TODO: maybe add custom gstreamer tags for other standard matroska tags
* TODO: maybe add custom gstreamer tags for other standard matroska tags,
* see http://matroska.org/technical/specs/tagging/index.html
*
* TODO: handle tag targets and nesting correctly
*/
/*

View file

@ -1519,10 +1519,18 @@ gst_matroska_mux_write_simple_tag (const GstTagList * list, const gchar * tag,
GST_MATROSKA_TAG_ID_ALBUM, GST_TAG_ALBUM}, {
GST_MATROSKA_TAG_ID_COMMENTS, GST_TAG_COMMENT}, {
GST_MATROSKA_TAG_ID_BITSPS, GST_TAG_BITRATE}, {
GST_MATROSKA_TAG_ID_BPS, GST_TAG_BITRATE}, {
GST_MATROSKA_TAG_ID_ENCODER, GST_TAG_ENCODER}, {
GST_MATROSKA_TAG_ID_DATE, GST_TAG_DATE}, {
GST_MATROSKA_TAG_ID_ISRC, GST_TAG_ISRC}, {
GST_MATROSKA_TAG_ID_COPYRIGHT, GST_TAG_COPYRIGHT}
GST_MATROSKA_TAG_ID_COPYRIGHT, GST_TAG_COPYRIGHT}, {
GST_MATROSKA_TAG_ID_BPM, GST_TAG_BEATS_PER_MINUTE}, {
GST_MATROSKA_TAG_ID_TERMS_OF_USE, GST_TAG_LICENSE}, {
GST_MATROSKA_TAG_ID_COMPOSER, GST_TAG_COMPOSER}, {
GST_MATROSKA_TAG_ID_LEAD_PERFORMER, GST_TAG_PERFORMER}, {
GST_MATROSKA_TAG_ID_GENRE, GST_TAG_GENRE}
};
GstEbmlWrite *ebml = (GstEbmlWrite *) data;
guint i;
@ -1541,15 +1549,18 @@ gst_matroska_mux_write_simple_tag (const GstTagList * list, const gchar * tag,
if (!gst_tag_list_copy_value (&src, list, tag))
break;
g_value_init (&dest, G_TYPE_STRING);
g_value_transform (&src, &dest);
g_value_unset (&src);
if (g_value_transform (&src, &dest)) {
simpletag_master = gst_ebml_write_master_start (ebml,
GST_MATROSKA_ID_SIMPLETAG);
gst_ebml_write_ascii (ebml, GST_MATROSKA_ID_TAGNAME, tagname_mkv);
gst_ebml_write_utf8 (ebml, GST_MATROSKA_ID_TAGSTRING,
g_value_get_string (&dest));
gst_ebml_write_master_finish (ebml, simpletag_master);
simpletag_master = gst_ebml_write_master_start (ebml,
GST_MATROSKA_ID_SIMPLETAG);
gst_ebml_write_ascii (ebml, GST_MATROSKA_ID_TAGNAME, tagname_mkv);
gst_ebml_write_utf8 (ebml, GST_MATROSKA_ID_TAGSTRING,
g_value_get_string (&dest));
gst_ebml_write_master_finish (ebml, simpletag_master);
} else {
GST_WARNING ("Can't transform tag '%s' to string", tagname_mkv);
}
g_value_unset (&src);
g_value_unset (&dest);
break;
}