--- /dev/null
+/*
+ * Copyright (c) 2013 - Mauro Carvalho Chehab <m.chehab@samsung.com>
+ *
+ * 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 version 2
+ * of the License.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ * Described on IEC/CENELEC DS/EN 62216-1:2011
+ *
+ * I couldn't find the original version, so I used what's there at:
+ * http://tdt.telecom.pt/recursos/apresentacoes/Signalling Specifications for DTT deployment in Portugal.pdf
+ */
+
+#ifndef _PARTIAL_RECEPTION_H
+#define _PARTIAL_RECEPTION_H
+
+#include <stdint.h>
+#include <unistd.h> /* ssize_t */
+
+struct isdb_partial_reception_service_id {
+ uint16_t service_id;
+} __attribute__((packed));
+
+struct isdb_desc_partial_reception {
+ uint8_t type;
+ uint8_t length;
+ struct dvb_desc *next;
+
+ struct isdb_partial_reception_service_id *partial_reception;
+} __attribute__((packed));
+
+struct dvb_v5_fe_parms;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void isdb_desc_partial_reception_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_desc *desc);
+void isdb_desc_partial_reception_print(struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
descriptors/desc_isdbt_delivery.c ../include/descriptors/desc_isdbt_delivery.h \
descriptors/desc_logical_channel.c ../include/descriptors/desc_logical_channel.h \
descriptors/desc_ts_info.c ../include/descriptors/desc_ts_info.h \
+ descriptors/desc_partial_reception.c ../include/descriptors/desc_partial_reception.h \
descriptors/nit.c ../include/descriptors/nit.h \
descriptors/sdt.c ../include/descriptors/sdt.h \
descriptors/vct.c ../include/descriptors/vct.h \
#include "descriptors/desc_hierarchy.h"
#include "descriptors/desc_ts_info.h"
#include "descriptors/desc_logical_channel.h"
+#include "descriptors/desc_partial_reception.h"
#include "descriptors/desc_extension.h"
ssize_t dvb_desc_init(const uint8_t *buf, struct dvb_desc *desc)
},
[partial_reception_descriptor] = {
.name = "partial_reception_descriptor",
- .init = NULL,
- .print = NULL,
+ .init = isdb_desc_partial_reception_init,
+ .print = isdb_desc_partial_reception_print,
.free = NULL,
- .size = 0,
+ .size = sizeof(struct isdb_desc_partial_reception),
},
[emergency_information_descriptor] = {
.name = "emergency_information_descriptor",
--- /dev/null
+/*
+ * Copyright (c) 2013 - Mauro Carvalho Chehab <m.chehab@samsung.com>
+ *
+ * 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 version 2
+ * of the License.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ * Described on ARIB STD-B10 as Partial reception descriptor
+ */
+
+#include "descriptors.h"
+#include "descriptors/desc_partial_reception.h"
+#include "dvb-fe.h"
+#include "parse_string.h"
+
+void isdb_desc_partial_reception_init(struct dvb_v5_fe_parms *parms,
+ const uint8_t *buf, struct dvb_desc *desc)
+{
+ struct isdb_desc_partial_reception *d = (void *)desc;
+ unsigned char *p = (unsigned char *)buf;
+ size_t len;
+ int i;
+
+ d->partial_reception = malloc(d->length);
+ if (!d->partial_reception)
+ dvb_perror("Out of memory!");
+
+ memcpy(d->partial_reception, p, d->length);
+
+ len = d->length / sizeof(d->partial_reception);
+
+ for (i = 0; i < len; i++)
+ bswap16(d->partial_reception[i].service_id);
+}
+
+void isdb_desc_partial_reception_print(struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc)
+{
+ struct isdb_desc_partial_reception *d = (void *)desc;
+ int i;
+ size_t len;
+
+ len = d->length / sizeof(d->partial_reception);
+
+ for (i = 0; i < len; i++) {
+ dvb_log("| service ID[%d] %d", i, d->partial_reception[i].service_id);
+ }
+}