summaryrefslogtreecommitdiff
path: root/ext/cdparanoia
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-10-11 12:02:09 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-10-11 12:02:09 +0000
commitb4c826232ada1869cd414999cef080002a8f9bc6 (patch)
treef9406764f33193140aa23395e41d2375438a7330 /ext/cdparanoia
parentfaa1d71a2e931649fa0ddd9ab2f39d38f9c3befc (diff)
ext/cdparanoia/gstcdparanoia.c: Report discid as metadata, add duration.
Original commit message from CVS: * ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init), (cdparanoia_get), (cdparanoia_open): Report discid as metadata, add duration.
Diffstat (limited to 'ext/cdparanoia')
-rw-r--r--ext/cdparanoia/gstcdparanoia.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/cdparanoia/gstcdparanoia.c b/ext/cdparanoia/gstcdparanoia.c
index 2b95a8c48..f1a95f64f 100644
--- a/ext/cdparanoia/gstcdparanoia.c
+++ b/ext/cdparanoia/gstcdparanoia.c
@@ -272,6 +272,11 @@ cdparanoia_class_init (CDParanoiaClass * klass)
g_param_spec_string ("discid", "discid", "The dics id", NULL,
G_PARAM_READABLE));
+ /* tags */
+ gst_tag_register ("discid", GST_TAG_FLAG_META, G_TYPE_STRING,
+ _("discid"), _("CDDA discid for metadata retrieval"),
+ gst_tag_merge_use_first);
+
gobject_class->set_property = cdparanoia_set_property;
gobject_class->get_property = cdparanoia_get_property;
gobject_class->dispose = cdparanoia_dispose;
@@ -520,6 +525,9 @@ cdparanoia_get (GstPad * pad)
buf = gst_buffer_new_and_alloc (CD_FRAMESIZE_RAW);
memcpy (GST_BUFFER_DATA (buf), cdda_buf, CD_FRAMESIZE_RAW);
GST_BUFFER_TIMESTAMP (buf) = timestamp;
+ gst_pad_convert (pad, GST_FORMAT_BYTES, CD_FRAMESIZE_RAW,
+ &format, &timestamp);
+ GST_BUFFER_DURATION (buf) = timestamp;
/* update current sector */
src->cur_sector++;
@@ -650,6 +658,7 @@ add_index_associations (CDParanoia * src)
static gboolean
cdparanoia_open (CDParanoia * src)
{
+ GstTagList *taglist;
gint i;
gint paranoia_mode;
@@ -704,6 +713,11 @@ cdparanoia_open (CDParanoia * src)
g_object_notify (G_OBJECT (src), "discid");
g_object_thaw_notify (G_OBJECT (src));
+ taglist = gst_tag_list_new ();
+ gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, "discid", src->discid, NULL);
+ gst_element_found_tags (GST_ELEMENT (src), taglist);
+ /* no need to forward, because discid is useless to other elements */
+
if (src->toc_bias) {
src->toc_offset -= cdda_track_firstsector (src->d, 1);
}