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.
This commit is contained in:
Tim-Philipp Müller 2006-11-02 14:43:11 +00:00
parent 24088fed0a
commit 8a63c04b0d
4 changed files with 43 additions and 36 deletions

View file

@ -1,3 +1,11 @@
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:

View file

@ -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

View file

@ -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__ */

View file

@ -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);
}