void hexdump(struct dvb_v5_fe_parms *parms, const char *prefix, const unsigned char *buf, int len);
-int dvb_parse_descriptors(struct dvb_v5_fe_parms *parms, const uint8_t *buf, uint16_t section_length, struct dvb_desc **head_desc);
-void dvb_free_descriptors(struct dvb_desc **list);
-void dvb_print_descriptors(struct dvb_v5_fe_parms *parms, struct dvb_desc *desc);
+int dvb_desc_parse(struct dvb_v5_fe_parms *parms, const uint8_t *buf, uint16_t section_length, struct dvb_desc **head_desc);
+void dvb_desc_free (struct dvb_desc **list);
+void dvb_desc_print(struct dvb_v5_fe_parms *parms, struct dvb_desc *desc);
#ifdef __cplusplus
}
char *default_charset = "iso-8859-1";
char *output_charset = "utf-8";
-int dvb_parse_descriptors(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
+int dvb_desc_parse(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
uint16_t buflen, struct dvb_desc **head_desc)
{
const uint8_t *ptr = buf, *endbuf = buf + buflen;
return 0;
}
-void dvb_print_descriptors(struct dvb_v5_fe_parms *parms, struct dvb_desc *desc)
+void dvb_desc_print(struct dvb_v5_fe_parms *parms, struct dvb_desc *desc)
{
while (desc) {
dvb_desc_print_func print = dvb_descriptors[desc->type].print;
}
}
-void dvb_free_descriptors(struct dvb_desc **list)
+void dvb_desc_free(struct dvb_desc **list)
{
struct dvb_desc *desc = *list;
while (desc) {
endbuf - p, size);
return -5;
}
- dvb_parse_descriptors(parms, p, size, &event->descriptor);
+ dvb_desc_parse(parms, p, size, &event->descriptor);
p += size;
}
while (event) {
struct atsc_table_eit_event *tmp = event;
- dvb_free_descriptors((struct dvb_desc **) &event->descriptor);
+ dvb_desc_free((struct dvb_desc **) &event->descriptor);
event = event->next;
free(tmp);
}
dvb_loginfo("| Duration %dh %dm %ds", event->duration / 3600, (event->duration % 3600) / 60, event->duration % 60);
dvb_loginfo("| ETM %d", event->etm);
dvb_loginfo("| title length %d", event->title_length);
- dvb_print_descriptors(parms, event->descriptor);
+ dvb_desc_print(parms, event->descriptor);
event = event->next;
events++;
}
/* parse the descriptors */
if (endbuf > p) {
uint16_t desc_length = endbuf - p;
- if (dvb_parse_descriptors(parms, p, desc_length,
+ if (dvb_desc_parse(parms, p, desc_length,
head_desc) != 0) {
return -4;
}
void dvb_table_cat_free(struct dvb_table_cat *cat)
{
- dvb_free_descriptors((struct dvb_desc **) &cat->descriptor);
+ dvb_desc_free((struct dvb_desc **) &cat->descriptor);
free(cat);
}
{
dvb_loginfo("CAT");
dvb_table_header_print(parms, &cat->header);
- dvb_print_descriptors(parms, cat->descriptor);
+ dvb_desc_print(parms, cat->descriptor);
}
endbuf - p, desc_length);
desc_length = endbuf - p;
}
- if (dvb_parse_descriptors(parms, p, desc_length,
+ if (dvb_desc_parse(parms, p, desc_length,
&event->descriptor) != 0) {
return -4;
}
{
struct dvb_table_eit_event *event = eit->event;
while (event) {
- dvb_free_descriptors((struct dvb_desc **) &event->descriptor);
+ dvb_desc_free((struct dvb_desc **) &event->descriptor);
struct dvb_table_eit_event *tmp = event;
event = event->next;
free(tmp);
dvb_loginfo("| Duration %dh %dm %ds", event->duration / 3600, (event->duration % 3600) / 60, event->duration % 60);
dvb_loginfo("| free CA mode %d", event->free_CA_mode);
dvb_loginfo("| running status %d: %s", event->running_status, dvb_eit_running_status_name[event->running_status] );
- dvb_print_descriptors(parms, event->descriptor);
+ dvb_desc_print(parms, event->descriptor);
event = event->next;
events++;
}
endbuf - p, size);
return -3;
}
- dvb_parse_descriptors(parms, p, size, &table->descriptor);
+ dvb_desc_parse(parms, p, size, &table->descriptor);
p += size;
}
{
struct atsc_table_mgt_table *table = mgt->table;
- dvb_free_descriptors((struct dvb_desc **) &mgt->descriptor);
+ dvb_desc_free((struct dvb_desc **) &mgt->descriptor);
while (table) {
struct atsc_table_mgt_table *tmp = table;
- dvb_free_descriptors((struct dvb_desc **) &table->descriptor);
+ dvb_desc_free((struct dvb_desc **) &table->descriptor);
table = table->next;
free(tmp);
}
dvb_loginfo("| size %d", table->size);
dvb_loginfo("| one3 %d", table->one3);
dvb_loginfo("| desc_length %d", table->desc_length);
- dvb_print_descriptors(parms, table->descriptor);
+ dvb_desc_print(parms, table->descriptor);
table = table->next;
tables++;
}
endbuf - p, size);
return -3;
}
- dvb_parse_descriptors(parms, p, size, head_desc);
+ dvb_desc_parse(parms, p, size, head_desc);
p += size;
size = sizeof(union dvb_table_nit_transport_header);
endbuf - p, desc_length);
desc_length = endbuf - p;
}
- if (dvb_parse_descriptors(parms, p, desc_length,
+ if (dvb_desc_parse(parms, p, desc_length,
&transport->descriptor) != 0) {
return -6;
}
void dvb_table_nit_free(struct dvb_table_nit *nit)
{
struct dvb_table_nit_transport *transport = nit->transport;
- dvb_free_descriptors((struct dvb_desc **) &nit->descriptor);
+ dvb_desc_free((struct dvb_desc **) &nit->descriptor);
while (transport) {
- dvb_free_descriptors((struct dvb_desc **) &transport->descriptor);
+ dvb_desc_free((struct dvb_desc **) &transport->descriptor);
struct dvb_table_nit_transport *tmp = transport;
transport = transport->next;
free(tmp);
dvb_loginfo("NIT");
dvb_table_header_print(parms, &nit->header);
dvb_loginfo("| desc_length %d", nit->desc_length);
- dvb_print_descriptors(parms, nit->descriptor);
+ dvb_desc_print(parms, nit->descriptor);
while (transport) {
dvb_loginfo("|- transport %04x network %04x", transport->transport_id, transport->network_id);
- dvb_print_descriptors(parms, transport->descriptor);
+ dvb_desc_print(parms, transport->descriptor);
transport = transport->next;
transports++;
}
desc_length, endbuf - p);
desc_length = endbuf - p;
}
- if (dvb_parse_descriptors(parms, p, desc_length,
+ if (dvb_desc_parse(parms, p, desc_length,
head_desc) != 0) {
return -3;
}
endbuf - p, desc_length);
desc_length = endbuf - p;
}
- if (dvb_parse_descriptors(parms, p, desc_length,
+ if (dvb_desc_parse(parms, p, desc_length,
&stream->descriptor) != 0) {
return -4;
}
{
struct dvb_table_pmt_stream *stream = pmt->stream;
while(stream) {
- dvb_free_descriptors((struct dvb_desc **) &stream->descriptor);
+ dvb_desc_free((struct dvb_desc **) &stream->descriptor);
struct dvb_table_pmt_stream *tmp = stream;
stream = stream->next;
free(tmp);
}
- dvb_free_descriptors((struct dvb_desc **) &pmt->descriptor);
+ dvb_desc_free((struct dvb_desc **) &pmt->descriptor);
free(pmt);
}
dvb_loginfo("| descriptor length %d", pmt->desc_length);
dvb_loginfo("| zero3 %d", pmt->zero3);
dvb_loginfo("| reserved3 %d", pmt->reserved3);
- dvb_print_descriptors(parms, pmt->descriptor);
+ dvb_desc_print(parms, pmt->descriptor);
dvb_loginfo("|\\");
const struct dvb_table_pmt_stream *stream = pmt->stream;
uint16_t streams = 0;
dvb_loginfo("|- stream 0x%04x: %s (%x)", stream->elementary_pid,
pmt_stream_name[stream->type], stream->type);
dvb_loginfo("| descriptor length %d", stream->desc_length);
- dvb_print_descriptors(parms, stream->descriptor);
+ dvb_desc_print(parms, stream->descriptor);
stream = stream->next;
streams++;
}
endbuf - p, desc_length);
desc_length = endbuf - p;
}
- if (dvb_parse_descriptors(parms, p, desc_length,
+ if (dvb_desc_parse(parms, p, desc_length,
&service->descriptor) != 0) {
return -4;
}
{
struct dvb_table_sdt_service *service = sdt->service;
while(service) {
- dvb_free_descriptors((struct dvb_desc **) &service->descriptor);
+ dvb_desc_free((struct dvb_desc **) &service->descriptor);
struct dvb_table_sdt_service *tmp = service;
service = service->next;
free(tmp);
dvb_loginfo("| free CA mode %d", service->free_CA_mode);
dvb_loginfo("| running status %d", service->running_status);
dvb_loginfo("| descriptor length %d", service->desc_length);
- dvb_print_descriptors(parms, service->descriptor);
+ dvb_desc_print(parms, service->descriptor);
service = service->next;
services++;
}
}
/* get the descriptors for each program */
- dvb_parse_descriptors(parms, p, channel->descriptors_length,
+ dvb_desc_parse(parms, p, channel->descriptors_length,
&channel->descriptor);
p += channel->descriptors_length;
d->descriptor_length, endbuf - p);
return -3;
}
- dvb_parse_descriptors(parms, p, d->descriptor_length,
+ dvb_desc_parse(parms, p, d->descriptor_length,
&vct->descriptor);
}
if (endbuf - p)
{
struct atsc_table_vct_channel *channel = vct->channel;
while (channel) {
- dvb_free_descriptors((struct dvb_desc **) &channel->descriptor);
+ dvb_desc_free((struct dvb_desc **) &channel->descriptor);
struct atsc_table_vct_channel *tmp = channel;
channel = channel->next;
free(tmp);
}
- dvb_free_descriptors((struct dvb_desc **) &vct->descriptor);
+ dvb_desc_free((struct dvb_desc **) &vct->descriptor);
free(vct);
}
dvb_loginfo("| service type %d", channel->service_type);
dvb_loginfo("| source id %d", channel->source_id);
- dvb_print_descriptors(parms, channel->descriptor);
+ dvb_desc_print(parms, channel->descriptor);
channel = channel->next;
channels++;
}