123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- #ifndef _DVB_FILE_H
- #define _DVB_FILE_H
- #include "dvb-fe.h"
- struct dvb_elementary_pid {
- uint8_t type;
- uint16_t pid;
- };
- struct dvb_entry {
- struct dtv_property props[DTV_MAX_COMMAND];
- unsigned int n_props;
- struct dvb_entry *next;
- uint16_t service_id;
- uint16_t *video_pid, *audio_pid;
- struct dvb_elementary_pid *other_el_pid;
- unsigned video_pid_len, audio_pid_len, other_el_pid_len;
- char *channel;
- char *vchannel;
- char *location;
- int sat_number;
- unsigned freq_bpf;
- unsigned diseqc_wait;
- char *lnb;
- };
- struct dvb_file {
- char *fname;
- int n_entries;
- struct dvb_entry *first_entry;
- };
- struct dvb_parse_table {
- unsigned int prop;
- const char **table;
- unsigned int size;
- int mult_factor;
- int has_default_value;
- int default_value;
- };
- struct dvb_parse_struct {
- char *id;
- uint32_t delsys;
- const struct dvb_parse_table *table;
- unsigned int size;
- };
- struct dvb_parse_file {
- int has_delsys_id;
- char *delimiter;
- struct dvb_parse_struct formats[];
- };
- enum dvb_file_formats {
- FILE_UNKNOWN,
- FILE_ZAP,
- FILE_CHANNEL,
- FILE_DVBV5,
- FILE_VDR,
- };
- struct dvb_v5_descriptors;
- #ifdef __cplusplus
- extern "C" {
- #endif
- static inline void dvb_file_free(struct dvb_file *dvb_file)
- {
- struct dvb_entry *entry = dvb_file->first_entry, *next;
- while (entry) {
- next = entry->next;
- if (entry->channel)
- free(entry->channel);
- if (entry->vchannel)
- free(entry->vchannel);
- if (entry->location)
- free(entry->location);
- if (entry->video_pid)
- free(entry->video_pid);
- if (entry->audio_pid)
- free(entry->audio_pid);
- if (entry->other_el_pid)
- free(entry->other_el_pid);
- if (entry->lnb)
- free(entry->lnb);
- free(entry);
- entry = next;
- }
- free(dvb_file);
- }
- extern const struct dvb_parse_file channel_file_format;
- extern const struct dvb_parse_file channel_file_zap_format;
- struct dvb_file *dvb_read_file(const char *fname);
- int dvb_write_file(const char *fname, struct dvb_file *dvb_file);
- struct dvb_file *dvb_read_file_format(const char *fname,
- uint32_t delsys,
- enum dvb_file_formats format);
- int dvb_write_file_format(const char *fname,
- struct dvb_file *dvb_file,
- uint32_t delsys,
- enum dvb_file_formats format);
- int dvb_store_entry_prop(struct dvb_entry *entry,
- uint32_t cmd, uint32_t value);
- int dvb_retrieve_entry_prop(struct dvb_entry *entry,
- uint32_t cmd, uint32_t *value);
- int dvb_store_channel(struct dvb_file **dvb_file,
- struct dvb_v5_fe_parms *parms,
- struct dvb_v5_descriptors *dvb_desc,
- int get_detected, int get_nit);
- int dvb_parse_delsys(const char *name);
- enum dvb_file_formats dvb_parse_format(const char *name);
- struct dvb_file *dvb_parse_format_oneline(const char *fname,
- uint32_t delsys,
- const struct dvb_parse_file *parse_file);
- int dvb_write_format_oneline(const char *fname,
- struct dvb_file *dvb_file,
- uint32_t delsys,
- const struct dvb_parse_file *parse_file);
- int dvb_write_format_vdr(const char *fname,
- struct dvb_file *dvb_file);
- #ifdef __cplusplus
- }
- #endif
- #endif
|