rev |
line source |
pascal@21405
|
1 --- ext/cdio/gstcdio.h
|
pascal@21405
|
2 +++ ext/cdio/gstcdio.h
|
pascal@21405
|
3 @@ -28,11 +28,20 @@
|
pascal@21405
|
4 GST_DEBUG_CATEGORY_EXTERN (gst_cdio_debug);
|
pascal@21405
|
5 #define GST_CAT_DEFAULT gst_cdio_debug
|
pascal@21405
|
6
|
pascal@21405
|
7 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
8 void gst_cdio_add_cdtext_field (GstObject * src,
|
pascal@21405
|
9 cdtext_t * cdtext,
|
pascal@21405
|
10 cdtext_field_t field,
|
pascal@21405
|
11 const gchar * gst_tag,
|
pascal@21405
|
12 + GstTagList ** p_tags,
|
pascal@21405
|
13 + track_t track);
|
pascal@21405
|
14 +#else
|
pascal@21405
|
15 +void gst_cdio_add_cdtext_field (GstObject * src,
|
pascal@21405
|
16 + cdtext_t * cdtext,
|
pascal@21405
|
17 + cdtext_field_t field,
|
pascal@21405
|
18 + const gchar * gst_tag,
|
pascal@21405
|
19 GstTagList ** p_tags);
|
pascal@21405
|
20 +#endif
|
pascal@21405
|
21
|
pascal@21405
|
22 GstTagList * gst_cdio_get_cdtext (GstObject * src,
|
pascal@21405
|
23 CdIo * cdio,
|
pascal@21405
|
24 --- ext/cdio/gstcdio.c
|
pascal@21405
|
25 +++ ext/cdio/gstcdio.c
|
pascal@21405
|
26 @@ -30,12 +30,21 @@
|
pascal@21405
|
27 GST_DEBUG_CATEGORY (gst_cdio_debug);
|
pascal@21405
|
28
|
pascal@21405
|
29 void
|
pascal@21405
|
30 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
31 gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext,
|
pascal@21405
|
32 + cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags, track_t track)
|
pascal@21405
|
33 +#else
|
pascal@21405
|
34 +gst_cdio_add_cdtext_field (GstObject * src, cdtext_t * cdtext,
|
pascal@21405
|
35 cdtext_field_t field, const gchar * gst_tag, GstTagList ** p_tags)
|
pascal@21405
|
36 +#endif
|
pascal@21405
|
37 {
|
pascal@21405
|
38 const gchar *txt;
|
pascal@21405
|
39
|
pascal@21405
|
40 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
41 + txt = cdtext_get_const (cdtext, field, track);
|
pascal@21405
|
42 +#else
|
pascal@21405
|
43 txt = cdtext_get_const (field, cdtext);
|
pascal@21405
|
44 +#endif
|
pascal@21405
|
45 if (txt == NULL || *txt == '\0') {
|
pascal@21405
|
46 GST_DEBUG_OBJECT (src, "empty CD-TEXT field %u (%s)", field, gst_tag);
|
pascal@21405
|
47 return;
|
pascal@21405
|
48 @@ -62,14 +71,23 @@
|
pascal@21405
|
49 GstTagList *tags = NULL;
|
pascal@21405
|
50 cdtext_t *t;
|
pascal@21405
|
51
|
pascal@21405
|
52 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
53 + t = cdio_get_cdtext (cdio);
|
pascal@21405
|
54 +#else
|
pascal@21405
|
55 t = cdio_get_cdtext (cdio, track);
|
pascal@21405
|
56 +#endif
|
pascal@21405
|
57 if (t == NULL) {
|
pascal@21405
|
58 GST_DEBUG_OBJECT (src, "no CD-TEXT for track %u", track);
|
pascal@21405
|
59 return NULL;
|
pascal@21405
|
60 }
|
pascal@21405
|
61
|
pascal@21405
|
62 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
63 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_PERFORMER, GST_TAG_ARTIST, &tags, track);
|
pascal@21405
|
64 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_TITLE, GST_TAG_TITLE, &tags, track);
|
pascal@21405
|
65 +#else
|
pascal@21405
|
66 gst_cdio_add_cdtext_field (src, t, CDTEXT_PERFORMER, GST_TAG_ARTIST, &tags);
|
pascal@21405
|
67 gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_TITLE, &tags);
|
pascal@21405
|
68 +#endif
|
pascal@21405
|
69
|
pascal@21405
|
70 return tags;
|
pascal@21405
|
71 }
|
pascal@21405
|
72 @@ -79,15 +97,24 @@
|
pascal@21405
|
73 {
|
pascal@21405
|
74 cdtext_t *t;
|
pascal@21405
|
75
|
pascal@21405
|
76 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
77 + t = cdio_get_cdtext (cdio);
|
pascal@21405
|
78 +#else
|
pascal@21405
|
79 t = cdio_get_cdtext (cdio, 0);
|
pascal@21405
|
80 +#endif
|
pascal@21405
|
81 if (t == NULL) {
|
pascal@21405
|
82 GST_DEBUG_OBJECT (src, "no CD-TEXT for album");
|
pascal@21405
|
83 return;
|
pascal@21405
|
84 }
|
pascal@21405
|
85
|
pascal@21405
|
86 /* FIXME: map CDTEXT_PERFORMER to GST_TAG_ALBUM_ARTIST once we have that */
|
pascal@21405
|
87 +#if LIBCDIO_VERSION_NUM >= 90
|
pascal@21405
|
88 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_TITLE, GST_TAG_ALBUM, &tags, 0);
|
pascal@21405
|
89 + gst_cdio_add_cdtext_field (src, t, CDTEXT_FIELD_GENRE, GST_TAG_GENRE, &tags, 0);
|
pascal@21405
|
90 +#else
|
pascal@21405
|
91 gst_cdio_add_cdtext_field (src, t, CDTEXT_TITLE, GST_TAG_ALBUM, &tags);
|
pascal@21405
|
92 gst_cdio_add_cdtext_field (src, t, CDTEXT_GENRE, GST_TAG_GENRE, &tags);
|
pascal@21405
|
93 +#endif
|
pascal@21405
|
94
|
pascal@21405
|
95 GST_DEBUG ("CD-TEXT album tags: %" GST_PTR_FORMAT, tags);
|
pascal@21405
|
96 }
|