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 | |
| parent | 793aa61b1d9c71777e88a7a71ce434a090ef553f (diff) | |
| download | xineliboutput-19a008fb1709dda93dfe84ecca7bb3a019998e72.tar.gz xineliboutput-19a008fb1709dda93dfe84ecca7bb3a019998e72.tar.bz2 | |
Support for HDMV format PMT. Demux audio streams, ignore graphics streams.
| -rw-r--r-- | tools/ts.c | 40 | ||||
| -rw-r--r-- | tools/ts.h | 15 | ||||
| -rw-r--r-- | xine/ts2es.c | 24 |
3 files changed, 75 insertions, 4 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 */ diff --git a/xine/ts2es.c b/xine/ts2es.c index 9b6c0de0..0dd420cd 100644 --- a/xine/ts2es.c +++ b/xine/ts2es.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: ts2es.c,v 1.19 2013-01-06 21:20:11 phintuka Exp $ + * $Id: ts2es.c,v 1.20 2013-01-06 21:23:44 phintuka Exp $ * */ @@ -81,6 +81,17 @@ static void ts2es_parse_pes(ts2es_t *this) /* parse substream header */ + if (this->stream_type == HDMV_AUDIO_80_PCM) { + + this->buf->decoder_flags |= BUF_FLAG_SPECIAL; + this->buf->decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG; + this->buf->decoder_info[2] = (this->buf->content[3] << 24) | (this->buf->content[2] << 16) | + (this->buf->content[1] << 8) | this->buf->content[0]; + this->buf->content += 4; + this->buf->size -= 4; + return; + } + if (pes_pid != PRIVATE_STREAM1) return; @@ -317,18 +328,27 @@ ts2es_t *ts2es_init(fifo_buffer_t *dst_fifo, ts_stream_type stream_type, uint st /* RAW AC3 */ case STREAM_AUDIO_AC3: + case HDMV_AUDIO_83_TRUEHD: data->xine_buf_type = BUF_AUDIO_A52; break; /* EAC3 (xine-lib > 1.1.18.1) */ #ifdef BUF_AUDIO_EAC3 case STREAM_AUDIO_EAC3: + case HDMV_AUDIO_84_EAC3: data->xine_buf_type = BUF_AUDIO_EAC3; break; #endif + case HDMV_AUDIO_80_PCM: + data->xine_type = BUF_AUDIO_LPCM_BE; + break; + /* DTS (PES stream 0xbd) */ - case STREAM_AUDIO_DTS: + case STREAM_AUDIO_DTS: + case HDMV_AUDIO_82_DTS: + case HDMV_AUDIO_85_DTS_HRA: + case HDMV_AUDIO_86_DTS_HD_MA: data->xine_buf_type = BUF_AUDIO_DTS; break; |
