riff: remove new parse_ncdt api again

This chunk is avi specific, no need to expose this as public api.
This commit is contained in:
Stefan Sauer 2014-01-05 21:39:52 +01:00
parent f1c233b625
commit 28ce2c4053
3 changed files with 0 additions and 138 deletions

View file

@ -823,136 +823,3 @@ gst_riff_parse_info (GstElement * element,
return; return;
} }
/**
* gst_riff_parse_ncdt:
* @element: caller element (used for debugging/error).
* @buf: input data to be used for parsing, stripped from header.
* @taglist: a pointer to a taglist (returned by this function)
* containing information about this stream. May be
* NULL if no supported tags were found.
*
* Parses Nikon metadata from input data.
*
* Since: 1.4
*/
void
gst_riff_parse_ncdt (GstElement * element,
GstBuffer * buf, GstTagList ** _taglist)
{
GstMapInfo info;
guint8 *ptr;
gsize left;
guint tsize;
guint32 tag;
const gchar *type;
GstTagList *taglist;
g_return_if_fail (_taglist != NULL);
if (!buf) {
*_taglist = NULL;
return;
}
gst_buffer_map (buf, &info, GST_MAP_READ);
taglist = gst_tag_list_new_empty ();
ptr = info.data;
left = info.size;
while (left > 8) {
tag = GST_READ_UINT32_LE (ptr);
tsize = GST_READ_UINT32_LE (ptr + 4);
GST_MEMDUMP_OBJECT (element, "tag chunk", ptr, MIN (tsize + 8, left));
left -= 8;
ptr += 8;
GST_DEBUG ("tag %" GST_FOURCC_FORMAT ", size %u",
GST_FOURCC_ARGS (tag), tsize);
if (tsize > left) {
GST_WARNING_OBJECT (element,
"Tagsize %d is larger than available data %" G_GSIZE_FORMAT,
tsize, left);
tsize = left;
}
/* find out the type of metadata */
switch (tag) {
case GST_RIFF_LIST_nctg:
while (tsize > 4) {
guint16 sub_tag = GST_READ_UINT16_LE (ptr);
guint16 sub_size = GST_READ_UINT16_LE (ptr + 2);
tsize -= 4;
ptr += 4;
GST_DEBUG ("sub-tag %u, size %u", sub_tag, sub_size);
/* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
* for some reason the sub_tag has a +2 offset
*/
switch (sub_tag) {
case 0x03: /* Make */
type = GST_TAG_DEVICE_MANUFACTURER;
break;
case 0x04: /* Model */
type = GST_TAG_DEVICE_MODEL;
break;
/* TODO: 0x05: is software version, like V1.0 */
case 0x06: /* Software */
type = GST_TAG_ENCODER;
break;
case 0x13: /* CreationDate */
type = GST_TAG_DATE_TIME;
if (ptr[4] == ':')
ptr[4] = '-';
if (ptr[7] == ':')
ptr[7] = '-';
break;
default:
type = NULL;
break;
}
if (type != NULL && ptr[0] != '\0') {
GST_DEBUG_OBJECT (element, "mapped tag %u to tag %s", sub_tag,
type);
parse_tag_value (element, taglist, type, ptr, sub_size);
}
ptr += sub_size;
tsize -= sub_size;
}
break;
default:
type = NULL;
GST_WARNING_OBJECT (element,
"Unknown ncdt (metadata) tag entry %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (tag));
break;
}
if (tsize & 1) {
tsize++;
if (tsize > left)
tsize = left;
}
ptr += tsize;
left -= tsize;
}
if (!gst_tag_list_is_empty (taglist)) {
GST_INFO_OBJECT (element, "extracted tags: %" GST_PTR_FORMAT, taglist);
*_taglist = taglist;
} else {
*_taglist = NULL;
gst_tag_list_unref (taglist);
}
gst_buffer_unmap (buf, &info);
return;
}

View file

@ -76,10 +76,6 @@ gboolean gst_riff_parse_strf_iavs (GstElement * element,
void gst_riff_parse_info (GstElement * element, void gst_riff_parse_info (GstElement * element,
GstBuffer * buf, GstBuffer * buf,
GstTagList ** taglist); GstTagList ** taglist);
void gst_riff_parse_ncdt (GstElement * element,
GstBuffer * buf,
GstTagList ** taglist);
/* /*
* Init. * Init.
*/ */

View file

@ -9,7 +9,6 @@ EXPORTS
gst_riff_parse_chunk gst_riff_parse_chunk
gst_riff_parse_file_header gst_riff_parse_file_header
gst_riff_parse_info gst_riff_parse_info
gst_riff_parse_ncdt
gst_riff_parse_strf_auds gst_riff_parse_strf_auds
gst_riff_parse_strf_iavs gst_riff_parse_strf_iavs
gst_riff_parse_strf_vids gst_riff_parse_strf_vids