libdvbv5: support info info log via dvb_loginfo
PATCH 1/11 libdvbv5: support info info log via dvb_loginfo
dvb_loginfo log support without setting output color.
--- lib/include/dvb-log.h | 3 +++ lib/libdvbv5/dvb-log.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-)
lib/include/dvb-log.h +3 -0
@@ -38,6 +38,9 @@ typedef void (*dvb_logfunc)(int level, const char *fmt, ...) __attribute__ (( fo #define dvb_logwarn(fmt, arg...) do {\ parms->logfunc(LOG_WARNING, fmt, ##arg); \ } while (0) +#define dvb_loginfo(fmt, arg...) do {\ + parms->logfunc(LOG_NOTICE, fmt, ##arg); \ +} while (0)#define dvb_perror (msg) do {\
lib/libdvbv5/dvb-log.c +13 -13
@@ -30,15 +30,15 @@ static const struct loglevel {const char *color;int fd; } loglevels[9] = { - {"EMERG ", "\033[31m", STDERR_FILENO }, - {"ALERT ", "\033[31m", STDERR_FILENO }, - {"CRITICAL", "\033[31m", STDERR_FILENO }, - {"ERROR ", "\033[31m", STDERR_FILENO }, - {"WARNING ", "\033[33m", STDOUT_FILENO }, - {"NOTICE ", "\033[36m", STDOUT_FILENO }, - {"INFO ", "\033[36m", STDOUT_FILENO }, - {"DEBUG ", "\033[32m", STDOUT_FILENO }, - {"", "\033[0m", STDOUT_FILENO }, + {"EMERG ", "\033[31m", STDERR_FILENO }, + {"ALERT ", "\033[31m", STDERR_FILENO }, + {"CRITICAL ", "\033[31m", STDERR_FILENO }, + {"ERROR ", "\033[31m", STDERR_FILENO }, + {"WARNING ", "\033[33m", STDOUT_FILENO }, + {"", "\033[36m", STDOUT_FILENO }, /* NOTICE */ + {"", NULL, STDOUT_FILENO }, /* INFO */ + {"DEBUG ", "\033[32m", STDOUT_FILENO }, + {"", "\033[0m", STDOUT_FILENO }, /* reset*/ }; #define LOG_COLOROFF 8
@@ -49,14 +49,14 @@ void dvb_default_log(int level, const char *fmt, ...)va_list ap;va_start (ap, fmt);FILE *out = stdout; -if (STDERR_FILENO == loglevels[level].fd) +if (STDERR_FILENO == loglevels[level].fd) out = stderr; -if (isatty (loglevels[level].fd)) +if (loglevels[level].color &&isatty (loglevels[level].fd))fputs (loglevels[level].color, out); -fprintf (out,"%s " , loglevels[level].name); +fprintf (out,"%s" , loglevels[level].name);vfprintf (out, fmt, ap);fprintf (out,"\n" ); -if (isatty (loglevels[level].fd)) +if (loglevels[level].color &&isatty (loglevels[level].fd))fputs (loglevels[LOG_COLOROFF ].color, out);va_end (ap); }
Signature · 1 line
1.8.3.2
PATCH 2/11 libdvbv5: fix asprintf compile warnings
- allow logging in dvb_vchannel
- get rid of compile warings about unused asprintf return value
--- lib/libdvbv5/dvb-demux.c | 8 ++++++-- lib/libdvbv5/dvb-fe.c | 8 ++++++-- lib/libdvbv5/dvb-file.c | 31 +++++++++++++++++++++---------- utils/dvb/dvbv5-zap.c | 17 +++++++++++++---- 4 files changed, 46 insertions(+), 18 deletions(-)
lib/libdvbv5/dvb-demux.c +6 -2
@@ -43,9 +43,13 @@int dvb_dmx_open (int adapter,int demux) {char * demux_name =NULL ; +int fd_demux; +int r; -asprintf (&demux_name,"/dev/dvb/adapter%i/demux%i" , adapter, demux ); -int fd_demux =open ( demux_name,O_RDWR |O_NONBLOCK ); + r =asprintf (&demux_name,"/dev/dvb/adapter%i/demux%i" , adapter, demux ); +if (r <0 ) +return -1 ; + fd_demux =open ( demux_name,O_RDWR |O_NONBLOCK );free (demux_name);return fd_demux; }
lib/libdvbv5/dvb-fe.c +6 -2
@@ -52,12 +52,16 @@ struct dvb_v5_fe_parms *dvb_fe_open(int adapter, int frontend, unsigned verbose,struct dvb_v5_fe_parms *dvb_fe_open2 (int adapter,int frontend,unsigned verbose,unsigned use_legacy_call,dvb_logfunc logfunc) { -int fd, i; +int fd, i, r;char *fname;struct dtv_properties dtv_prop;struct dvb_v5_fe_parms *parms =NULL ; -asprintf (&fname,"/dev/dvb/adapter%i/frontend%i" , adapter, frontend); + r =asprintf (&fname,"/dev/dvb/adapter%i/frontend%i" , adapter, frontend); +if (r <0 ) { +logfunc (LOG_ERR ,"asprintf error" ); +return NULL ; + }if (!fname) {logfunc (LOG_ERR ,"fname calloc: %s" ,strerror (errno));return NULL ;
lib/libdvbv5/dvb-file.c +21 -10
@@ -807,7 +807,7 @@ int write_dvb_file(const char *fname, struct dvb_file *dvb_file)return 0 ; }; -static char *dvb_vchannel (struct dvb_table_nit *nit,uint16_t service_id) +static char *dvb_vchannel (struct dvb_v5_fe_parms *parms,struct dvb_table_nit *nit,uint16_t service_id) {int i;char *buf;
@@ -817,17 +817,18 @@ static char *dvb_vchannel(struct dvb_table_nit *nit, uint16_t service_id)for (struct dvb_desc_logical_channel *desc = (struct dvb_desc_logical_channel *) nit->descriptor; desc; desc = (struct dvb_desc_logical_channel *) desc->next ) \if (desc->type == logical_channel_number_descriptor) { -// dvb_desc_find(struct dvb_desc_logical_channel, desc, nit, logical_channel_number_descriptor) { +/* FIXME: dvb_desc_find(struct dvb_desc_logical_channel, desc, nit, logical_channel_number_descriptor) ? */ struct dvb_desc_logical_channel *d = (void *)desc; -size_t len; +int r; len = d->length /sizeof (d->lcn); -for (i =0 ; i < len; i++) {if (service_id == d->lcn[i].service_id) { -asprintf (&buf,"%d.%d" , + r =asprintf (&buf,"%d.%d" , d->lcn[i].logical_channel_number, i); +if (r <0 ) +dvb_perror ("asprintf" );return buf; } }
@@ -836,13 +837,16 @@ for( struct dvb_desc_logical_channel *desc = (struct dvb_desc_logical_channel *) dvb_desc_find(struct dvb_desc_ts_info, desc, nit, TS_Information_descriptior) {const struct dvb_desc_ts_info *d = (const void *) desc;const struct dvb_desc_ts_info_transmission_type *t; +int r; t = &d->transmission_type;for (i =0 ; i < t->num_of_service; i++) {if (d->service_id[i] == service_id) { -asprintf (&buf,"%d.%d" , + r =asprintf (&buf,"%d.%d" , d->remote_control_key_id, i); +if (r <0 ) +dvb_perror ("asprintf" );return buf; } }
@@ -1062,13 +1066,16 @@ int store_dvb_channel(struct dvb_file **dvb_file, atsc_vct_channel_foreach(d, dvb_scan_handler->vct) {char *channel =NULL ;char *vchannel =NULL ; +int r; channel =calloc (1 ,strlen (d->short_name) +1 );strcpy (channel, d->short_name); -asprintf (&vchannel,"%d.%d" , + r =asprintf (&vchannel,"%d.%d" , d->major_channel_number, d->minor_channel_number); +if (r <0 ) +dvb_perror ("asprintf" );if (parms->verbose) dvb_log("Virtual channel %s, name = %s",
@@ -1095,6 +1102,7 @@ int store_dvb_channel(struct dvb_file **dvb_file, dvb_sdt_service_foreach(service, dvb_scan_handler->sdt) {char *channel =NULL ;char *vchannel =NULL ; +int r; dvb_desc_find(struct dvb_desc_service, desc, service, service_descriptor) {if (desc->name) {
@@ -1107,12 +1115,15 @@ int store_dvb_channel(struct dvb_file **dvb_file,break ; } -if (!channel) -asprintf (&channel,"#%d" , service->service_id); +if (!channel) { + r =asprintf (&channel,"#%d" , service->service_id); +if (r <0 ) +dvb_perror ("asprintf" ); + }if (parms->verbose)dvb_log ("Storing as channel %s" , channel); - vchannel =dvb_vchannel (dvb_scan_handler->nit, service->service_id); + vchannel =dvb_vchannel (parms, dvb_scan_handler->nit, service->service_id); rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler, service->service_id,
utils/dvb/dvbv5-zap.c +13 -4
@@ -692,6 +692,7 @@ int main(int argc, char **argv)int audio_fd =-1 , video_fd =-1 ;int dvr_fd =-1 , file_fd =-1 ;int err =-1 ; +int r;struct dvb_v5_fe_parms *parms =NULL ;const struct argp argp = { .options = options,
@@ -732,11 +733,19 @@ int main(int argc, char **argv) } } -asprintf (&args.demux_dev, + r =asprintf (&args.demux_dev,"/dev/dvb/adapter%i/demux%i" , args.adapter, args.demux); +if (r <0 ) { +fprintf (stderr,"asprintf error\n" ); +return -1 ; + } -asprintf (&args.dvr_dev, + r =asprintf (&args.dvr_dev,"/dev/dvb/adapter%i/dvr%i" , args.adapter, args.demux); +if (r <0 ) { +fprintf (stderr,"asprintf error\n" ); +return -1 ; + }if (args.silent <2 )fprintf (stderr,"using demux '%s'\n" , args.demux_dev);
@@ -744,11 +753,11 @@ int main(int argc, char **argv)if (!args.confname) {if (!homedir)ERROR ("$HOME not set" ); -asprintf (&args.confname,"%s/.tzap/%i/%s" , + r =asprintf (&args.confname,"%s/.tzap/%i/%s" , homedir, args.adapter,CHANNEL_FILE );if (access (args.confname,R_OK )) {free (args.confname); -asprintf (&args.confname,"%s/.tzap/%s" , + r =asprintf (&args.confname,"%s/.tzap/%s" , homedir,CHANNEL_FILE ); } }
Signature · 1 line
1.8.3.2
PATCH 3/11 libdvbv5: mpeg elementary stream parsers
In reply to André RothImplement parsers for mpeg TS, PES and ES
--- lib/include/descriptors/mpeg_es.h | 109 +++++++++++++++++++++++++++++ lib/include/descriptors/mpeg_pes.h | 111 +++++++++++++++++++++++++++++ lib/include/descriptors/mpeg_ts.h | 79 +++++++++++++++++++++ lib/libdvbv5/descriptors/mpeg_es.c | 76 ++++++++++++++++++++ lib/libdvbv5/descriptors/mpeg_pes.c | 135 ++++++++++++++++++++++++++++++++++++ lib/libdvbv5/descriptors/mpeg_ts.c | 81 ++++++++++++++++++++++ 6 files changed, 591 insertions(+) create mode 100644 lib/include/descriptors/mpeg_es.h create mode 100644 lib/include/descriptors/mpeg_pes.h create mode 100644 lib/include/descriptors/mpeg_ts.h create mode 100644 lib/libdvbv5/descriptors/mpeg_es.c create mode 100644 lib/libdvbv5/descriptors/mpeg_pes.c create mode 100644 lib/libdvbv5/descriptors/mpeg_ts.c
lib/include/descriptors/mpeg_es.h new file +109 -0
@@ -0,0 +1,109 @@ +/* +* Copyright (c) 2013 - Andre Roth <[email protected]> +* +* 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 +* +*/ + +#ifndef _MPEG_ES_H +#define _MPEG_ES_H + +#include <stdint.h> +#include <unistd.h> /* ssize_t */ + +#define DVB_MPEG_ES_PIC_START 0x00 +#define DVB_MPEG_ES_USER_DATA 0xb2 +#define DVB_MPEG_ES_SEQ_START 0xb3 +#define DVB_MPEG_ES_SEQ_EXT 0xb5 +#define DVB_MPEG_ES_GOP 0xb8 +#define DVB_MPEG_ES_SLICES 0x01 ... 0xaf + +struct dvb_mpeg_es_seq_start { +union { +uint32_t bitfield; +struct { +uint32_t type:8 ; +uint32_t sync:24 ; + } __attribute__((packed)); + } __attribute__((packed)); +union { +uint32_t bitfield2; +struct { +uint32_t framerate:4 ; +uint32_t aspect:4 ; +uint32_t height:12 ; +uint32_t width:12 ; + } __attribute__((packed)); + }; +union { +uint32_t bitfield3; +struct { +uint32_t qm_nonintra:1 ; +uint32_t qm_intra:1 ; +uint32_t constrained:1 ; +uint32_t vbv:10 ;// Size of video buffer verifier = 16*1024*vbv buf size +uint32_t one:1 ; +uint32_t bitrate:18 ; + } __attribute__((packed)); + }; +} __attribute__((packed)); + +struct dvb_mpeg_es_pic_start { +union { +uint32_t bitfield; +struct { +uint32_t type:8 ; +uint32_t sync:24 ; + } __attribute__((packed)); + } __attribute__((packed)); +union { +uint32_t bitfield2; +struct { +uint32_t dummy:3 ; +uint32_t vbv_delay:16 ; +uint32_t coding_type:3 ; +uint32_t temporal_ref:10 ; + } __attribute__((packed)); + }; +} __attribute__((packed)); + +enum dvb_mpeg_es_frame_t +{ +DVB_MPEG_ES_FRAME_UNKNOWN , +DVB_MPEG_ES_FRAME_I , +DVB_MPEG_ES_FRAME_P , +DVB_MPEG_ES_FRAME_B , +DVB_MPEG_ES_FRAME_D +}; +extern const char *dvb_mpeg_es_frame_names[5 ]; + +struct dvb_v5_fe_parms ; + +#ifdef __cplusplus +extern "C" { +#endif + +int dvb_mpeg_es_seq_start_init (const uint8_t *buf,ssize_t buflen,struct dvb_mpeg_es_seq_start *seq_start); +void dvb_mpeg_es_seq_start_print (struct dvb_v5_fe_parms *parms,struct dvb_mpeg_es_seq_start *seq_start); + +int dvb_mpeg_es_pic_start_init (const uint8_t *buf,ssize_t buflen,struct dvb_mpeg_es_pic_start *pic_start); +void dvb_mpeg_es_pic_start_print (struct dvb_v5_fe_parms *parms,struct dvb_mpeg_es_pic_start *pic_start); + +#ifdef __cplusplus +} +#endif + +#endif
lib/include/descriptors/mpeg_pes.h new file +111 -0
111 lines not on this page · raw message
lib/include/descriptors/mpeg_ts.h new file +79 -0
79 lines not on this page · raw message
lib/libdvbv5/descriptors/mpeg_es.c new file +76 -0
76 lines not on this page · raw message
lib/libdvbv5/descriptors/mpeg_pes.c new file +135 -0
135 lines not on this page · raw message
lib/libdvbv5/descriptors/mpeg_ts.c new file +81 -0
81 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 4/11 libdvbv5: fix EIT parsing
In reply to André Roththe dvb_table_eit_event now contains the service_id, indicating where the events belong to.
--- lib/include/descriptors/eit.h | 3 ++- lib/libdvbv5/descriptors/eit.c | 35 ++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-)
lib/include/descriptors/eit.h +2 -1
@@ -40,7 +40,7 @@struct dvb_table_eit_event {uint16_t event_id;union { -uint16_t bitfield; +uint16_t bitfield1;/* first 2 bytes are MJD, they need to be bswapped */ uint8_t dvbstart[5 ]; } __attribute__((packed));uint8_t dvbduration[3 ];
@@ -56,6 +56,7 @@ struct dvb_table_eit_event {struct dvb_table_eit_event *next;struct tm start;uint32_t duration; +uint16_t service_id; } __attribute__((packed));struct dvb_table_eit {
lib/libdvbv5/descriptors/eit.c +26 -9
@@ -29,6 +29,11 @@ void dvb_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssizestruct dvb_table_eit_event **head;if (*table_length >0 ) { +memcpy (eit, p,sizeof (struct dvb_table_eit ) -sizeof (eit->event)); + +bswap16 (eit->transport_id); +bswap16 (eit->network_id); +/* find end of curent list */ head = &eit->event;while (*head !=NULL )
@@ -48,18 +53,30 @@ void dvb_table_eit_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssizestruct dvb_table_eit_event *last =NULL ;while ((uint8_t *) p < buf + buflen -4 ) {struct dvb_table_eit_event *event = (struct dvb_table_eit_event *)malloc (sizeof (struct dvb_table_eit_event )); -memcpy (event, p,sizeof (struct dvb_table_eit_event ) -sizeof (event->descriptor) -sizeof (event->next) -sizeof (event->start) -sizeof (event->duration)); - p +=sizeof (struct dvb_table_eit_event ) -sizeof (event->descriptor) -sizeof (event->next) -sizeof (event->start) -sizeof (event->duration); +memcpy (event, p,sizeof (struct dvb_table_eit_event ) - +sizeof (event->descriptor) - +sizeof (event->next) - +sizeof (event->start) - +sizeof (event->duration) - +sizeof (event->service_id)); + p +=sizeof (struct dvb_table_eit_event ) - +sizeof (event->descriptor) - +sizeof (event->next) - +sizeof (event->start) - +sizeof (event->duration) - +sizeof (event->service_id);bswap16 (event->event_id); -bswap16 (event->bitfield); +bswap16 (event->bitfield1);bswap16 (event->bitfield2); event->descriptor =NULL ; event->next =NULL ;dvb_time (event->dvbstart, &event->start); - event->duration =bcd (event->dvbduration[0 ]) *3600 + -bcd (event->dvbduration[1 ]) *60 + -bcd (event->dvbduration[2 ]); + event->duration =bcd ((uint32_t ) event->dvbduration[0 ]) *3600 + +bcd ((uint32_t ) event->dvbduration[1 ]) *60 + +bcd ((uint32_t ) event->dvbduration[2 ]); + + event->service_id = eit->header.id;if (!*head) *head = event;
@@ -102,6 +119,7 @@ void dvb_table_eit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_eit *eichar start[255 ];strftime (start,sizeof (start),"%F %T" , &event->start);dvb_log ("|- %7d" , event->event_id); +dvb_log ("| Service %d" , event->service_id);dvb_log ("| Start %s UTC" , start);dvb_log ("| Duration %dh %dm %ds" , event->duration /3600 , (event->duration %3600 ) /60 , event->duration %60 );dvb_log ("| free CA mode %d" , event->free_CA_mode);
@@ -137,9 +155,8 @@ void dvb_time(const uint8_t data[5], struct tm *tm) tm->tm_mday = day; tm->tm_mon = month -1 ; tm->tm_year = year; - tm->tm_isdst =-1 ; - tm->tm_wday =0 ; - tm->tm_yday =0 ; + tm->tm_isdst =1 ;/* dst in effect, do not adjust */ +mktime ( tm ); }
Signature · 1 line
1.8.3.2
PATCH 6/11 libdvbv5: remove header files from SOURCES in Makefile.am
In reply to André RothThe header files are not needed in the Makefile.am since automake finds the dependencies automatically. This is not needed for installing header files either.
--- lib/libdvbv5/Makefile.am | 87 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 44 deletions(-)
lib/libdvbv5/Makefile.am +43 -44
@@ -52,52 +52,51 @@ noinst_LTLIBRARIES = libdvbv5.la endif libdvbv5_la_SOURCES = \ - crc32.c crc32.h \ - ../include/dvb-frontend.h \ + crc32.c \ dvb-legacy-channel-format.c \ dvb-zap-format.c \ - dvb-v5.c dvb-v5.h \ - parse_string.c parse_string.h \ - dvb-demux.c ../include/dvb-demux.h \ - dvb-fe.c ../include/dvb-fe.h \ - dvb-log.c ../include/dvb-log.h \ - dvb-file.c ../include/dvb-file.h \ - dvb-v5-std.c ../include/dvb-v5-std.h \ - dvb-sat.c ../include/dvb-sat.h \ - dvb-scan.c ../include/dvb-scan.h \ - descriptors.c ../include/descriptors.h \ - descriptors/header.c ../include/libdvbv5/header.h \ - descriptors/atsc_header.c ../include/libdvbv5/atsc_header.h \ - descriptors/pat.c ../include/libdvbv5/pat.h \ - descriptors/pmt.c ../include/libdvbv5/pmt.h \ - descriptors/nit.c ../include/libdvbv5/nit.h \ - descriptors/sdt.c ../include/libdvbv5/sdt.h \ - descriptors/vct.c ../include/libdvbv5/vct.h \ - descriptors/mgt.c ../include/libdvbv5/mgt.h \ - descriptors/eit.c ../include/libdvbv5/eit.h \ - descriptors/atsc_eit.c ../include/libdvbv5/atsc_eit.h \ - descriptors/desc_language.c ../include/libdvbv5/desc_language.h \ - descriptors/desc_network_name.c ../include/libdvbv5/desc_network_name.h \ - descriptors/desc_cable_delivery.c ../include/libdvbv5/desc_cable_delivery.h \ - descriptors/desc_sat.c ../include/libdvbv5/desc_sat.h \ - descriptors/desc_terrestrial_delivery.c ../include/libdvbv5/desc_terrestrial_delivery.h \ - descriptors/desc_t2_delivery.c ../include/libdvbv5/desc_t2_delivery.h \ - descriptors/desc_service.c ../include/libdvbv5/desc_service.h \ - descriptors/desc_frequency_list.c ../include/libdvbv5/desc_frequency_list.h \ - descriptors/desc_service_list.c ../include/libdvbv5/desc_service_list.h \ - descriptors/desc_event_short.c ../include/libdvbv5/desc_event_short.h \ - descriptors/desc_event_extended.c ../include/libdvbv5/desc_event_extended.h \ - descriptors/desc_atsc_service_location.c ../include/libdvbv5/desc_atsc_service_location.h \ - descriptors/desc_hierarchy.c ../include/libdvbv5/desc_hierarchy.h \ - descriptors/desc_extension.c ../include/libdvbv5/desc_extension.h \ - descriptors/desc_isdbt_delivery.c ../include/libdvbv5/desc_isdbt_delivery.h \ - descriptors/desc_logical_channel.c ../include/libdvbv5/desc_logical_channel.h \ - descriptors/desc_ts_info.c ../include/libdvbv5/desc_ts_info.h \ - descriptors/desc_partial_reception.c ../include/libdvbv5/desc_partial_reception.h \ - descriptors/desc_service_location.c ../include/libdvbv5/desc_service_location.h \ - descriptors/mpeg_ts.c ../include/libdvbv5/mpeg_ts.h \ - descriptors/mpeg_pes.c ../include/libdvbv5/mpeg_pes.h \ - descriptors/mpeg_es.c ../include/libdvbv5/mpeg_es.h + dvb-v5.c \ + parse_string.c \ + dvb-demux.c \ + dvb-fe.c \ + dvb-log.c \ + dvb-file.c \ + dvb-v5-std.c \ + dvb-sat.c \ + dvb-scan.c \ + descriptors.c \ + descriptors/header.c \ + descriptors/atsc_header.c \ + descriptors/pat.c \ + descriptors/pmt.c \ + descriptors/nit.c \ + descriptors/sdt.c \ + descriptors/vct.c \ + descriptors/mgt.c \ + descriptors/eit.c \ + descriptors/atsc_eit.c \ + descriptors/desc_language.c \ + descriptors/desc_network_name.c \ + descriptors/desc_cable_delivery.c \ + descriptors/desc_sat.c \ + descriptors/desc_terrestrial_delivery.c \ + descriptors/desc_t2_delivery.c \ + descriptors/desc_service.c \ + descriptors/desc_frequency_list.c \ + descriptors/desc_service_list.c \ + descriptors/desc_event_short.c \ + descriptors/desc_event_extended.c \ + descriptors/desc_atsc_service_location.c \ + descriptors/desc_hierarchy.c \ + descriptors/desc_extension.c \ + descriptors/desc_isdbt_delivery.c \ + descriptors/desc_logical_channel.c \ + descriptors/desc_ts_info.c \ + descriptors/desc_partial_reception.c \ + descriptors/desc_service_location.c \ + descriptors/mpeg_ts.c \ + descriptors/mpeg_pes.c \ + descriptors/mpeg_es.c libdvbv5_la_CPPFLAGS = -I../.. $(ENFORCE_LIBDVBV5_STATIC) libdvbv5_la_LDFLAGS = $(LIBDVBV5_VERSION) $(ENFORCE_LIBDVBV5_STATIC) -lm
Signature · 1 line
1.8.3.2
PATCH 7/11 libdvbv5: fix dvb_parse_descriptors and make dvb_desc_init private
In reply to André Roth- set list pointer to NULL in case of an error
- improve size checking
- dvb_desc_init is used only internal, remove from header
--- lib/include/libdvbv5/descriptors.h | 2 -- lib/libdvbv5/descriptors.c | 44 ++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 25 deletions(-)
lib/include/libdvbv5/descriptors.h +0 -2
@@ -78,8 +78,6 @@ void dvb_desc_default_print (struct dvb_v5_fe_parms *parms, const struct dvb_defor (_struct *_desc = (_struct *) _tbl->descriptor; _desc; _desc = (_struct *) _desc->next ) \if (_desc->type == _type) \ -ssize_t dvb_desc_init(const uint8_t *buf, struct dvb_desc *desc); - uint32_t bcd(uint32_t bcd);void hexdump (struct dvb_v5_fe_parms *parms,const char *prefix,const unsigned char *buf,int len);
lib/libdvbv5/descriptors.c +21 -23
83 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 8/11 libdvbv5: add attribute packed to structs and unions
In reply to André Roth__attribute__((packed)) is needed for nested structs and unions to get the correct size.
--- lib/include/libdvbv5/atsc_header.h | 2 +- lib/include/libdvbv5/desc_atsc_service_location.h | 4 ++-- lib/include/libdvbv5/desc_cable_delivery.h | 8 ++++---- lib/include/libdvbv5/desc_event_extended.h | 4 ++-- lib/include/libdvbv5/desc_frequency_list.h | 4 ++-- lib/include/libdvbv5/desc_isdbt_delivery.h | 4 ++-- lib/include/libdvbv5/desc_logical_channel.h | 4 ++-- lib/include/libdvbv5/desc_sat.h | 4 ++-- lib/include/libdvbv5/desc_t2_delivery.h | 4 ++-- lib/include/libdvbv5/header.h | 4 ++-- lib/include/libdvbv5/mpeg_es.h | 6 +++--- lib/include/libdvbv5/mpeg_ts.h | 2 +- lib/include/libdvbv5/nit.h | 4 ++-- lib/include/libdvbv5/pat.h | 2 +- lib/include/libdvbv5/pmt.h | 16 ++++++++-------- lib/include/libdvbv5/sdt.h | 2 +- lib/include/libdvbv5/vct.h | 4 ++-- 17 files changed, 39 insertions(+), 39 deletions(-)
lib/include/libdvbv5/atsc_header.h +1 -1
@@ -36,7 +36,7 @@ struct atsc_table_header { uint16_t priv:1; uint16_t syntax:1; } __attribute__((packed)); - }; + } __attribute__((packed));uint16_t id; uint8_t current_next:1; uint8_t version:5;
lib/include/libdvbv5/desc_atsc_service_location.h +2 -2
@@ -32,7 +32,7 @@ struct atsc_desc_service_location_elementary { uint16_t elementary_pid:13; uint16_t reserved:3; } __attribute__((packed)); - }; + } __attribute__((packed));char ISO_639_language_code[3 ]; } __attribute__((packed));
@@ -49,7 +49,7 @@ struct atsc_desc_service_location { uint16_t pcr_pid:13; uint16_t reserved:3; } __attribute__((packed)); - }; + } __attribute__((packed));uint8_t number_elements; } __attribute__((packed));
lib/include/libdvbv5/desc_cable_delivery.h +4 -4
@@ -37,16 +37,16 @@ struct dvb_desc_cable_delivery {struct {uint16_t fec_outer:4 ;uint16_t reserved_future_use:12 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed));uint8_t modulation;union {uint32_t bitfield2;struct {uint32_t fec_inner:4 ;uint32_t symbol_rate:28 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed)); } __attribute__((packed));struct dvb_v5_fe_parms ;
lib/include/libdvbv5/desc_event_extended.h +2 -2
@@ -34,9 +34,9 @@ struct dvb_desc_event_extended {struct {uint8_t last_id:4 ;uint8_t id:4 ; - }; + } __attribute__((packed));uint8_t ids; - }; + } __attribute__((packed));unsigned char language[4 ];char *text;
lib/include/libdvbv5/desc_frequency_list.h +2 -2
@@ -38,8 +38,8 @@ struct dvb_desc_frequency_list {struct {uint8_t freq_type:2 ;uint8_t reserved:6 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed)); } __attribute__((packed));struct dvb_v5_fe_parms ;
lib/include/libdvbv5/desc_isdbt_delivery.h +2 -2
@@ -38,8 +38,8 @@ struct isdbt_desc_terrestrial_delivery_system { uint16_t transmission_mode:2; uint16_t guard_interval:2; uint16_t area_code:6; - }; - }; + } __attribute__((packed)); + } __attribute__((packed)); } __attribute__((packed));struct dvb_v5_fe_parms ;
lib/include/libdvbv5/desc_logical_channel.h +2 -2
@@ -36,8 +36,8 @@ struct dvb_desc_logical_channel_number { uint16_t logical_channel_number:10; uint16_t reserved:5; uint16_t visible_service_flag:1; - }; - }; + } __attribute__((packed)); + } __attribute__((packed)); } __attribute__((packed));struct dvb_desc_logical_channel {
lib/include/libdvbv5/desc_sat.h +2 -2
@@ -42,8 +42,8 @@ struct dvb_desc_sat {struct {uint32_t fec:4 ;uint32_t symbol_rate:28 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed)); } __attribute__((packed));struct dvb_v5_fe_parms ;
lib/include/libdvbv5/desc_t2_delivery.h +2 -2
@@ -43,8 +43,8 @@ struct dvb_desc_t2_delivery { uint16_t reserved:2; uint16_t bandwidth:3; uint16_t SISO_MISO:2; - }; - }; + } __attribute__((packed)); + } __attribute__((packed));uint32_t *centre_frequency;uint8_t frequency_loop_length;
lib/include/libdvbv5/header.h +2 -2
@@ -36,7 +36,7 @@ struct dvb_ts_packet_header { uint16_t payload_unit_start_indicator:1; uint16_t transport_error_indicator:1; } __attribute__((packed)); - }; + } __attribute__((packed)); uint8_t continuity_counter:4; uint8_t adaptation_field_control:2; uint8_t transport_scrambling_control:2;
@@ -56,7 +56,7 @@ struct dvb_table_header { uint8_t zero2:1; uint8_t syntax:1; } __attribute__((packed)); - }; + } __attribute__((packed));uint16_t id;/* TS ID */ uint8_t current_next:1; uint8_t version:5;
lib/include/libdvbv5/mpeg_es.h +3 -3
@@ -47,7 +47,7 @@ struct dvb_mpeg_es_seq_start { uint32_t height:12; uint32_t width:12; } __attribute__((packed)); - }; + } __attribute__((packed)); union { uint32_t bitfield3; struct {
@@ -58,7 +58,7 @@ struct dvb_mpeg_es_seq_start { uint32_t one:1; uint32_t bitrate:18; } __attribute__((packed)); - }; + } __attribute__((packed)); } __attribute__((packed));struct dvb_mpeg_es_pic_start {
@@ -77,7 +77,7 @@ struct dvb_mpeg_es_pic_start { uint32_t coding_type:3; uint32_t temporal_ref:10; } __attribute__((packed)); - }; + } __attribute__((packed)); } __attribute__((packed));enum dvb_mpeg_es_frame_t
lib/include/libdvbv5/mpeg_ts.h +1 -1
@@ -52,7 +52,7 @@ struct dvb_mpeg_ts { uint16_t payload_start:1; uint16_t tei:1; } __attribute__((packed)); - }; + } __attribute__((packed));struct {uint8_t continuity_counter:4 ;uint8_t payload:1 ;
lib/include/libdvbv5/nit.h +2 -2
@@ -49,7 +49,7 @@ struct dvb_table_nit_transport { uint16_t section_length:12; uint16_t reserved:4; } __attribute__((packed)); - }; + } __attribute__((packed));struct dvb_desc *descriptor;struct dvb_table_nit_transport *next; } __attribute__((packed));
@@ -62,7 +62,7 @@ struct dvb_table_nit { uint16_t desc_length:12; uint16_t reserved:4; } __attribute__((packed)); - }; + } __attribute__((packed));struct dvb_desc *descriptor;struct dvb_table_nit_transport *transport; } __attribute__((packed));
lib/include/libdvbv5/pat.h +1 -1
@@ -38,7 +38,7 @@ struct dvb_table_pat_program { uint16_t pid:13; uint8_t reserved:3; } __attribute__((packed)); - }; + } __attribute__((packed));struct dvb_table_pat_program *next; } __attribute__((packed));
lib/include/libdvbv5/pmt.h +8 -8
@@ -64,16 +64,16 @@ struct dvb_table_pmt_stream {struct {uint16_t elementary_pid:13 ;uint16_t reserved:3 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed));union {uint16_t bitfield2;struct {uint16_t section_length:10 ;uint16_t zero:2 ;uint16_t reserved2:4 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed));struct dvb_desc *descriptor;struct dvb_table_pmt_stream *next; } __attribute__((packed));
@@ -85,8 +85,8 @@ struct dvb_table_pmt {struct {uint16_t pcr_pid:13 ;uint16_t reserved2:3 ; - }; - }; + } __attribute__((packed)); + } __attribute__((packed));union {uint16_t bitfield2;
@@ -94,8 +94,8 @@ struct dvb_table_pmt { uint16_t prog_length:10; uint16_t zero3:2; uint16_t reserved3:4; - }; - }; + } __attribute__((packed)); + } __attribute__((packed));struct dvb_table_pmt_stream *stream; } __attribute__((packed));
lib/include/libdvbv5/sdt.h +1 -1
@@ -44,7 +44,7 @@ struct dvb_table_sdt_service { uint16_t free_CA_mode:1; uint16_t running_status:3; } __attribute__((packed)); - }; + } __attribute__((packed));struct dvb_desc *descriptor;struct dvb_table_sdt_service *next; } __attribute__((packed));
lib/include/libdvbv5/vct.h +2 -2
@@ -103,8 +103,8 @@ union atsc_table_vct_descriptor_length {struct {uint16_t descriptor_length:10 ;uint16_t reserved:6 ; - }; -}; + } __attribute__((packed)); +} __attribute__((packed));#define atsc_vct_channel_foreach (_channel, _vct) \ for (struct atsc_table_vct_channel *_channel = _vct->channel; _channel; _channel = _channel->next) \
Signature · 1 line
1.8.3.2
PATCH 9/11 libdvbv5: add parser for CAT
In reply to André Roth--- lib/include/libdvbv5/cat.h | 51 ++++++++++++++++++++++++++++++ lib/libdvbv5/Makefile.am | 2 ++ lib/libdvbv5/descriptors.c | 2 ++ lib/libdvbv5/descriptors/cat.c | 72 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 lib/include/libdvbv5/cat.h create mode 100644 lib/libdvbv5/descriptors/cat.c
lib/include/libdvbv5/cat.h new file +51 -0
@@ -0,0 +1,51 @@ +/* +* Copyright (c) 2013 - Andre Roth <[email protected]> +* +* 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 +* +*/ + +#ifndef _CAT_H +#define _CAT_H + +#include <stdint.h> +#include <unistd.h> /* ssize_t */ + +#include <libdvbv5/header.h> + +#define DVB_TABLE_CAT 0x01 +#define DVB_TABLE_CAT_PID 0x0001 + +struct dvb_table_cat { +struct dvb_table_header header; +struct dvb_desc *descriptor; +} __attribute__((packed)); + +struct dvb_v5_fe_parms ; + +#ifdef __cplusplus +extern "C" { +#endif + +void dvb_table_cat_init (struct dvb_v5_fe_parms *parms,const uint8_t *buf,ssize_t buflen,uint8_t *table,ssize_t *table_length); +void dvb_table_cat_free (struct dvb_table_cat *cat); +void dvb_table_cat_print (struct dvb_v5_fe_parms *parms,struct dvb_table_cat *t); + +#ifdef __cplusplus +} +#endif + +#endif
lib/libdvbv5/Makefile.am +2 -0
@@ -39,6 +39,7 @@ otherinclude_HEADERS = \ ../include/libdvbv5/atsc_header.h \ ../include/libdvbv5/mgt.h \ ../include/libdvbv5/eit.h \ + ../include/libdvbv5/cat.h \ ../include/libdvbv5/atsc_eit.h \ ../include/libdvbv5/desc_service_location.h \ ../include/libdvbv5/mpeg_ts.h \
@@ -74,6 +75,7 @@ libdvbv5_la_SOURCES = \ descriptors/vct.c \ descriptors/mgt.c \ descriptors/eit.c \ + descriptors/cat.c \ descriptors/atsc_eit.c \ descriptors/desc_language.c \ descriptors/desc_network_name.c \
lib/libdvbv5/descriptors.c +2 -0
@@ -31,6 +31,7 @@#include <libdvbv5/dvb-log.h> #include <libdvbv5/pat.h> +#include <libdvbv5/cat.h> #include <libdvbv5/pmt.h> #include <libdvbv5/nit.h> #include <libdvbv5/sdt.h>
@@ -78,6 +79,7 @@ void dvb_desc_default_print(struct dvb_v5_fe_parms *parms, const struct dvb_descconst struct dvb_table_init dvb_table_initializers[] = { [DVB_TABLE_PAT ] = { dvb_table_pat_init,sizeof (struct dvb_table_pat ) }, + [DVB_TABLE_CAT ] = { dvb_table_cat_init,sizeof (struct dvb_table_cat ) }, [DVB_TABLE_PMT ] = { dvb_table_pmt_init,sizeof (struct dvb_table_pmt ) }, [DVB_TABLE_NIT ] = { dvb_table_nit_init,sizeof (struct dvb_table_nit ) }, [DVB_TABLE_SDT ] = { dvb_table_sdt_init,sizeof (struct dvb_table_sdt ) },
lib/libdvbv5/descriptors/cat.c new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 10/11 libdvbv5: add parser for ca and ca_identifier descriptors
In reply to André Roth--- lib/include/libdvbv5/desc_ca.h | 63 ++++++++++++++++++++++++++ lib/include/libdvbv5/desc_ca_identifier.h | 55 +++++++++++++++++++++++ lib/libdvbv5/Makefile.am | 10 +++-- lib/libdvbv5/descriptors.c | 18 ++++---- lib/libdvbv5/descriptors/desc_ca.c | 64 +++++++++++++++++++++++++++ lib/libdvbv5/descriptors/desc_ca_identifier.c | 58 ++++++++++++++++++++++++ 6 files changed, 257 insertions(+), 11 deletions(-) create mode 100644 lib/include/libdvbv5/desc_ca.h create mode 100644 lib/include/libdvbv5/desc_ca_identifier.h create mode 100644 lib/libdvbv5/descriptors/desc_ca.c create mode 100644 lib/libdvbv5/descriptors/desc_ca_identifier.c
lib/include/libdvbv5/desc_ca.h new file +63 -0
@@ -0,0 +1,63 @@ +/* +* Copyright (c) 2013 - Andre Roth <[email protected]> +* +* 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 at ETSI EN 300 468 V1.11.1 (2010-04) +*/ + +#ifndef _CA_H +#define _CA_H + +#include <stdint.h> +#include <unistd.h> /* ssize_t */ + +struct dvb_desc_ca { +uint8_t type; +uint8_t length; +struct dvb_desc *next; + +uint16_t ca_id; +union { +uint16_t bitfield1; +struct { +uint16_t ca_pid:13 ; +uint16_t reserved:3 ; + } __attribute__((packed)); + } __attribute__((packed)); + +uint8_t *privdata; +uint8_t privdata_len; +} __attribute__((packed)); + +struct dvb_v5_fe_parms ; + +#define dvb_desc_ca_field_first ca_id +#define dvb_desc_ca_field_last privdata + +#ifdef __cplusplus +extern "C" { +#endif + +void dvb_desc_ca_init (struct dvb_v5_fe_parms *parms,const uint8_t *buf,struct dvb_desc *desc); +void dvb_desc_ca_print (struct dvb_v5_fe_parms *parms,const struct dvb_desc *desc); +void dvb_desc_ca_free (struct dvb_desc *desc); + +#ifdef __cplusplus +} +#endif + +#endif
lib/include/libdvbv5/desc_ca_identifier.h new file +55 -0
55 lines not on this page · raw message
lib/libdvbv5/Makefile.am +7 -3
@@ -33,6 +33,9 @@ otherinclude_HEADERS = \ ../include/libdvbv5/desc_logical_channel.h \ ../include/libdvbv5/desc_ts_info.h \ ../include/libdvbv5/desc_partial_reception.h \ + ../include/libdvbv5/desc_service_location.h \ + ../include/libdvbv5/desc_ca.h \ + ../include/libdvbv5/desc_ca_identifier.h \ ../include/libdvbv5/nit.h \ ../include/libdvbv5/sdt.h \ ../include/libdvbv5/vct.h \
@@ -41,7 +44,6 @@ otherinclude_HEADERS = \ ../include/libdvbv5/eit.h \ ../include/libdvbv5/cat.h \ ../include/libdvbv5/atsc_eit.h \ - ../include/libdvbv5/desc_service_location.h \ ../include/libdvbv5/mpeg_ts.h \ ../include/libdvbv5/mpeg_pes.h \ ../include/libdvbv5/mpeg_es.h
@@ -96,8 +98,10 @@ libdvbv5_la_SOURCES = \ descriptors/desc_ts_info.c \ descriptors/desc_partial_reception.c \ descriptors/desc_service_location.c \ - descriptors/mpeg_ts.c \ - descriptors/mpeg_pes.c \ + descriptors/desc_ca.c \ + descriptors/desc_ca_identifier.c \ + descriptors/mpeg_ts.c \ + descriptors/mpeg_pes.c \ descriptors/mpeg_es.c libdvbv5_la_CPPFLAGS = -I../.. $(ENFORCE_LIBDVBV5_STATIC)
lib/libdvbv5/descriptors.c +10 -8
@@ -55,6 +55,8 @@#include <libdvbv5/desc_ts_info.h> #include <libdvbv5/desc_logical_channel.h> #include <libdvbv5/desc_partial_reception.h> +#include <libdvbv5/desc_ca.h> +#include <libdvbv5/desc_ca_identifier.h> #include <libdvbv5/desc_extension.h> static void dvb_desc_init (uint8_t type,uint8_t length,struct dvb_desc *desc)
@@ -242,10 +244,10 @@ const struct dvb_descriptor dvb_descriptors[] = { }, [conditional_access_descriptor] = { .name = "conditional_access_descriptor", - .init = NULL, - .print = NULL, - .free = NULL, - .size = 0, + .init = dvb_desc_ca_init, + .print = dvb_desc_ca_print, + .free = dvb_desc_ca_free, + .size = sizeof(struct dvb_desc_ca), }, [iso639_language_descriptor] = { .name = "iso639_language_descriptor",
@@ -571,10 +573,10 @@ const struct dvb_descriptor dvb_descriptors[] = { }, [CA_identifier_descriptor] = { .name = "CA_identifier_descriptor", - .init = NULL, - .print = NULL, - .free = NULL, - .size = 0, + .init = dvb_desc_ca_identifier_init, + .print = dvb_desc_ca_identifier_print, + .free = dvb_desc_ca_identifier_free, + .size = sizeof(struct dvb_desc_ca_identifier), }, [content_descriptor] = { .name = "content_descriptor",
lib/libdvbv5/descriptors/desc_ca.c new file +64 -0
64 lines not on this page · raw message
lib/libdvbv5/descriptors/desc_ca_identifier.c new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 11/11 libdvbv5: fix PMT parser
In reply to André Roth- check for correct table ID
- parse all descriptos
- improve table printing
--- lib/include/libdvbv5/pmt.h | 10 ++++-- lib/libdvbv5/descriptors/pmt.c | 80 ++++++++++++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 29 deletions(-)
lib/include/libdvbv5/pmt.h +7 -3
@@ -27,7 +27,7 @@#include <libdvbv5/header.h> -#define DVB_TABLE_PMT 2 +#define DVB_TABLE_PMT 0x02enum dvb_streams { stream_reserved0 =0x00 ,// ITU-T | ISO/IEC Reserved
@@ -69,7 +69,7 @@ struct dvb_table_pmt_stream {union {uint16_t bitfield2;struct { -uint16_t section_length:10 ; +uint16_t desc_length:10 ;uint16_t zero:2 ;uint16_t reserved2:4 ; } __attribute__((packed));
@@ -91,14 +91,18 @@ struct dvb_table_pmt {union {uint16_t bitfield2;struct { -uint16_t prog_length:10 ; +uint16_t desc_length:10 ;uint16_t zero3:2 ;uint16_t reserved3:4 ; } __attribute__((packed)); } __attribute__((packed)); +struct dvb_desc *descriptor;struct dvb_table_pmt_stream *stream; } __attribute__((packed)); +#define dvb_pmt_field_first header +#define dvb_pmt_field_last descriptor +#define dvb_pmt_stream_foreach (_stream, _pmt) \ for (struct dvb_table_pmt_stream *_stream = _pmt->stream; _stream; _stream = _stream->next) \
lib/libdvbv5/descriptors/pmt.c +54 -26
131 lines not on this page · raw message
Signature · 1 line
1.8.3.2
Re: [PATCH 11/11] libdvbv5: fix PMT parser
lib/libdvbv5/descriptors/pmt.c line 5
Quoted 10 lines · André Roth
lib/libdvbv5/descriptors/pmt.c +1
-2@@ -1,6 +1,5 @@/* -* Copyright (c) 2011-2012 - Mauro Carvalho Chehab -* Copyright (c) 2012 - Andre Roth <[email protected]> +* Copyright (c) 2013 - Andre Roth <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
This copyright change looked strange to me. Accidental deletion?
Bjørn
Re: [PATCH 11/11] libdvbv5: fix PMT parser
Quoted 8 lines · On Tue, 25 Mar 2014 21:51:49 +0100 Bjørn Mork <[email protected]> wrote:
Quoted 6 lines
- * Copyright (c) 2011-2012 - Mauro Carvalho Chehab
- * Copyright (c) 2012 - Andre Roth <[email protected]>
+ * Copyright (c) 2013 - Andre Roth <[email protected]> *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public LicenseThis copyright change looked strange to me. Accidental deletion?
Hi Bjørn,
thanks for pointing this out.
originally I was adding mauro to my dvb files as the "owner" of dvb in v4l. mauro then stated on some files that this was not his code and as the PMT is originally my code, I corrected this here.
@mauro: please correct me if I'm wrong...
I'm a bit confused about the copyright year and author. Is this still needed in the age of git ? What is the policy for them ?
regards,
andré
Re: [PATCH 11/11] libdvbv5: fix PMT parser
Quoted 12 lines · André Roth
Quoted 8 lines · On Tue, 25 Mar 2014 21:51:49 +0100 Bjørn Mork <[email protected]> wrote:
Quoted 6 lines
- * Copyright (c) 2011-2012 - Mauro Carvalho Chehab
- * Copyright (c) 2012 - Andre Roth <[email protected]>
+ * Copyright (c) 2013 - Andre Roth <[email protected]> *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public LicenseThis copyright change looked strange to me. Accidental deletion?
Quoted 8 lines
Hi Bjørn,
thanks for pointing this out.
originally I was adding mauro to my dvb files as the "owner" of dvb in v4l. mauro then stated on some files that this was not his code and as the PMT is originally my code, I corrected this here.@mauro: please correct me if I'm wrong...
Correcting the copyright is of course fine, but I think it would be good to document that in the patch description so people like me don't end up asking unnecessary questions :-)
Quoted 2 lines
I'm a bit confused about the copyright year and author. Is this still needed in the age of git ? What is the policy for them ?
IANAL. But looking at this from a practical point of view, I believe that this info is useful whether it is required or not. Reading the copyright owner(s) out of a git log can be a lot of work, and it isn't necessariliy correct either - your copyright can be assigned to e.g. your employer or to the FSF. It's also difficult to judge who of many contributors have made changes big enough to make them copyright owners. Some changes can be small in code size but still major, while other changes can touch almost every line but still only be a minor editorial fixup.
And why is it useful who owns a copyright and when the copyrighted work was produced? If relicensing your code ever becomes a question, then we need to know who to contact. You might think that relicensing isn't going to happen. But there are real world examples where code has ended up beeing linked to libraries with a GPL conflicting license, and therefore needed an exception. The classical example is linking with openssl.
And the year is useful because copyright expires some years (depending on country of origin, but typical 50) after the authors death. You write code that will live forever, right? :-)
Bjørn
Re: [PATCH 11/11] libdvbv5: fix PMT parser
Em Wed, 26 Mar 2014 07:38:15 +0100
Bjørn Mork <[email protected]> escreveu:
Quoted 21 lines
Quoted 19 lines · André Roth
Quoted 8 lines · On Tue, 25 Mar 2014 21:51:49 +0100 Bjørn Mork <[email protected]> wrote:
Quoted 6 lines
- * Copyright (c) 2011-2012 - Mauro Carvalho Chehab
- * Copyright (c) 2012 - Andre Roth <[email protected]>
+ * Copyright (c) 2013 - Andre Roth <[email protected]> *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public LicenseThis copyright change looked strange to me. Accidental deletion?
Hi Bjørn,
thanks for pointing this out.
originally I was adding mauro to my dvb files as the "owner" of dvb in v4l. mauro then stated on some files that this was not his code and as the PMT is originally my code, I corrected this here.
Quoted 5 lines
Quoted 1 line
@mauro: please correct me if I'm wrong...
Correcting the copyright is of course fine, but I think it would be good to document that in the patch description so people like me don't end up asking unnecessary questions :-)
Yeah, a proper documentation always help.
Btw, what we generally do here is to extend the copyright timestamp, instead of just replacing, like:
Copyright (c) 2012-2014
Quoted 4 lines
Quoted 3 lines
I'm a bit confused about the copyright year and author. Is this still needed in the age of git ? What is the policy for them ?
Quoted 9 lines
IANAL. But looking at this from a practical point of view, I believe that this info is useful whether it is required or not. Reading the copyright owner(s) out of a git log can be a lot of work, and it isn't necessariliy correct either - your copyright can be assigned to e.g. your employer or to the FSF. It's also difficult to judge who of many contributors have made changes big enough to make them copyright owners. Some changes can be small in code size but still major, while other changes can touch almost every line but still only be a minor editorial fixup.
The copyright laws were written to cover all sorts of intelectual work, and were written originally to cover music, painting, literature work. There are actually two kinds of copyrights: moral rights and economic rights.
The GPL license (and all other sorts of licensing) deals with the economic rights. A copyright line, however, can, IMO, serve for both
purposes: to tell the authorship and to identify who owns the economic rights and who is licensing them under GPL.
If you develop something under your work contract, your employer likely has property rights.
Yet, you still owns the moral rights[1]. On most Countries, it is not even possible to transfer them to someone else.
[1] http://en.wikipedia.org/wiki/Moral_rights
That warrants that a book written by, let's say, Julio Verne, will always be copyrighted by him, no matter if he (or his family) sold the economic rights, or if his books are already in public domain or not.
Quoted 11 lines
And why is it useful who owns a copyright and when the copyrighted work was produced? If relicensing your code ever becomes a question, then we need to know who to contact. You might think that relicensing isn't going to happen. But there are real world examples where code has ended up beeing linked to libraries with a GPL conflicting license, and therefore needed an exception. The classical example is linking with openssl.
And the year is useful because copyright expires some years (depending on country of origin, but typical 50) after the authors death. You write code that will live forever, right? :-)
Yeah, the property rights expires.
The moral rights, however, never expire: if someone uses part of the Illiad (written around the 8th Century BC by Homero) on his work, he can't claim any rights on it, because that part of the text will forever belong to Homero.
Quoted 7 lines
Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Regards, Mauro