} __attribute__((packed));
struct atsc_table_eit {
- struct atsc_table_header header;
+ ATSC_HEADER();
uint8_t events;
struct atsc_table_eit_event *event;
} __attribute__((packed));
#include <stdint.h>
#include <unistd.h> /* ssize_t */
+#include <libdvbv5/header.h>
+
#define ATSC_BASE_PID 0x1FFB
-struct atsc_table_header {
- uint8_t table_id;
- union {
- uint16_t bitfield;
- struct {
- uint16_t section_length:12;
- uint16_t one:2;
- uint16_t priv:1;
- uint16_t syntax:1;
- } __attribute__((packed));
- } __attribute__((packed));
- uint16_t id;
- uint8_t current_next:1;
- uint8_t version:5;
- uint8_t one2:2;
-
- uint8_t section_id;
- uint8_t last_section;
- uint8_t protocol_version;
-} __attribute__((packed));
-
-struct dvb_v5_fe_parms;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#define ATSC_HEADER() \
+ struct dvb_table_header header; \
+ uint8_t protocol_version; \
-int atsc_table_header_init (struct atsc_table_header *t);
-void atsc_table_header_print(struct dvb_v5_fe_parms *parms, const struct atsc_table_header *t);
+#define ATSC_TABLE_HEADER_PRINT(_parms, _table) \
+ dvb_table_header_print(_parms, &_table->header); \
+ dvb_log("| protocol_version %d", _table->protocol_version); \
-#ifdef __cplusplus
-}
-#endif
#endif
union {
uint16_t bitfield;
struct {
- uint16_t section_length:10;
- uint8_t zero:2;
+ uint16_t section_length:12;
uint8_t one:2;
- uint8_t zero2:1;
+ uint8_t zero:1;
uint8_t syntax:1;
} __attribute__((packed));
} __attribute__((packed));
} __attribute__((packed));
struct atsc_table_mgt {
- struct atsc_table_header header;
+ ATSC_HEADER();
uint16_t tables;
struct atsc_table_mgt_table *table;
struct dvb_desc *descriptor;
} __attribute__((packed));
struct atsc_table_vct {
- struct atsc_table_header header;
+ ATSC_HEADER();
uint8_t num_channels_in_section;
dvb-scan.c \
descriptors.c \
descriptors/header.c \
- descriptors/atsc_header.c \
descriptors/pat.c \
descriptors/pmt.c \
descriptors/nit.c \
void atsc_table_eit_print(struct dvb_v5_fe_parms *parms, struct atsc_table_eit *eit)
{
dvb_log("EIT");
- atsc_table_header_print(parms, &eit->header);
+ ATSC_TABLE_HEADER_PRINT(parms, eit);
const struct atsc_table_eit_event *event = eit->event;
uint16_t events = 0;
+++ /dev/null
-/*
- * Copyright (c) 2013 - Andre Roth <neolynx@gmail.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
- *
- */
-
-#include <libdvbv5/atsc_header.h>
-#include <libdvbv5/descriptors.h>
-#include <libdvbv5/dvb-fe.h>
-
-int atsc_table_header_init(struct atsc_table_header *t)
-{
- bswap16(t->bitfield);
- bswap16(t->id);
- return 0;
-}
-
-void atsc_table_header_print(struct dvb_v5_fe_parms *parms, const struct atsc_table_header *t)
-{
- dvb_log("| table_id %02x", t->table_id);
- dvb_log("| section_length %d", t->section_length);
- dvb_log("| syntax %d", t->syntax);
- dvb_log("| priv %d", t->priv);
- dvb_log("| one %d", t->one);
- dvb_log("| id %d", t->id);
- dvb_log("| one2 %d", t->one2);
- dvb_log("| version %d", t->version);
- dvb_log("| current_next %d", t->current_next);
- dvb_log("| section_id %d", t->section_id);
- dvb_log("| last_section %d", t->last_section);
- dvb_log("| protocol_version %d", t->protocol_version);
-}
-
{
dvb_log("| table_id %d", t->table_id);
dvb_log("| section_length %d", t->section_length);
- dvb_log("| zero %d", t->zero);
dvb_log("| one %d", t->one);
- dvb_log("| zero2 %d", t->zero2);
+ dvb_log("| zero %d", t->zero);
dvb_log("| syntax %d", t->syntax);
dvb_log("| transport_stream_id %d", t->id);
dvb_log("| current_next %d", t->current_next);
uint16_t tables = 0;
dvb_log("MGT");
- atsc_table_header_print(parms, &mgt->header);
+ ATSC_TABLE_HEADER_PRINT(parms, mgt);
dvb_log("| tables %d", mgt->tables);
while(table) {
dvb_log("|- type %04x %d", table->type, table->pid);
else
dvb_log("TVCT");
- atsc_table_header_print(parms, &vct->header);
+ ATSC_TABLE_HEADER_PRINT(parms, vct);
dvb_log("|- #channels %d", vct->num_channels_in_section);
dvb_log("|\\ channel_id");