diff options
| author | phintuka <phintuka> | 2013-01-06 21:23:44 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2013-01-06 21:23:44 +0000 |
| commit | 19a008fb1709dda93dfe84ecca7bb3a019998e72 (patch) | |
| tree | d1110ae6c4814936de96fd07988d6095e5ea4fa9 /tools | |
| parent | 793aa61b1d9c71777e88a7a71ce434a090ef553f (diff) | |
| download | xineliboutput-19a008fb1709dda93dfe84ecca7bb3a019998e72.tar.gz xineliboutput-19a008fb1709dda93dfe84ecca7bb3a019998e72.tar.bz2 | |
Support for HDMV format PMT. Demux audio streams, ignore graphics streams.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/ts.c | 40 | ||||
| -rw-r--r-- | tools/ts.h | 15 |
2 files changed, 53 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: ts.c,v 1.32 2013-01-06 21:21:08 phintuka Exp $ + * $Id: ts.c,v 1.33 2013-01-06 21:23:43 phintuka Exp $ * */ @@ -273,6 +273,8 @@ int ts_parse_pmt (pmt_data_t *pmt, uint program_no, const uint8_t *pkt) int count; uint8_t len; uint offset = 0; + uint32_t program_info_format_identifier = 0; + uint8_t hdmv_pmt = 0; /* * A new section should start with the payload unit start @@ -381,6 +383,17 @@ int ts_parse_pmt (pmt_data_t *pmt, uint program_no, const uint8_t *pkt) /* ES definitions start here */ program_info_length = ((pmt->pmt[10] << 8) | pmt->pmt[11]) & 0x0fff; + ts_get_reg_desc(&program_info_format_identifier, + &pmt->pmt[12], program_info_length); + if (program_info_format_identifier) { + if ((program_info_format_identifier == (('H' << 24) | ('D' << 16) | ('M' << 8) | 'V'))) { + LOGMSG("PMT program info has tag 0x05 (format_identifier), content HDMV (0x%x)\n", program_info_format_identifier); + hdmv_pmt = 1; + } else { + LOGMSG("PMT program info has tag 0x05 (format_identifier), content 0x%x\n", program_info_format_identifier); + } + } + stream = &pmt->pmt[12] + program_info_length; coded_length = 13 + program_info_length; if (coded_length > section_length) { @@ -475,6 +488,31 @@ int ts_parse_pmt (pmt_data_t *pmt, uint program_no, const uint8_t *pkt) } break; + case HDMV_SPU_90_BITMAP & 0xff: + case HDMV_SPU_91_INTERACTIVE & 0xff: + case HDMV_SPU_92_TEXT & 0xff: + if (hdmv_pmt) + break; // ignore BluRay PG/IG/TextST streams + /* fall thru */ + case HDMV_AUDIO_80_PCM & 0xff: + case HDMV_AUDIO_82_DTS & 0xff: + case HDMV_AUDIO_83_TRUEHD & 0xff: + case HDMV_AUDIO_84_EAC3 & 0xff: + case HDMV_AUDIO_85_DTS_HRA & 0xff: + case HDMV_AUDIO_86_DTS_HD_MA & 0xff: + if (hdmv_pmt) { + if ((pmt->audio_tracks_count < TS_MAX_AUDIO_TRACKS)) { + if (find_audio_track(pmt, pid) < 0) { + pmt->audio_tracks[pmt->audio_tracks_count].pid = pid; + pmt->audio_tracks[pmt->audio_tracks_count].type = (ts_stream_type)(stream[0] | STREAM_HDMV); + pmt->audio_tracks_count++; + break; + } + } + break; + } + /* fall thru */ + default: /* This following section handles all the cases where the audio track info is stored @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: ts.h,v 1.18 2013-01-06 21:20:11 phintuka Exp $ + * $Id: ts.h,v 1.19 2013-01-06 21:23:43 phintuka Exp $ * */ @@ -86,6 +86,19 @@ typedef enum { STREAM_AUDIO_AAC = 0x7c06, // ISO_13818_PES_PRIVATE | (STREAM_DESCR_AAC << 8) STREAM_DVBSUB = 0x5906, // ISO_13818_PES_PRIVATE | (STREAM_DESCR_DVBSUB << 8) + /* HDMV */ + STREAM_HDMV = 0xff00, + HDMV_AUDIO_80_PCM = 0x80 | STREAM_HDMV, /* BluRay PCM */ + HDMV_AUDIO_82_DTS = 0x82 | STREAM_HDMV, /* DTS */ + HDMV_AUDIO_83_TRUEHD = 0x83 | STREAM_HDMV, /* Dolby TrueHD, primary audio */ + HDMV_AUDIO_84_EAC3 = 0x84 | STREAM_HDMV, /* Dolby Digital plus, primary audio */ + HDMV_AUDIO_85_DTS_HRA = 0x85 | STREAM_HDMV, /* DTS-HRA */ + HDMV_AUDIO_86_DTS_HD_MA = 0x86 | STREAM_HDMV, /* DTS-HD Master audio */ + + HDMV_SPU_90_BITMAP = 0x90 | STREAM_HDMV, /* Presentation Graphics */ + HDMV_SPU_91_INTERACTIVE = 0x91 | STREAM_HDMV, /* Interactive Graphics */ + HDMV_SPU_92_TEXT = 0x92 | STREAM_HDMV, /* Text subtitles */ + } ts_stream_type; /* stream info descriptors */ |
