From 3c00057b42aecac304125cbb61c256f83702d7b3 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sat, 1 Jun 2013 11:58:18 +0100 Subject: [PATCH] linuxdvb: new service file --- src/input/mpegts/linuxdvb/linuxdvb_service.c | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/input/mpegts/linuxdvb/linuxdvb_service.c diff --git a/src/input/mpegts/linuxdvb/linuxdvb_service.c b/src/input/mpegts/linuxdvb/linuxdvb_service.c new file mode 100644 index 00000000..168f2e4e --- /dev/null +++ b/src/input/mpegts/linuxdvb/linuxdvb_service.c @@ -0,0 +1,57 @@ +/* + * Tvheadend - Linux DVB Service + * + * Copyright (C) 2013 Adam Sutton + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tvheadend.h" +#include "input.h" +#include "linuxdvb_private.h" +#include "queue.h" +#include "settings.h" + +#include +#include +#include +#include +#include +#include + +static void +linuxdvb_service_config_save ( service_t *t ) +{ + htsmsg_t *c = htsmsg_create_map(); + mpegts_service_t *s = (mpegts_service_t*)t; + mpegts_service_save(s, c); + hts_settings_save(c, "input/linuxdvb/networks/%s/muxes/%s/services/%s", + idnode_uuid_as_str(&s->s_dvb_mux->mm_network->mn_id), + idnode_uuid_as_str(&s->s_dvb_mux->mm_id), + idnode_uuid_as_str(&s->s_id)); + htsmsg_destroy(c); +} + +mpegts_service_t * +linuxdvb_service_create0 + ( linuxdvb_mux_t *mm, uint16_t sid, uint16_t pmt_pid, + const char *uuid, htsmsg_t *conf ) +{ + extern const idclass_t mpegts_service_class; + mpegts_service_t *s + = mpegts_service_create1(uuid, (mpegts_mux_t*)mm, sid, pmt_pid, conf); + if (s) + s->s_config_save = linuxdvb_service_config_save; + return s; +}