aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-01-18 13:04:21 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-01-29 20:20:19 +0000
commitfba3216156bccf7ca1424e4e4e389369c4eccefe (patch)
tree13d7b877ecdc886042fb20aaee0c1ebfdf68e258
parentdc2a75cb3780a136be51dd2f880f70083ba36733 (diff)
binding: mediaplayer: add check GST_TAG_PREVIEW_IMAGE for album arteel_5.0.2eel/5.0.25.0.2
Add support for using GST_TAG_PREVIEW_IMAGE in case GST_TAG_IMAGE tags aren't available Bug-AGL: SPEC-1241 Change-Id: I3bb4edf8c9350deffa3cf407285a333042403ec9 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--binding/afm-mediaplayer-binding.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index b344917..1c2ce6a 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -439,10 +439,10 @@ static void controls(struct afb_req request)
pthread_mutex_unlock(&mutex);
}
-static gchar *get_album_art(GstTagList *tags)
+static GstSample *parse_album(GstTagList *tags, gchar *tag_type)
{
GstSample *sample = NULL;
- int num = gst_tag_list_get_tag_size(tags, GST_TAG_IMAGE);
+ int num = gst_tag_list_get_tag_size(tags, tag_type);
guint i;
for (i = 0; i < num ; i++) {
@@ -450,7 +450,7 @@ static gchar *get_album_art(GstTagList *tags)
GstStructure *caps;
int type;
- value = gst_tag_list_get_value_index(tags, GST_TAG_IMAGE, i);
+ value = gst_tag_list_get_value_index(tags, tag_type, i);
if (value == NULL)
break;
@@ -463,6 +463,17 @@ static gchar *get_album_art(GstTagList *tags)
break;
}
+ return sample;
+}
+
+static gchar *get_album_art(GstTagList *tags)
+{
+ GstSample *sample;
+
+ sample = parse_album(tags, GST_TAG_IMAGE);
+ if (!sample)
+ sample = parse_album(tags, GST_TAG_PREVIEW_IMAGE);
+
if (sample) {
GstBuffer *buffer = gst_sample_get_buffer(sample);
GstMapInfo map;