aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-01-04 13:17:07 -0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-01-11 14:28:12 +0000
commitcf497d56f9c712cf5d7d32699d88de6504c209dc (patch)
tree7ec509c09f30856a5655a8009d2e90cc7d215229
parente1d1561cd7061e5c2d72507e3ab367f94ed655d4 (diff)
binding: mediaplayer: only get audio results
Since video playback doesn't work yet don't populate the playlist with video media entries. Bug-AGL: SPEC-1236 Change-Id: I3b161351d975442e512bdbf2215174be2301069d Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--binding/afm-common.h1
-rw-r--r--binding/afm-mediaplayer-binding.c16
2 files changed, 15 insertions, 2 deletions
diff --git a/binding/afm-common.h b/binding/afm-common.h
index 302dd26..34258da 100644
--- a/binding/afm-common.h
+++ b/binding/afm-common.h
@@ -35,6 +35,7 @@ struct playlist_item {
gchar *genre;
gint64 duration;
gchar *media_path;
+ gchar *media_type;
};
enum {
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 478ba0e..b344917 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -105,6 +105,14 @@ static gboolean populate_from_json(struct playlist_item *item, json_object *jdic
return ret;
item->media_path = g_strdup(json_object_get_string(val));
+ ret = json_object_object_get_ex(jdict, "type", &val);
+ if (!ret) {
+ g_object_unref(item->media_path);
+ return ret;
+ }
+ item->media_type = g_strdup(json_object_get_string(val));
+
+
ret = json_object_object_get_ex(jdict, "title", &val);
if (ret) {
item->title = g_strdup(json_object_get_string(val));
@@ -199,8 +207,12 @@ static json_object *populate_json_playlist(json_object *jresp)
json_object *jarray = json_object_new_array();
for (l = playlist; l; l = l->next) {
- json_object *item = populate_json(l->data);
- json_object_array_add(jarray, item);
+ struct playlist_item *track = l->data;
+
+ if (track && !g_strcmp0(track->media_type, "audio")) {
+ json_object *item = populate_json(track);
+ json_object_array_add(jarray, item);
+ }
}
json_object_object_add(jresp, "list", jarray);
bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
DESCRIPTION = "Build VideoOnDemand server"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
#LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
#		   "  

PV = "0.1"

SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/vod-server;protocol=https;branch=${AGL_BRANCH}"
SRC_URI += "file://0001-Fix-cross-compilation-with-yocto.patch \
            file://vod-demo.service"

S = "${WORKDIR}/git"
#SRCREV = "8c5f2324d7aa61669324aec1a0ad091fe1379489"
SRCREV = "${AGL_DEFAULT_REVISION}"

do_install() {
        install -m 0755 -d ${D}${bindir}
        install -m 0755 ${S}/VideoOnDemand ${D}${bindir}/VideoOnDemand

        # Install VOD server systemd service (user)
        if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
            install -m 644 -p -D ${WORKDIR}/vod-demo.service ${D}${systemd_user_unitdir}/vod-demo.service

            # Execute install manually for root user on behalf of systemctl script
            # because it doesn't support user mode of systemd.
            install -m 0755 -d ${D}/home/root/.config/systemd/user/default.target.wants/
            ln -sf ${systemd_user_unitdir}/vod-demo.service ${D}/home/root/.config/systemd/user/default.target.wants/vod-demo.service
        fi
}

FILES_${PN} += " \
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/vod-demo.service', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/home/root/.config/systemd/user/default.target.wants/vod-demo.service', '', d)} \
    "