diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 4dbe069..bcfdcf1 --- a/Makefile +++ b/Makefile @@ -175,7 +175,8 @@ PROGS = \ $(BINDIR)/tsserve \ $(BINDIR)/ts_packet_insert \ $(BINDIR)/m2ts2ts \ - $(BINDIR)/pcapreport + $(BINDIR)/pcapreport \ + $(BINDIR)/tsdvbsub #\ # $(BINDIR)/test_ps @@ -268,6 +269,8 @@ $(BINDIR)/m2ts2ts: $(OBJDIR)/m2ts2ts.o $(STATIC_LIB) $(CC) $< -o $(BINDIR)/m2ts2ts $(LDFLAGS) $(LIBOPTS) $(BINDIR)/pcapreport: $(OBJDIR)/pcapreport.o $(STATIC_LIB) $(CC) $< -o $(BINDIR)/pcapreport $(LDFLAGS) $(LIBOPTS) +$(BINDIR)/tsdvbsub: $(OBJDIR)/tsdvbsub.o $(STATIC_LIB) + $(CC) $< -o $(BINDIR)/tsdvbsub $(LDFLAGS) $(LIBOPTS) @@ -337,6 +340,8 @@ $(OBJDIR)/ts2es.o: ts2es.c $(TS_H) misc_fns.h version.h $(CC) -c $< -o $@ $(CFLAGS) $(OBJDIR)/ts2ps.o: ts2ps.c $(TS_H) $(PS_H) misc_fns.h version.h $(CC) -c $< -o $@ $(CFLAGS) +$(OBJDIR)/tsdvbsub.o: tsdvbsub.c $(TS_H) misc_fns.h version.h + $(CC) -c $< -o $@ $(CFLAGS) $(OBJDIR)/tsinfo.o: tsinfo.c $(TS_H) misc_fns.h version.h $(CC) -c $< -o $@ $(CFLAGS) $(OBJDIR)/tsreport.o: tsreport.c $(TS_H) fmtx.h misc_fns.h version.h diff --git a/Makefile.w32 b/Makefile.w32 old mode 100644 new mode 100755 index 0f52c5c..1e0dc87 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -81,6 +81,7 @@ PROGS = \ $(EXEDIR)\stream_type.exe \ $(EXEDIR)\ts2es.exe \ $(EXEDIR)\ts_packet_insert.exe \ + $(EXEDIR)\tsdvbsub.exe \ $(EXEDIR)\tsinfo.exe \ $(EXEDIR)\tsplay.exe \ $(EXEDIR)\tsreport.exe \ @@ -130,6 +131,7 @@ PROG_OBJS = \ $(OBJDIR)/stream_type.obj \ $(OBJDIR)/ts2es.obj \ $(OBJDIR)/ts_packet_insert.obj \ + $(OBJDIR)\tsdvbsub.obj \ $(OBJDIR)/tsinfo.obj \ $(OBJDIR)/tsplay.obj \ $(OBJDIR)/tsreport.obj \ @@ -189,6 +191,9 @@ $(EXEDIR)\psdots.exe: $(OBJDIR)\psdots.obj $(LIBFILE) $(EXEDIR)\ts_packet_insert.exe: $(OBJDIR)\ts_packet_insert.obj $(LIBFILE) link /out:$@ $(LOPT) $** wsock32.lib +$(EXEDIR)\tsdvbsub.exe: $(OBJDIR)\tsdvbsub.obj $(LIBFILE) + link /out:$@ $(LOPT) $** wsock32.lib + $(EXEDIR)\tsinfo.exe: $(OBJDIR)\tsinfo.obj $(LIBFILE) link /out:$@ $(LOPT) $** wsock32.lib diff --git a/misc.c b/misc.c old mode 100644 new mode 100755 index bd5e06b..19c5c10 --- a/misc.c +++ b/misc.c @@ -134,8 +134,8 @@ extern uint32_t crc32_block(uint32_t crc, byte *pData, int blk_len) * if not all bytes were shown). */ extern void print_data(int is_msg, - char *name, - byte data[], + const char *name, + const byte data[], int length, int max) { diff --git a/misc_fns.h b/misc_fns.h old mode 100644 new mode 100755 index 44b4a55..2a3c697 --- a/misc_fns.h +++ b/misc_fns.h @@ -75,8 +75,8 @@ extern void print_bits(int num_bits, * if not all bytes were shown). */ extern void print_data(int is_msg, - char *name, - byte data[], + const char *name, + const byte data[], int length, int max); /* diff --git a/ts.c b/ts.c index a2194b1..8fe7143 100755 --- a/ts.c +++ b/ts.c @@ -2203,6 +2203,48 @@ extern int extract_prog_list_from_pat(int verbose, return 0; } + +static const char * dvb_component_type3_str(int component_type) +{ + switch (component_type) + { + case 0x01: + return "EBU Teletext subtitles"; + case 0x02: + return "associated EBU Teletext"; + case 0x03: + return "VBI data"; + case 0x10: + return "DVB subtitles (normal) with no monitor aspect ratio criticality"; + case 0x11: + return "DVB subtitles (normal) for display on 4:3 aspect ratio monitor"; + case 0x12: + return "DVB subtitles (normal) for display on 16:9 aspect ratio monitor"; + case 0x13: + return "DVB subtitles (normal) for display on 2.21:1 aspect ratio monitor"; + case 0x14: + return "DVB subtitles (normal) for display on a high definition monitor"; + case 0x20: + return "DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality"; + case 0x21: + return "DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor"; + case 0x22: + return "DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor"; + case 0x23: + return "DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor"; + case 0x24: + return "DVB subtitles (for the hard of hearing) for display on a high definition monitor"; + + default: + if (component_type >= 0xb0 && component_type <= 0xfe) + { + return "user defined"; + } + break; + } + return "reserved"; +} + /* * Print out information about program descriptors * (either from the PMT program info, or the PMT/stream ES info) @@ -2362,7 +2404,7 @@ extern int print_descriptors(int is_msg, case 0x59: { - fprint_msg_or_err(is_msg, "subtitling_descriptor:\n"); + fprint_msg_or_err(is_msg, "subtitling_descriptor(s):\n"); for (ii = 0; ii + 8 <= this_length; ii += 8) { @@ -2380,8 +2422,11 @@ extern int print_descriptors(int is_msg, lang, subtitling_type); if (leader1 != NULL) fprint_msg_or_err(is_msg,"%s",leader1); if (leader2 != NULL) fprint_msg_or_err(is_msg,"%s",leader2); + fprint_msg_or_err(is_msg, " (%s)\n", dvb_component_type3_str(subtitling_type)); + if (leader1 != NULL) fprint_msg_or_err(is_msg,"%s",leader1); + if (leader2 != NULL) fprint_msg_or_err(is_msg,"%s",leader2); fprint_msg_or_err(is_msg, - " composition_page_id=%u, ancillary_page_id=%u\n", + " composition_page_id=%u, ancillary_page_id=%u\n", composition_page_id, ancillary_page_id); } if (ii < this_length)