Added tsdvbsub, a small utility that dumps the contents of a DVB subtitle

stream inn a TS.  This is still in the early stages of development, but may
be useful for checking that subtitles and timestamps align in an expected
manner
issue20
John Cox 2011-10-20 16:43:43 +01:00
rodzic dbb3ce681d
commit f52aca0e05
5 zmienionych plików z 62 dodań i 7 usunięć

7
Makefile 100644 → 100755
Wyświetl plik

@ -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

5
Makefile.w32 100644 → 100755
Wyświetl plik

@ -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

4
misc.c 100644 → 100755
Wyświetl plik

@ -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)
{

4
misc_fns.h 100644 → 100755
Wyświetl plik

@ -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);
/*

49
ts.c
Wyświetl plik

@ -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)