Commit 8a63c04b authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

ext/cdio/: Move CD-TEXT utility function into common file so it can also be...

ext/cdio/: Move CD-TEXT utility function into common file so it can also be used by a future cdioparanoiasrc.

Original commit message from CVS:
* ext/cdio/gstcdio.c: (gst_cdio_get_cdtext):
* ext/cdio/gstcdio.h:
* ext/cdio/gstcdiocddasrc.c: (gst_cdio_cdda_src_open):
Move CD-TEXT utility function into common file so it can also be
used by a future cdioparanoiasrc.
parent 24088fed
2006-11-02 Tim-Philipp Müller <tim at centricular dot net>
* ext/cdio/gstcdio.c: (gst_cdio_get_cdtext):
* ext/cdio/gstcdio.h:
* ext/cdio/gstcdiocddasrc.c: (gst_cdio_cdda_src_open):
Move CD-TEXT utility function into common file so it can also be
used by a future cdioparanoiasrc.
2006-11-01 Edgard Lima <edgard.lima@indt.org.br>
* sys/v4l2/Makefile.am:
......
......@@ -58,6 +58,34 @@ gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext,
GST_DEBUG_OBJECT (src, "CD-TEXT: %s = %s", gst_tag, txt);
}
GstTagList *
gst_cdio_get_cdtext (GstObject * src, CdIo * cdio, track_t track)
{
GstTagList *tags = NULL;
cdtext_t *t;
t = cdio_get_cdtext (cdio, track);
if (t == NULL) {
GST_DEBUG_OBJECT (src, "no CD-TEXT for track %u", track);
return NULL;
}
gst_cdio_add_cdtext_field (src, t, CDTEXT_PERFORMER, GST_TAG_ARTIST, &tags);
gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_TITLE, &tags);
return tags;
}
#else
GstTagList *
gst_cdio_get_cdtext (GstObject * src, CdIo * cdio, track_t track)
{
GST_DEBUG_OBJECT (src, "This libcdio version (%u) does not support "
"CDTEXT (want >= 76)", LIBCDIO_VERSION_NUM);
return NULL;
}
#endif
static void
......
......@@ -22,7 +22,7 @@
#define __GST_CDIO_H__
#include <gst/gst.h>
#include <cdio/version.h>
#include <cdio/cdio.h>
GST_DEBUG_CATEGORY_EXTERN (gst_cdio_debug);
#define GST_CAT_DEFAULT gst_cdio_debug
......@@ -39,5 +39,9 @@ void gst_cdio_add_cdtext_field (GstObject * src,
#endif
GstTagList * gst_cdio_get_cdtext (GstObject * src,
CdIo * cdio,
track_t track);
#endif /* __GST_CDIO_H__ */
......@@ -209,40 +209,6 @@ notcdio_track_is_audio_track (const CdIo * p_cdio, track_t i_track)
return (cdio_get_track_format (p_cdio, i_track) == TRACK_FORMAT_AUDIO);
}
#if (LIBCDIO_VERSION_NUM >= 76)
static GstTagList *
gst_cdio_cdda_src_get_cdtext (GstCdioCddaSrc * src, track_t i_track)
{
GstTagList *tags = NULL;
GstObject *obj;
cdtext_t *t;
t = cdio_get_cdtext (src->cdio, i_track);
if (t == NULL) {
GST_DEBUG_OBJECT (src, "no CD-TEXT for track %u", i_track);
return NULL;
}
obj = GST_OBJECT (src);
gst_cdio_add_cdtext_field (obj, t, CDTEXT_PERFORMER, GST_TAG_ARTIST, &tags);
gst_cdio_add_cdtext_field (obj, t, CDTEXT_TITLE, GST_TAG_TITLE, &tags);
return tags;
}
#else
static GstTagList *
gst_cdio_cdda_src_get_cdtext (GstCdioCddaSrc * src, track_t i_track)
{
GST_DEBUG_OBJECT (src, "This libcdio version (%u) does not support "
"CDTEXT (want >= 76)", LIBCDIO_VERSION_NUM);
return NULL;
}
#endif
static gboolean
gst_cdio_cdda_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device)
{
......@@ -305,7 +271,8 @@ gst_cdio_cdda_src_open (GstCddaBaseSrc * cddabasesrc, const gchar * device)
* the right thing here (for cddb id calculations etc. as well) */
track.start = cdio_get_track_lsn (src->cdio, i + first_track);
track.end = track.start + len_sectors - 1; /* -1? */
track.tags = gst_cdio_cdda_src_get_cdtext (src, i + first_track);
track.tags = gst_cdio_get_cdtext (GST_OBJECT (src), src->cdio,
i + first_track);
gst_cdda_base_src_add_track (GST_CDDA_BASE_SRC (src), &track);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment